OpenSCAD Parametric Star example
Profiles & patterns
Lesson 13 of 22
Generate polygon vertices with a list comprehension and twist the extrusion.
Try changing:
pointsouter_radiusinner_radiusheighttwistMedium compile complexity. Triangles scale with star points and extrusion slices.
How this model works
Alternating inner and outer radii creates twice as many vertices as star points. OpenSCAD trigonometry uses degrees. slices controls interpolation along the extrusion, while the polygon's point count controls its outline; $fn does not smooth polygon corners. Use a small twist while inspecting before increasing final slices.
main.scad
Loading draft
Ready
Z up · geometry preview
Your geometry will appear here
Preview or render the model to inspect it in 3D.
Geometry-only STL preview
Grid 10 units · Drag: orbit · Right-drag / two fingers: pan · Scroll / pinch: zoom
0 messages
Make it your own
Make a five-point star with no twist, then compare it with a 90-degree twist. Keep inner_radius smaller than outer_radius so the star does not invert.
Change one parameter at a time and inspect the result. Use the workspace reset action to return to this lesson’s original model.