Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Represent a 3D frame with rounded edges
ResourceFunction["RoundedFrame3D"][{dx,dy,dz}] represents a 3D frame with dimensions {dx,dy,dz}. | |
ResourceFunction["RoundedFrame3D"][{dx,dy,dz},{tx,ty}] sets the thickness of the frame in x- and y-directions. |
RoundingRadius | Automatic | radii of rounded edges |
"JoinForm" | "Bevel" | form of frame joins |
Method | "GraphicsComplex" | internal representation setting |
rr | same radius for interior and exterior edges |
{inrr, outrr} | separate radii for the interior and exterior edges |
None | rounding radii set to zero |
Automatic | rounding radii set to 0.1 |
r | all radii set to r |
{rx,ry} | equivalent to {rx,ry,0.1} |
{rx,ry,rz} | set rounding radius for each direction separately |
jf | same form for interior and exterior edges |
{injf, outjf} | separate specification for the interior and exterior edges |
"Bevel" | blunt joins and corners |
"Miter" | sharp joins and corners |
"Round" | round joins |
Automatic | equivalent to "Bevel" |
"GraphicsComplex" | represent the frame as a GraphicsComplex |
"List" | represent the frame as a List of individual graphics primitives |
A unit rounded frame:
In[1]:= |
Out[1]= |
Rounded frames with different sizes:
In[2]:= |
Out[2]= |
Differently styled rounded frames:
In[3]:= |
Out[3]= |
Rotated rounded frame:
In[4]:= |
Out[4]= |
Simple frame:
In[5]:= |
Out[5]= |
Rounded edges:
In[6]:= |
Out[6]= |
Different join forms:
In[7]:= |
Out[7]= |
A rounded frame parallel to each axis:
In[8]:= |
Out[8]= |
Modify thickness in the x-direction:
In[9]:= |
Out[9]= |
Modify thickness in the y-direction:
In[10]:= |
Out[10]= |
The frame is centered at the origin:
In[11]:= |
Out[11]= |
Use Translate to move the frame away from the center:
In[12]:= |
Out[12]= |
Use Rotate to rotate the frame:
In[13]:= |
Out[13]= |
Color directives specify the face colors of frames:
In[14]:= |
Out[14]= |
Different properties can be specified for the front and back of faces using FaceForm:
In[15]:= |
Out[15]= |
Opacity specifies the face opacity:
In[16]:= |
Out[16]= |
Suppress display of the bounding box:
In[17]:= |
Out[17]= |
Decompose the frame into its components and apply different styling to each:
In[18]:= |
Out[19]= |
Apply textures:
In[20]:= |
Out[21]= |
Different rounding radii:
In[22]:= |
Out[22]= |
Different radius for the interior and exterior edges:
In[23]:= |
Out[23]= |
Only interior edges rounded:
In[24]:= |
Out[24]= |
Rounded radius only in some directions:
In[25]:= |
Out[25]= |
Specify radii for each direction for both interior and exterior edges separately:
In[26]:= |
Out[26]= |
Choose the join form of the corners:
In[27]:= |
Out[27]= |
Interior and exterior edges can have different join form:
In[28]:= |
Out[28]= |
The internal structure of the frame differs for each "JoinForm":
In[29]:= |
Out[30]= |
By default, the frame is returned as a single instance of GraphicsComplex:
In[31]:= |
Out[32]= |
In[33]:= |
Out[33]= |
To get access to individual parts of the frame, set Method to "List":
In[34]:= |
Out[35]= |
This way, each part can be styled differently:
In[36]:= |
Out[36]= |
Cube with a hole:
In[37]:= |
Out[37]= |
Door frame:
In[38]:= |
Out[38]= |
Window bars:
In[39]:= |
Out[39]= |
Simple model of a house with a chimney:
In[40]:= |
Out[41]= |
Picture frame:
In[42]:= |
Out[42]= |
RoundedFrame3D can mimic Torus:
In[43]:= |
Out[43]= |
RoundedFrame3D can mimic RoundedAnnulus3D:
In[44]:= |
Out[44]= |
RoundedFrame3D can mimic RoundedCylinder:
In[45]:= |
Out[45]= |
RoundedFrame3D can mimic RoundedCuboid:
In[46]:= |
Out[46]= |
RoundedFrame3D can mimic Tube with a rectangular layout:
In[47]:= |
Out[47]= |
When dimensions, thicknesses and rounding radii are inconsistent, no frame is produced and an error message is printed:
In[48]:= |
Out[48]= |
Here, the x-axis thickness exceeds half the x-axis dimension. Adjust the thickness:
In[49]:= |
Out[49]= |
The chosen "JoinForm" value affects the constraints:
In[50]:= |
Out[50]= |
The flat-face surface has a different structure when "JoinForm" is set to {"Round","Round"}:
In[51]:= |
Out[51]= |
This allows for narrow corners:
In[52]:= |
Out[52]= |
Interlaced frames:
In[53]:= |
Out[54]= |
Interactively adjust the rounding radii:
In[55]:= |
Out[55]= |
This work is licensed under a Creative Commons Attribution 4.0 International License