Straight Skeleton 2d Offset (Alpha)¶
Functionality¶
This node is a python wrapper of function “Skeleton Offset 2d” of CGAL https://doc.cgal.org/latest/Straight_skeleton_2/index.html.
This package implements straight skeletons offset for two-dimensional polygons with holes.
Simple example:
More complex example:
Additionally you can perform the offset connection of profiles to get a dimensional shape:
Install dependency¶
To use node install additional library pySVCGAL in the Extra Nodes Section:
Inputs¶
Shapes mode. Original, Exclude Holes, Invert Holes.
Offsets, Altitudes.
If you do not connect any lists of floats values then this value will be used for every objects connected into this node:
Profile faces indexes. Only used in Bevel mode. List of indexes to connect offsets. If you use some mesh objects you can use profile faces to connect these offset as in profile shape:
Profile close mode. Only used in Bevel mode. This option affects the way the profile points are connected.
Close - Profile forms closed shape. The first and last points are connected. The shape is closed from all sides.
Open - Profile forms opened shape. The first and last points do not connect
Pair - List items are joined in pairs. If an index is out of offset index range, the pair is completely ignored. Ex.: [1,2,3,4,5,6,7,8,9,0] will be [1,2],[3,4],[5,6],[7,8],[9,0] and you get the bands
Mask of objects - Mask hide objects. If element of boolean mask is True then object are hidden. If length of mask is more than length of objects then exceeded values will be omitted.
Parameters¶
Result Type. Contours, Faces, Bevel, Skeleton.
Results Join Mode. Split, Keep, Merge.
Force z=0.0 - To force use meshes as planes. Useful for ex. bezier 2D curve some time take Z not zero.
Only Tests - If you have a hi poly mesh like imported SVG file one can save time and do not Skeletonize all meshes before fix all. You can connect viewer draw into the “Wrong Contours Verts” with red color or any color you prefer for errors to see any wrong contrours. Red dots are wrong contours.
Verbose - Enabled - Show process messages in console while process meshes. Disabled - Hide any process messages.
Use cache - Store Straight Skeleton 2D calculations in cache. If you pass the geometry for calculation a Straight Skeleton a second time, the result will be taken from the cache. This is a new feature so this is disabled by default. If the setting is disabled, the cache is not used.
Detailed split - Work only in Bevel mode. Additional separation of the object by profile faces in split mode.
Output sockets¶
Vertices, Edges, Faces - Results meshes.
Wrong Contour Verts - If source meshes can’t be processed then this socket will output vertices of that contours (ex. if meshes contours is self intersection)
Performance¶
If you have a low poly model then no problem - you can work with it in real time:
If you try high poly like Besier 2D with many points and hi resolution (1) then better is to turn off (2) update sverchok nodes while editing objects and run process manually (3):
Also you can use cache mode (it is experimental property for a while!!!):
Examples¶
Boundary background contour:
Inner Offset
Extrude with profile faces:
DEVELOPMENT¶
If you have skills for work with CGAL see: https://github.com/satabol/SVCGAL