linear and rotate_extrude for tools

12 views
Skip to first unread message

William Adams

unread,
Oct 19, 2025, 9:24:34 AMOct 19
to PythonSCAD
Finally making progress on this, but a nifty feature is that the 2D outline is automatically oriented to align with the motion, but a problem when representing tool movement is that the 2D outline is automatically oriented to align with the motion, as opposed to maintaining its vertical alignment with the spindle:

Screenshot 2025-10-19 092154.png

I'm not seeing a control for this --- I suppose I could limit the usage to just short line cutting which would be an improvement, but it would introduce a deviation from the currently ideal real-world representation which I really like --- is there a control for this? Or an option which could be added/implemented?

William

Guenther Sohler

unread,
Oct 19, 2025, 9:31:09 AMOct 19
to PythonSCAD
Could you detail on what you like to achieve ?

Guenther Sohler

unread,
Oct 19, 2025, 3:57:21 PMOct 19
to PythonSCAD
This looks like a helix.

square([10,41]).right(20).rotate_extrude(angle=90,v=[0,0,12])

This one looks very similar. just adapt the numbers

--
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/0bdd7e77-73e6-4b8c-9f78-b2f6e89e1059n%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

William Adams

unread,
Oct 19, 2025, 10:21:51 PMOct 19
to PythonSCAD
I need for the rectangles to be vertical:

Screenshot 2025-10-19 092154.png

The tool only moves straight up/down and in XY --- it doesn't cant as the helix does.

William

Guenther Sohler

unread,
Oct 20, 2025, 3:01:45 AMOct 20
to William Adams, PythonSCAD
Yes! Its so logical when thinking like a router'CNC machine 🤣

Right now,  the tilt is automatically created for a coil/thread to look natural.
I think its quite easy to add an parameter to overwrite that and have an arbitrary constant tilt angle.

In your 1st picture the tilt angle does NOT appear to be vertical  though
In all your cases: the rectangle appears to rotate in Z axis whereas the tilt appears to stay contant


BTW : you can imitate the whole behaviour using skin() and many x-sections. its more work, but still more effective than repetitive hulls.




You received this message because you are subscribed to a topic in the Google Groups "PythonSCAD" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pythonscad/J_dGBbLJBss/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pythonscad+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/pythonscad/a38b323e-f3ec-4fe4-9799-e8c81b115d31n%40googlegroups.com.

William Adams

unread,
Oct 27, 2025, 11:19:44 AM (10 days ago) Oct 27
to PythonSCAD
Do you have a link to the documentation for skin()?

Guenther Sohler

unread,
Oct 27, 2025, 11:29:36 AM (10 days ago) Oct 27
to William Adams, PythonSCAD
Its not magic. 
Pictures tell more than 1000 words. you can use any number of arguments to skin()




{802A1EB3-BE1B-4855-B292-8EFEDBA6D870}.png

William Adams

unread,
Nov 2, 2025, 8:25:10 AM (4 days ago) Nov 2
to PythonSCAD
Okay, if I understand correctly, this only works for straight-line moves --- but since it would handle arbitrary 2D tool shapes, if paired with an in-place rotate-extrude of the tool at each end, should allow simulating arbitrary tool movement for such. This would at least make roundover tooling more efficient.

Your example:

    from openscad import *
    
    x1 = square(4,center=True)
    x2 = circle(r=2,fn=20).roty(20).up(10)
    x3 = circle(5,fn=3).rotz(103).up(19).rotx(28)
    s=skin(x1,x2,x3)
    s.show()

Generating the above I get:

skin() {
  square(size = [4, 4], center = true);
  multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 10], [0, 0, 0, 1]]) {
    multmatrix([[0.939693, 0, 0.34202, 0], [0, 1, 0, 0], [-0.34202, 0, 0.939693, 0], [0, 0, 0, 1]]) {
      circle($fn = 20, $fa = 12, $fs = 2, r = 2);
    }
  }
  multmatrix([[1, 0, 0, 0], [0, 0.882948, -0.469472, 0], [0, 0.469472, 0.882948, 0], [0, 0, 0, 1]]) {
    multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 19], [0, 0, 0, 1]]) {
      multmatrix([[-0.224951, -0.97437, 0, 0], [0.97437, -0.224951, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
        circle($fn = 3, $fa = 12, $fs = 2, r = 5);
      }
    }
  }
}


and each begin/end move is expressed as four nested commands?


So apparently this is a wrapper for a CSG primitive?


William




Reply all
Reply to author
Forward
0 new messages