This Demonstration shows the intersection of two polygonal cylinders. The built-in Mathematica function RegionFunction is used to make cutouts and show that the cylinders make possible pipe connections.

If the inequalities used in the RegionFunction are inverted, we get a instance of what is known as a Steinmetz solid, formed by the intersection of two solid cylinders.

The and functions define the composite curve of the -gonal cross section of the polygonal cylinder [1]:

,

.

The parametric equation of a polygonal cylinder with sides and radius rotated by an angle around its axis is:

with parameters and .

Reference

[1] E. Chicurel-Uziel, "Single Equation without Inequalities to Represent a Composite Curve," Computer Aided Geometric Design, 21(1), 2004 pp. 23–42. doi:10.1016/j.cagd.2003.07.011.