Function Repository Resource:

# RoundedLine

Represent a polyline with rounded corners

Contributed by: Jan Mangaldan
 ResourceFunction["RoundedLine"][{p1,…,pn},r] represents a rounded polyline with points pi and rounding radius r. ResourceFunction["RoundedLine"][{{p11,p12,…},{p21,…},…},r] represents a collection of rounded polylines.

## Details

ResourceFunction["RoundedLine"] returns a Line object, and can be used as a graphics primitive.
ResourceFunction["RoundedLine"][Line[{p1,p2,}],r] gives a rounded version of Line[{p1,p2,}].
The rounding radius must be nonnegative.
ResourceFunction["RoundedLine"] works with 2D and 3D lines.

## Examples

### Basic Examples (1)

A rounded polyline:

 In[1]:=
 Out[1]=
 In[2]:=
 Out[2]=

### Scope (2)

Apply styling to a rounded polyline:

 In[3]:=
 Out[3]=

Multiple disconnected rounded polylines:

 In[4]:=
 Out[4]=

### Applications (2)

Use RoundedLine with Arrow:

 In[5]:=
 Out[5]=

Use RoundedLine with Tube:

 In[6]:=
 Out[6]=

### Properties and Relations (1)

RoundedLine returns a Line object:

 In[7]:=
 Out[7]=

### Possible Issues (3)

If there are less than two points, a plain line is returned:

 In[8]:=
 Out[8]=

No rounding is done for 180° angles:

 In[9]:=
 Out[9]=

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

 In[10]:=
 Out[10]=

Use a smaller rounding radius:

 In[11]:=
 Out[11]=

### Neat Examples (2)

A rounded dragon curve:

 In[12]:=
 Out[12]=

A rounded Hilbert curve:

 In[13]:=
 Out[13]=

## Version History

• 1.0.0 – 22 March 2021