-
Notifications
You must be signed in to change notification settings - Fork 120
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
Fix properties #587
Fix properties #587
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -567,7 +567,7 @@ void CreateProperties(Manifold::Impl &outR, const Vec<TriRef> &refPQ, | |
} | ||
if (uvw[j] == 0) edge = j; | ||
} | ||
if (edge >= 0) { | ||
if (edge >= 0) { // This misses some edges | ||
// On an edge, both propVerts must match | ||
const int p0 = triProp[Next3(edge)]; | ||
const int p1 = triProp[Prev3(edge)]; | ||
|
@@ -772,6 +772,7 @@ Manifold::Impl Boolean3::Result(OpType op) const { | |
|
||
Vec<TriRef> refPQ = UpdateReference(outR, inP_, inQ_, invertQ); | ||
|
||
// This causes some verts to be outside of their refPQ triangle. | ||
outR.SimplifyTopology(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried just reversing the order - create the properties first, and then simplify the topology. However, in this case it's very difficult to keep from duplicating prop verts (CoplanarProp test does a good job catching this). This might not seem like a huge deal, but they tend to continue to multiply, until your final output going to the renderer is basically triangle soup, even if the geometry is manifold. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need for |
||
|
||
CreateProperties(outR, refPQ, inP_, inQ_); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the root cause of the problem: when an edge is collapsed (before this step) you can end up with verts that refer (through refPQ) to a triangle that they are now outside of, since they were merged with their neighboring triangle but the references were not updated. This would be fine, except here I'm assuming I can tell when a vert is on a retained edge by checking its barycentric coordinates - but I miss these ones. So I end up assigning a key with only the
meshID
andvert
, which isn't enough when the other side of the retained edge might have different properties.