KittyCAD / modeling-app

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

Show offsetPlanes as selectable planes in the scene #4468

Open franknoirot opened 4 days ago

franknoirot commented 4 days ago

If the user has created a plane using either the offsetPlane or other plane-creating function in KCL (or via the UI after #2213 is complete), we should show them as a real plane in the scene that can be selected and therefore sketched on. Once #4274 is complete, these planes' visibility should also be able to be toggled within the feature tree's UI.

The following KCL code should result in a circle on the XY plane with a plane shown 10 units above it:

sketch001 = startSketchOn('XY')
  |> circle({ center: [-0.08, -0.08], radius: 5.37 }, %)

plane001 = offsetPlane("XY", 10)Ï

Engine notes

None. This would be a similar flow to the one used by the default planes, so should require nothing special to implement.

API/KCL notes

  1. Might need to add something to the API layer to create a visible plane that represents the plane, and return its UUID to the frontend?

    Point-and-click notes

  2. Might need some logic on the frontend controlling what visibility to give a plane by default: if an offset plane has a sketch on it, maybe it should be hidden by default.
  3. I'm not sure if the "autoscaling" behavior shown by the default planes would apply to these offset planes as well.
franknoirot commented 3 days ago

Game plan here is: