Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Represent a polygon with rounded corners
ResourceFunction["RoundedPolygon"][{p1,…,pn},r] represents a filled rounded polygon with points pi and rounding radius r. | |
ResourceFunction["RoundedPolygon"][{p1,…,pn},{r1,…,rn}] represents a filled rounded polygon with points pi and corresponding rounding radii ri. |
A triangle with rounded corners:
In[1]:= |
|
Out[1]= |
|
A rounded rectangle with different rounding radii for each corner:
In[2]:= |
|
Out[2]= |
|
Coordinates for a star-shaped polygon:
In[3]:= |
|
Show the original polygon and the rounded version:
In[4]:= |
|
Out[4]= |
|
Use different rounding radii for each vertex:
In[5]:= |
|
Out[5]= |
|
A rounded 3D polygon:
In[6]:= |
|
Out[6]= |
|
Plot a function over a rounded polygon domain:
In[7]:= |
|
Out[7]= |
|
A polyhedron with rounded faces:
In[8]:= |
|
In[9]:= |
|
Out[9]= |
|
RoundedPolygon returns a Polygon object:
In[10]:= |
|
Out[10]= |
|
Applying RoundedPolygon to a Rectangle is equivalent to setting its RoundingRadius:
In[11]:= |
|
Out[11]= |
|
If the rounding radius is too large, RoundedPolygon may give unexpected results:
In[12]:= |
|
Out[12]= |
|
Use a smaller rounding radius:
In[13]:= |
|
Out[13]= |
|
Rounded Voronoi cells:
In[14]:= |
|
Out[14]= |
|
Use RoundedPolygon with the resource function PerforatePolygons on a truncated icosahedron:
In[15]:= |
|
In[16]:= |
|
Out[16]= |
|
Use RoundedPolygon with the resource function OutlinePolygons on a truncated icosahedron:
In[17]:= |
|
Out[17]= |
|
This work is licensed under a Creative Commons Attribution 4.0 International License