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

Star model displays triangulation issues #143

Closed
hannobraun opened this issue Feb 7, 2022 · 6 comments · Fixed by #448
Closed

Star model displays triangulation issues #143

hannobraun opened this issue Feb 7, 2022 · 6 comments · Fixed by #448
Labels
status: blocked Issue or pull request is blocked by another issue or pull request, or some outside circumstance topic: core Issues relating to core geometry, operations, algorithms type: bug Something isn't working

Comments

@hannobraun
Copy link
Owner

hannobraun commented Feb 7, 2022

When changing the number of pointy ends of the star model, some values display triangulation issues.

Here's the 12-pointed star:
Screenshot from 2022-02-07 17-24-55

And here's the 15-pointed star:
Screenshot from 2022-02-07 17-25-41

These might or might not be the result of issues that are already documented in #105, but in any case, I think it would be a mistake to fix more triangulation bugs without adding test cases to guard against regressions. Labeling this issue as blocked by #105.

@hannobraun hannobraun added type: bug Something isn't working status: blocked Issue or pull request is blocked by another issue or pull request, or some outside circumstance topic: core Issues relating to core geometry, operations, algorithms labels Feb 7, 2022
@hannobraun
Copy link
Owner Author

#138 has been addressed, but the problems described here are still present. This means this only blocked on #105 now. Updated the issue description accordingly.

@hannobraun
Copy link
Owner Author

@therealprof has reported some weird data in #246. See also my comment there.

I'm going to repeat some of what I said there here, as it directly relates to this issue.


The screenshots here show whole triangles that shouldn't be there. This is most likely a problem in the triangulation code or the approximation code that feeds it data. More specifically, I suspect that it might be a problem with the point-in-polygon testing that's necessary as part of the triangulation ([1] and [2]), which has known issues (#105).

A word of warning: That triangulation code is pretty gnarly, and overdue for a cleanup. See #105.

@therealprof
Copy link
Contributor

I've trimmed down the example a bit to only render the "outer" sketch so there're less datapoints (and involved code) to look at...

Problems start at 12 "points", here's what that looks like:

Screenshot 2022-02-24 at 11 39 14

@hannobraun
Copy link
Owner Author

Looks like triangles that should be kept are being removed instead, which again points to issues with the point-in-polygon test.

@hannobraun
Copy link
Owner Author

Even the default version of the star model is broken now:
Screenshot from 2022-04-09 09-17-33

Most likely, this happened yesterday in #439.

I'm looking into it. #439 was intended to be a pure refactoring without any functional changes.

@hannobraun
Copy link
Owner Author

I think I get it. The problem was introduced in this commit: eb187e0

This changes the calculation of the point the ray shoots to. The algorithm itself stays the same, just the ray that is used for determining if a triangle is part of the shape is changed, meaning it could hit different edges in different places, at different angles.

There are known problem with that code. I'm very sure that this commit didn't introduce any new issues, it just shuffled things around, so that the default 5-pointed star model now triggers those bugs. This is unfortunate, but some fallout is to be expected, as I work on the triangulation code.

I don't intend to do anything about this specific instance of the bug, but I'm actively working on fixing this and other triangulation bugs, so I hope this will improve soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: blocked Issue or pull request is blocked by another issue or pull request, or some outside circumstance topic: core Issues relating to core geometry, operations, algorithms type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants