Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Return two polylines a fixed distance from a polyline
ResourceFunction["PolygonOffsets"][polyline,distance] creates two polylines at distance from polyline. |
Create offsets to a triangle:
| In[1]:= |
| Out[2]= |
The "closed polyline" version has an identical result:
| In[3]:= |
| Out[4]= |
Show the original polyline and the generated polylines:
| In[5]:= | ![]() |
| Out[5]= | ![]() |
Show a more complicated offset:
| In[6]:= | ![]() |
| Out[8]= | ![]() |
Use a Polygon:
| In[9]:= |
| Out[10]= |
See the offset polygons:
| In[11]:= |
| Out[11]= | ![]() |
Create an op-art effect:
| In[12]:= |
| Out[13]= | ![]() |
If the offset is large, the results can become meaningless:
| In[14]:= | ![]() |
| Out[16]= | ![]() |
Round the corners using the resource function RoundedLine. Note that the beginning point on the bottom left is not rounded:
| In[17]:= | ![]() |
| Out[19]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License