KittyCAD / modeling-app

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

[BUG]: Sketch on face modifies comment positions and doesn't allow me to sketch #2207

Open r-barton opened 5 months ago

r-barton commented 5 months ago

Describe the bug

I'm attempting to sketch on the face of a part so that I could design a bracket around it. The part I'm drawing on is defined by another function. When I begin to sketch on the face of the part, comments shift around and I'm not actually able to sketch. A new line of code is also inserted in the middle of the code and not at the bottom like I would expect.

main.zip

Steps to Reproduce

  1. Click on "Start Sketch" in the top command palette
  2. Click on the face of the part (see attached screen recording)

Expected Behavior

I expect to be able to sketch on the planar face of a part and not have comments be modified in the code editor. I would also expect the corresponding code to sketch be placed at the bottom of the file.

Screenshots and Recordings

https://github.com/KittyCAD/modeling-app/assets/3958831/95529562-4667-4046-9bd9-59b115df89cb

Desktop OS

Ubuntu 22.04 LTS

Browser

Chrome

Version

v0.18.1

Additional Context

No response

franknoirot commented 4 months ago

Very much related to what I've been investigating in the branch franknoirot/separate-extrude-const. Sketch-on-face currently makes some assumptions about where it is safe to put the new code, which need augmented by giving it a fuller picture of the dependencies that an face relies on, so it can now the earlier safe point to insert new code.

Irev-Dev commented 3 months ago

This might be a good one for Jon!

nadr0 commented 4 days ago

I made a dupe of this https://github.com/KittyCAD/modeling-app/issues/3771. Did not realize this was already created. I found this bug when debugging https://github.com/KittyCAD/modeling-app/issues/3492.