KittyCAD / modeling-app

The KittyCAD modeling app.
https://kittycad.io/modeling-app/download
MIT License
367 stars 30 forks source link

[BUG]: Helix fails when in "in" units but works in "m" units #3856

Open r-barton opened 2 weeks ago

r-barton commented 2 weeks ago

Describe the bug

Changing the unit system causes a helix to fail or pass. The other strange thing I noticed happening is when starting the sketch on the 'XY' plane instead of the custom plane, the helix works in in

Steps to Reproduce

See below for KCL to use. This KCL fails when in in but correctly works in m

// define a plane plane013
const plane013 = {
  plane: {
    origin: [0.000000, 3.000000, 0.000000],
    xAxis: [1.000000, 0.000000, 0.000000],
    yAxis: [-0.000000, 0.000000, 1.000000],
    zAxis: [-0.000000, 1.000000, -0.000000]
  }
}

// create a sketch sketch002
const sketch002 = startSketchOn(plane013)

// create sketch profile sketch002Profile000
const sketch002Profile000 = circle([0.000000, 0.000000], 0.125000, sketch002, $arc001)

// create a helix helix001
const helix001 = extrude(-0.42500000000000004, sketch002Profile000)
  |> helix({
       angleStart: 0.0,
       ccw: false,
       revolutions: 8.5
     }, %)

Expected Behavior

This code should work regardless of the unit set or custom plane used.

Screenshots and Recordings

No response

Desktop OS

Windows

Browser

Chrome

Version

v0.25.1

Additional Context

No response

jessfraz commented 2 weeks ago

cc @gserena01 who might have ideas on the engine side I cant think of anything we might be doing in kcl

jessfraz commented 2 weeks ago

do we need to call "EnableSketchMode" before doing a helix? maybe that is it?

gserena01 commented 2 weeks ago

We don't need to be in sketch mode to add a helix... something else must be happening here. I'll investigate