Straight Skeleton 2d Extrude (Alpha)¶
!!! “Exclude height” parameter was renamed into “Restrict Height” !!! Images will be update later…
It is Alpha version of node. Any function and names can be changed without notification! (but it will most likely be reported in the documentation).
Now tested with Windows 10, Windows 11, Ubuntu 22.04 (minimal libstdc++ version 12.3 ). It is not work with iOS (Apple) and we has no plan for a while. If you get issue please write https://github.com/nortikin/sverchok/issues
Functionality¶
This node is a python wrapper of function “Skeleton Extrude 2d” of CGAL https://doc.cgal.org/latest/Straight_skeleton_2/index.html.
This package implements weighted straight skeletons for two-dimensional polygons with holes. An intuitive way to think of the construction of straight skeletons is to imagine that wavefronts (or grassfires) are spawned at each edge of the polygon, and are moving inward. As the fronts progress, they either contract or expand depending on the angles formed between polygon edges, and sometimes disappear. Under this transformation, polygon vertices move along the angular bisector of the lines subtending the edges, tracing a tree-like structure, the straight skeleton.
Install dependency¶
To use node install additional library pySVCGAL in the Extra Nodes Section:
Inputs¶
Taper Angle - Angle between plane and Face that this algorithm will build. Valid range is 0 < Taper Angle <180 Degrees; 0 and 180 are invelid angles. Also 90 degrees is invalid param if “Restrict Height” is off.
If you do not connect any lists of floats values then this value will be used for every objects connected into this node:
If you connect list of floats then it will be used per objects:
Shapes mode. Original, Exckude Holes, Invert Holes
Restrict Height.
Height - Height of object or objects. If used single value then this value vill be used for every objects. If socket is connected with float values then values will be used per objects:
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¶
- Results Join mode. Split, Keep, Merge.
Split - If some of objects has several independent meshes then they will be splitten individually and you can get more object on output than on input. (Mask will hide all meshes in multimesh objects)
Keep - If some of objects has several independent meshes then they will be as one object on output.
Merge - This node will merge all vertices, edjes, and faces into a single object.
Restrict Height - If you want to see objects without height limits just turn it off. All objects will be recalulated without heights limits (in the input field or socket).
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 - On will show more info in console while Extrude Straight Sceleton. Off will show less info.
Output sockets¶
Performance¶
If you have a low poly model then no problem - you can work with that model 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):
Examples¶
Hexagon with Straight Skeleton¶
Palm Tree¶
Src: https://www.143vinyl.com/free-svg-download-palm-trees.html
Src: https://www.templatesarea.com/celtic-tree-of-life-silhouettes-free-vector-graphics/
Creating Abstract Shape from 2D Bezier Circle¶
This shape with autosmooth:
DEVELOPMENT¶
If you have skills for work with CGAL see: https://github.com/satabol/SVCGAL