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

Modeling-App should Close a path and convert to Solid2d without close(%) #4271

Open
gserena01 opened this issue Oct 23, 2024 · 3 comments
Open

Comments

@gserena01
Copy link
Contributor

Currently, a user needs to explicitly use close(%) in order to have a sketch be "closed" in the engine and converted to a Solid2D. Even though it's a quick and easy fix, this is confusing and not very intuitive for users (see #3895 (comment)).

I propose that the modeling-app+engine close a sketch and convert to a Solid2D if the user extends the path to be within a certain tolerance of the start point.

@adamchalmers
Copy link
Collaborator

adamchalmers commented Oct 23, 2024

This would make it very difficult to add a type checker in the future, because lineTo() would return a different type (a 2d sketch or a 3d solid) depending on the specific point you gave it, and where the first point in the sketch was.

I'd be more open to, instead, allowing extrude to take either a solid or sketch, and if it's a sketch, extrude would attempt to close it first before extruding.

@jgomez720
Copy link
Collaborator

lineTo() would return a 3d solid? Shouldn't it only ever return a sketch at the most? extrude, revolve, etc. should return the solid3d, no?

@nrc
Copy link
Contributor

nrc commented Oct 24, 2024

I wonder if instead of having a separate close function or implicitly closing, closing should be a property of the drawing function which physically closes the path?

So, the typical use case is draw a bunch of stuff, complete the path by calling lineTo(startingPoint()) (pseudo code, obviously) and then call close. There is duplication of intention here. What if instead we had a flavour of line (and arc, etc). which was lineToClose (straw-man name) which draws a line to the starting point (without having to extract the starting point from the path) and also closes the path (i.e., the input type is 'open path' and the output type is 'closed path').

Separately, I would like to look into these functions with many different 'flavour's to make finding and using them more ergonomic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants