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

suggested handling for a closed loop #8

Open
MisterHW opened this issue May 20, 2018 · 3 comments
Open

suggested handling for a closed loop #8

MisterHW opened this issue May 20, 2018 · 3 comments

Comments

@MisterHW
Copy link

change signature to
module skin(profiles, no_endcaps=false)

change last line to
polyhedron(convexity=4, points=profiles, faces = no_endcaps ? triangles : concat(start_cap, triangles, end_cap));

duplicate vertices are acceptable (https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#Point_repetitions_in_a_polyhedron_point_list) so when the first and last profiles are identical this produces e.g. a closed toroid.

MisterHW added a commit to MisterHW/IoP-satellite that referenced this issue May 20, 2018
changes to skin.scad required (as per openscad/list-comprehension-demos#8):
change signature to
module skin(profiles, no_endcaps=false)
change last line to
polyhedron(convexity=4, points=profiles, faces = no_endcaps ? triangles : concat(start_cap, triangles, end_cap));

stl files provided for convenience :)
@dpellegr
Copy link

This may fail pretty brutally if due to rounding errors in the computation the final points differ a bit (or if the user makes a mistake). I have produced a pull request which recycles the first points so that there is no need to duplicate points and the closure is always guaranteed. See #12

@MisterHW
Copy link
Author

Maybe a good solution for the users. no_endcaps as suggested above still does exactly what it says and is only guaranteed to produce manifold geometry if the last profile is a copy of the first one and should be unique functionality. Depending on the resolution error handling of CGAL, the usefulness is limited by transformations incurring further numerical errors.

In https://github.com/MisterHW/IoP-satellite/blob/master/OpenSCAD%20bottle%20threads/azimuthal_profile.scad that exact mistake is made to rely on roundoff-error-free behavior of trigonometric functions.

Ultimately however I feel that calling the feature 'loop' invites +/-1-type misunderstandings, as it's unclear whether loop describes a property of the profiles passed or whether it's a parameter controlling skin(). Nitpicking aside, close_loop or bridge_ends might leave less room for confusion?

@dpellegr
Copy link

Yes, I didn't pick the name as the flag was already there albeit unimplemented.
However IMHO the profile is always (assumed) a closed loop (otherwise it is impossible to define the inward and the outward faces) so there is no ambiguity.

Let's now see if one of the maintainers take action...

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

No branches or pull requests

2 participants