Function Repository Resource:

# RoundedPolygon

Represent a polygon with rounded corners

Contributed by: Jan Mangaldan
 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.

## Details

ResourceFunction["RoundedPolygon"] returns a Polygon object, and can be used as a graphics primitive.
ResourceFunction["RoundedPolygon"][poly,rspec], where poly is a Polygon, Rectangle or Triangle object, gives a rounded version of poly.
The rounding radii ri must be nonnegative numbers.
ResourceFunction["RoundedPolygon"] works with 2D and 3D polygons.

## Examples

### Basic Examples (2)

A triangle with rounded corners:

 In[1]:=
 Out[1]=

A rounded rectangle with different rounding radii for each corner:

 In[2]:=
 Out[2]=

### Scope (4)

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]=

### Applications (2)

Plot a function over a rounded polygon domain:

 In[7]:=
 Out[7]=

A polyhedron with rounded faces:

 In[8]:=
 In[9]:=
 Out[9]=

### Properties and Relations (2)

RoundedPolygon returns a Polygon object:

 In[10]:=
 Out[10]=

Applying RoundedPolygon to a Rectangle is equivalent to setting its RoundingRadius:

 In[11]:=
 Out[11]=

### Possible Issues (2)

If the rounding radius is too large, RoundedPolygon may give unexpected results:

 In[12]:=
 Out[12]=

 In[13]:=
 Out[13]=

### Neat Examples (2)

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]=

## Version History

• 1.0.1 – 16 March 2021
• 1.0.0 – 08 February 2021

## Author Notes

Polygons with holes are currently not supported.