Details and Options
ResourceFunction["CylindricalFlange3D"] can be used in
Graphics3D.
ResourceFunction["CylindricalFlange3D"] in general returns a (possibly large and nested) list of graphics primitives such as
Cylinder or
BSplineSurface that together constitute a flange.
ResourceFunction["CylindricalFlange3D"] is intended as a convenience function that allows for easy creation of composed cylinder-like graphics objects with textual labels. Its purpose is purely visual, no computation with the output (such as
RegionMeasure) is supported.
The first argument specifies the shape and size of the main graphics object, the other arguments specify the front and back protrusions and the protrusions along the circumference, respectively.
The first argument, type, can take any of the following forms:
Automatic | default shape is set to "Cylinder" |
shapename | string specifying the shape, see below |
{shapename,length} | specify the length of the body (default is 0.4) |
{shapename,length,rad} | specify the (outer) radius (default is 1) |
{shapename,length,rad,pars} | specify additional parameters such as rounding radii (if any exist) |
Parameter shapename can take on the following forms:
"Annulus3D" | object given by ResourceFunction["Annulus3D"] |
"Cylinder" | object given by Cylinder |
"Empty" | no object created |
"RoundedAnnulus3D" | object given by ResourceFunction["RoundedAnnulus3D"] |
"RoundedCylinder" | object given by ResourceFunction["RoundedCylinder"] |
fun[len,rad,pars] | object generated by a pure function |
For named shapes, the input parameters are checked for whether they lie in the allowed range. When a pure function is supplied instead, no parameter preprocessing is performed.
The second, third, and fourth arguments can be of the following forms:
num | integer number num of evenly distributed protrusions on a given face |
posspec | list of protrusions' positions specified in the plane of the face (for front and back face) or along the surface of the circumference |
{posspec,shapespec} | specify both the positions as well as the shape of the protrusions, see below |
The position specification posspec for protrusions can have the following forms:
num | non-negative number of protrusions, evenly distributed on the face |
{{rad1,th1},{rad2,th2},…} | list of polar coordinates for individual protrusions |
{{rad1,th1,em1},{rad2,th2,em2},…} | together with the position also specify for each protrusion how much it should protrude from the surface |
The meaning of the polar coordinates is slightly different for front and back faces on the one hand, and for the circumference on the other hand. For the former, the first coordinate denotes a relative radial position of the protrusion on the face, while for the latter, the first coordinate specifies the relative position with respect to the center plane cutting through the main body. The meaning of the second and third coordinates is the same for all three faces. Namely, the second coordinate defines the angular position along the face and the third coordinate characterizes how much the protrusion sinks into the surface or protrudes from it.
The shape specification shapespec for protrusions follows exactly the shape specification for the main body. The allowed shapes are, however, slightly different:
The following full specifications for each shape are allowed:
{"Cylinder",len,rad} | cylinder of length len and radius rad |
{"Empty",len,rad} | empty cylinder-like object of given length and radius |
{"Annulus3D",len,rad,inrad} | 3D annulus with inner radius inrad |
{"Cuboid",z,hx,hy} | cuboid with length z, half-width hx, and half-depth hy |
{"RoundedCylinder",len,rad,rrad} | rounded cylinder with rounding radius rrad |
{"RoundedAnnulus3D",len,rad,inrad,rrad} | rounded 3D annulus with inner radius inrad and rounding radius rrad |
{"RoundedCuboid",z,hx,hy,rrad} | rounded cuboid with rounding radius rrad |
When only a partial shape specification is given, default values are used instead. The default value for len is 0.4 for the main body and 0.2 for protrusions; for rad it is 1 for body and 0.1 for protrusions. Additional parameters are dynamically calculated from the values of these two parameters (if not supplied explicitly). The inner radius inrad and rounding radius rrad are set to 0.5rad and 0.01rad, respectively. For "Cuboid" and "RoundedCuboid" z is set to len, while hx and hy are set to rad.
The following options can be given:
"Label" | None | textual label on the main object |
PlotPoints | 20 | resolution of the cylindrical mesh underlying the label |
RasterSize | 200 | raster size of each label |
"RotateProtrusions" | Automatic | whether to rotate the front and back protrusions |
Textual labels specified by "Label" are represented as rasterized images wrapped in
Texture that spans a mesh created by
RevolutionPlot3D.
The "Label" setting can have the following forms:
None | Automatic | no label |
"SomeText…" | text of the label |
Style[stylespec] | text wrapped in Style |
{textspec,scale} | specify also a scale (default scale is 1) |
{textspec,scale,orientation} | specify orientation (can be any real number, default is 0) |
The "RotateProtrusions" setting can have the following forms:
True|False | specify whether the protrusions are rotated for both the front and the back face |
Automatic | equivalent to False for types "Cylinder", "RoundedCylinder", "Annulus3D", and "RoundedAnnulus3D", and to True otherwise (default) |
{frspec,bkspec} | specify individually for front and back face |