jscad / OpenJSCAD.org

JSCAD is an open source set of modular, browser and command line tools for creating parametric 2D and 3D designs with JavaScript code. It provides a quick, precise and reproducible method for generating 3D models, and is especially useful for 3D printing applications.
https://openjscad.xyz/
MIT License
2.58k stars 505 forks source link

extrudeRotate behavior is unintuitive #1277

Open z3dev opened 10 months ago

z3dev commented 10 months ago

Discussed in https://github.com/jscad/OpenJSCAD.org/discussions/1229

Originally posted by achirita April 11, 2023

I recently had to use the extrudeRotate function and noticed that it's behavior is not that intuitive. I thought I would be able to specify the axis around which the 2D geometry is being rotated in order to obtain the 3D geometry, but noticed that's not the case. What's even stranger is that if I have a 2D geometry in the XY plane and I use extrudeRotate on it, it gets rotated around the Z axis, which make little sense to me. It's like the geometry is first rotated around the X axis 90 degrees and then the extrudeRotate operation is performed. Any thought on this one?

z3dev commented 10 months ago

As mentioned, enhancing extrudeRotate() to use any axis X/Y/Z would be a nice enhancement. The default would be extruding 2D geometry from X/Y plane about X-axis, supporting 2D geometry with positive points.

NOTE: This is a breaking change.

z3dev commented 10 months ago

@achirita Are you interested in rewriting extrudeRotate() to support X/Y/Z axis rotations? Of course this would go into V3, which is moving along nicely now.