Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add circle from center tool #1501

Closed
Tracked by #1548
franknoirot opened this issue Feb 23, 2024 · 6 comments
Closed
Tracked by #1548

Add circle from center tool #1501

franknoirot opened this issue Feb 23, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request sketch

Comments

@franknoirot
Copy link
Collaborator

Add a sketch tool that generates a rectangle for the user.

User flow

  1. In sketch mode, click the Circle tool to equip it
  2. Click anywhere on the sketch plane to set your circle's center
  3. Move the mouse around to find an appropriate length for the radius
  4. During this, a circle made of a dashed line will appear centered on your first point with a radius to the mouse's position
  5. Click to finish the circle

Code generation

I don't think we should generate new functions for users automatically unless we are prepared to automatically reuse them intelligently on their behalf with later interactions. To avoid that complexity, here is my proposed code generation:

const sketch001 = startSketchOn('XY')

// Generated code: circle001
const circle001_center = [3, 3]
const circle001_radius = 7.1
const circle001 = startProfileAt([circle001_center[0] + circle001_radius, circle001_center[1]], sketch001)
  |> arc({
       angle_end: 360,
       angle_start: 0,
       radius: circle001_radius
     }, %)
  |> close(%)

Additional resources

@franknoirot franknoirot added enhancement New feature or request sketch labels Feb 23, 2024
@jessfraz
Copy link
Contributor

We have a circle function tho so we should use that.

@jessfraz
Copy link
Contributor

I think we should add a rectangle function too then to the stdlib. it just makes the code a lot cleaner

@franknoirot
Copy link
Collaborator Author

Yeah I'd like that @jessfraz as long as we can still tag each segment of the rectangle through the stdlib function.

I agree on the circle function but it's currently called unstable_stdlib_circle so I didn't think that should be included in generated code.

@jessfraz
Copy link
Contributor

yeah we should make those first class and use them

@Irev-Dev
Copy link
Collaborator

Jess I disagree about stblib functions for rectangle, I like the proposal Frank had for the tag ability
#1500

@Irev-Dev Irev-Dev mentioned this issue Feb 28, 2024
20 tasks
@jessfraz jessfraz added this to the v1 Modeling App Launch milestone Apr 7, 2024
@franknoirot franknoirot self-assigned this Jul 18, 2024
@Irev-Dev
Copy link
Collaborator

Irev-Dev commented Oct 1, 2024

Closed by #3860

@Irev-Dev Irev-Dev closed this as completed Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request sketch
Projects
None yet
Development

No branches or pull requests

3 participants