Haskell-Things / ImplicitCAD

A math-inspired CAD program in haskell. CSG, bevels, and shells; 2D & 3D geometry; 2D gcode generation...
https://implicitcad.org/
GNU Affero General Public License v3.0
1.39k stars 142 forks source link

RotateExtrude should use radians not degrees #288

Closed jackie-scholl closed 3 years ago

jackie-scholl commented 3 years ago

Most of ImplicitCAD uses Radians, but the RotateExtrude implementation uses degrees: https://github.com/colah/ImplicitCAD/blob/5ddd75006cc8f1d6a0e184f56c3714a9097ce6b0/Graphics/Implicit/ObjectUtil/GetImplicit3.hs#L170-L176

This is a breaking change, but I think we should change the API to use radians not degrees. Fwiw, I use RotateExtrude to implement a screw, and I calculate a number of rotations anyways and then have to convert to degrees for this function.

This was prompted by https://github.com/colah/ImplicitCAD/pull/287#issuecomment-727626798. Note that I'm mostly thinking about the Haskell eDSL side, I have no familiarity with ExtOpenScad.

julialongtin commented 3 years ago

The reason this uses degrees is that in the scad language, the call to this accepts degrees. in order to change this and maintain openscad compatibility, you would have to put a special case in place.

sorki commented 3 years ago

I've stumbled on this as well and think we should change the Haskell interface but keep the extopenscad one compatible not to break existing code/examples.