KittyCAD / modeling-app

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

Segment length indicators get unweildy at scale #3076

Closed Irev-Dev closed 1 month ago

Irev-Dev commented 2 months ago

take a script that has large values

const sketch002 = startSketchOn('XZ')
  |> startProfileAt([977.86, 1889.8], %)
  |> line([2505.09, 461.46], %)
  |> line([-122.94, -2915.18], %)
  |> line([-1871.89, -1464.62], %)
  |> line([-524.76, 1174.83], %)
  |> lineTo([profileStartX(%), profileStartY(%)], %)
  |> close(%)

Go into sketch mode

numbers don't match with the segments very well.

image

Video is better

https://github.com/user-attachments/assets/3502d645-8dea-41cf-803f-76d86ae68854

Irev-Dev commented 2 months ago

I'll CC but won't assign @franknoirot

franknoirot commented 2 months ago

Woah gnarly!

Irev-Dev commented 1 month ago

Thinking this might be a good one for @nadr0.

Here's the PR where these were initially added https://github.com/KittyCAD/modeling-app/pull/2935/files

@franknoirot if you have any more context or theories of what might be happening feel free to chip in.

franknoirot commented 1 month ago

Yes, I feel somewhat confident that it is because this code where we calculate the text and position of these length labels do not take scale or the current zoom level properly into account.