-
Notifications
You must be signed in to change notification settings - Fork 98
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
Separate coplanarity from faceID #991
Conversation
@pca006132 You're right, I can't find any noticeable performance impact from |
/// Optional: Length NumTri, contains the source face ID this | ||
/// triangle comes from. When auto-generated, this ID will be a triangle index | ||
/// into the original mesh. This index/ID is purely for external use (e.g. | ||
/// recreating polygonal faces) and will not affect Manifold's algorithms. |
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.
One question: should we rename our public faceID
, since it really has nothing to do with faces now? Maybe triID
or triIndex
?
The worst part is now in our internal TriRef
struct we have faceID
which really is a face ID and tri
which is the internal analogue to this public faceID
. That's pretty much bound to confuse someone eventually, probably me.
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.
Yeah, triID
sounds better fit here. We should add some documentation for the internal It seems that it is already documented.faceID
to clarify things a bit as well.
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.
Since that will be a big change across all of our binding surfaces and such, I'll leave that to its own PR.
triRef[tri] = {meshID, meshID, tri}; | ||
[meshID, keepFaceID, &triRef](const int tri) { | ||
triRef[tri] = {meshID, meshID, tri, | ||
keepFaceID ? triRef[tri].faceID : tri}; |
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.
What will happen if we always keep face ID?
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.
I think that would be weird - for a regular initialization, that would mean every faceID was zero, which would imply the whole object was a single face. It would probably confuse something at some point.
Simpler alternative to #951, since it doesn't change the logic we use for edge collapsing.
Manifold will no longer use equal faceIDs to mean that those triangles are coplanar. This was always problematic, because it meant that using Warp or Refine would destroy the entire mesh relation, making material association quite difficult. This also means we can remove any concept of property tolerances from our API, which I never liked. Now edges can collapse if the two triangles are coplanar, have the same meshID, and reference the same propVerts on both sides of the edge.