Using polygon() to model tool outlines and profiles

7 views
Skip to first unread message

William Adams

unread,
Aug 27, 2025, 7:31:50 AMAug 27
to PythonSCAD
I was able to use the nifty radius feature in the polygon() command:

        self.toolprofile = polygon([[0,0], [diameter/2, 0, radius], [diameter/2, radius], [diameter/2, flute], [0, flute]])

to make a bowl outline/3D toolshape:


Screenshot 2025-08-27 072428.png

but the next shape I need to model is a cove/roundover tool such as:


Screenshot 2025-08-27 072757.png

and my initial attempt to use a negative value for radius did not work.

Looking at this, I can see two options:

 - round off the corners and calculate one or more points on the inner curve and use a spline
 - draw an angled outline using polygon(), then subtract an appropriately placed 2D circle

and leaning toward the latter --- does that seem reasonable?

Alternately, could there be a way in the spline command to indicate sharp corners and the direction one enters/exits them? (see the METAFONT/POST curve options for one example)

William


Guenther Sohler

unread,
Aug 27, 2025, 9:02:35 AMAug 27
to William Adams, PythonSCAD

Maybe you can try this code to see the arcs inwards

from openscad import *

radius=2
diameter=6
flute=9
fn=20

p = polygon([[0,0], [0.5,0],[0.5,1],[0.5,0.5+radius, radius],[diameter/2,1+radius], [diameter/2, flute], [0, flute]])
tool=p.linear_extrude(height=2)
tool |= tool.mirror([1,0,0])
tool |= cylinder(r=2.5,h=4).rotx(-90).back(6)
tool = union(tool, cylinder(r=1,h=4).rotx(-90).back(9),r=1,fn=20)

tool.show()

please do F6 render to see the fillets correctly


{F2840EDB-2A2D-4E0A-8DB4-D08A7CFA1BCB}.png


--
You received this message because you are subscribed to the Google Groups "PythonSCAD" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pythonscad+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/pythonscad/66f11b19-89d0-4053-a037-cd7ccb9a3e1bn%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

William Adams

unread,
Aug 28, 2025, 7:01:37 AMAug 28
to PythonSCAD
Clever!

Given the need for the additional operations, I think drawing a circle and removing it will be the same number of lines, but clearer to visualize (until such time as an inverse rounding/cove corner feature is added to polygon() or we get a Bézier curve function which will allow drawing this sort of thing).

Thanks for making this clear!

William
Reply all
Reply to author
Forward
0 new messages