-
Notifications
You must be signed in to change notification settings - Fork 111
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
extrude twist can cause invalid geometry #563
Comments
I would call this user issue, not library issue. :) |
I think it depends on how you view the APIs. For example, the documentation of the warp function explicitly says that it is very easy to create self-intersections and we do not check them now. The way I see this is that, except certain APIs that we have warned the users, geometrically valid inputs should result in geometrically valid output. Anything violating this is a bug. (which we can also 'fix' by saying that the user should pay attention to blablabla...) |
I look at this exactly like the Warp function, and you're right that it should probably have a similar warning. I am planning to try and implement an overlap removal algorithm, in which case that can be run automatically after operations like these. |
@platypii suggested we can rotate the points to avoid getting self-intersections, though it will only work if the points are evenly spaced. Wonder if this can work in general if we interpolate the points into segments with roughly the same lengths? One problem is that the geometry will be different even for cases that there are no self-intersections. |
I think that's a little too clever - could easily surprise users. Let's wait for a proper solution that will handle Warp as well. |
I was thinking about the twist parameter when I was looking at offset extrude. It seems that the twist parameter can cause invalid geometry when the
nDivisions
is small. This problem also exists in OpenSCAD (which does not use our extrude algorithm) so this is pretty general.Extruding a square with
twist=180
andnDivisions=0
(not necessarily invalid, I am just showing here because it is a simpler case):Extruding a concave polygon (
square(glm::vec2(2), false) - square(glm::vec2(1), false)
withtwist=180
andnDivisions=0
:The text was updated successfully, but these errors were encountered: