Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Create a chain of Bézier curves that smoothly connects a list of points
ResourceFunction["BezierChain"][{p1,p2,…}] links the points pi with Bézier curves that smoothly flow into each other. |
| "Swing" | 1/3 | controls the width of curves at the corners; must be greater than 0 and less than or equal to 1 |
| "CurveType" | "Listed" | the type of curve: "Listed", "Joined" or "Filled" |
Make a curve that flows through points in 2D:
| In[1]:= |
|
| Out[2]= |
|
In contrast, an ordinary Bézier curve will not go through all the control points:
| In[3]:= |
|
| Out[3]= |
|
Make a curve that flows through points in 3D:
| In[4]:= |
|
| Out[5]= |
|
The "CurveType" option changes the type of 2D curve returned:
| In[6]:= |
|
| Out[10]= |
|
The "Swing" option, which has an effective range of 0<n≤1, controls how curvy the connection is between Bézier sections:
| In[11]:= |
|
| Out[12]= |
|
A swing value of 0 is equivalent to using Line:
| In[13]:= |
|
| Out[14]= |
|
Dynamically adjust the swing value:
| In[15]:= |
|
| Out[16]= |
|
If the first and last points coincide (to make it a closed curve), they will not be smoothly connected, but instead will show a cusp:
| In[17]:= |
|
| Out[18]= |
|
Trace a path in 2D or 3D space:
| In[19]:= |
|
| Out[19]= |
|
Make the points dynamic, as in this Manipulate:
| In[20]:= |
|
| Out[20]= |
|
Simulate handwriting:
| In[21]:= |
|
| Out[22]= |
|
Braid tubes:
| In[23]:= |
|
| Out[25]= |
|
This work is licensed under a Creative Commons Attribution 4.0 International License