Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Turn polylines into woven bands
ResourceFunction["BandWeaver"][polylines,halfwidth] returns polygon bands of twice a given halfwidth for an over/under weaving of self-intersecting polylines. |
Turn a polyline into woven bands:
| In[1]:= |
| Out[2]= | ![]() |
Look at the polyline and the generated polygon bands:
| In[3]:= |
| Out[3]= | ![]() |
Look at the full woven band:
| In[4]:= |
| Out[4]= | ![]() |
Show knight moves:
| In[5]:= | ![]() |
| Out[5]= | ![]() |
Results of BandWeaver can be combined with other graphics:
| In[6]:= | ![]() |
| Out[8]= | ![]() |
BandWeaver works for multiple polylines:
| In[9]:= | ![]() |
| Out[11]= | ![]() |
Code for a bouncing ball:
| In[12]:= | ![]() |
| Out[13]= |
Let's make a Celtic weave out of it:
| In[14]:= |
| Out[14]= | ![]() |
Let's try weaving some weaving:
| In[15]:= | ![]() |
| Out[17]= | ![]() |
Whoops, got the wrong offset. Let's change a digit to shove that over:
| In[18]:= | ![]() |
| Out[19]= | ![]() |
Show a knight's tour:
| In[20]:= | ![]() |
| Out[21]= | ![]() |
The possible band thickness is limited, most of the time:
| In[22]:= | ![]() |
| Out[22]= | ![]() |
If the band is too wide, the code will fail in various ways:
| In[23]:= |
| Out[23]= |
Without self-intersection, the ResourceFunction PerforatePolygons is needed instead:
| In[24]:= |
| Out[24]= | ![]() |
A single self-intersection is enough:
| In[25]:= |
| Out[25]= | ![]() |
Code for making star polylines:
| In[26]:= | ![]() |
Weave together two 9-pointed stars:
| In[27]:= | ![]() |
| Out[28]= | ![]() |
Still using the star code, make woven bands out of many stars:
| In[29]:= | ![]() |
| Out[30]= | ![]() |
More elaborate star-like weavings:
| In[31]:= | ![]() |
| Out[32]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License