KittyCAD / modeling-app

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

Add Three-point arc tool #1659

Open franknoirot opened 8 months ago

franknoirot commented 8 months ago

Add a sketch tool that generates an arbitrary arc for the user.

User flow

  1. In sketch mode, click the Arc tool
    • After this issue is complete, the Three-point arc should be the default Arc tool, with tangential arc in a dropdown per #1645
  2. Click anywhere on the sketch plane to lay your first point
  3. Move the mouse around to find the place for the second point
    • During this, a sensible radius is set for the user, the center of the circle implied by the arc is shown as a draft dot, and a draft arc spans between the first point and the mouse's location
  4. Move the mouse around to find the place for the final point
    • During this, we draw a draft arc that passes through the two previous points and the mouse's location (along with another dot representing the center of this implied circle), updating as the mouse moves.

Code generation

We don't have a stdlib function in kcl that takes three points and constructs an arc that passes through them, which is fine because users don't actually want the relationship to be defined by 3 cartesian points in almost all cases. They want an arc with a starting point, a radius, and sweep angle. Unfortunately, I don't think we have a variation of the arc() function that takes these parameters. Maybe someone else knows how we can use the user flow described above to derive one of the arc functions we have available before I request a new function?

Additional resources

jessfraz commented 6 months ago

Being able to use the line tool like in figma to click and create an arc, would be a win

franknoirot commented 1 week ago

Related to https://github.com/KittyCAD/engine/issues/2756