ImplicitCAD icon indicating copy to clipboard operation
ImplicitCAD copied to clipboard

Radians vs degrees for SCAD trigonometric functions

Open sorki opened this issue 3 years ago • 1 comments

Currently, our trig. functions work with radians but the reference implementation uses degrees. This can cause surprises as the SCAD file is interpreted incorrectly.

We can

  • Introduce a breaking change and switch SCAD engine to work with degrees (rotation function already uses deg)
  • Hide this behind a compatibility flag (problematic because we don't know when to enable OpenSCAD compat mode which is disabled by default)
  • Introduce something like language pragma, that would allow setting this per-project but seems tricky in presence of use/imports (per-file).

Related to this, @julialongtin proposed exposing ImplicitCAD (or Implicits SCAD engine) version as SCAD variable which could potentially be used to guard breaking changes.

sorki avatar Apr 23 '22 16:04 sorki

Gets even more confusing because e.g. rotate already uses degrees.

sorki avatar May 05 '22 14:05 sorki