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

Make create faces optional #935

Merged
merged 7 commits into from
Sep 17, 2024
Merged

Make create faces optional #935

merged 7 commits into from
Sep 17, 2024

Conversation

elalish
Copy link
Owner

@elalish elalish commented Sep 17, 2024

CreateFace() scales pretty poorly with model size and isn't always needed, so I'm removing it from a bunch of our functions and expecting users to call AsOriginal() instead when they want coplanar faces identified. I've also simplified some tests, which identified some existing bugs, particularly in SetProperties, so there are some fixes here as well.

I'm still thinking through the API implications of all this and trying to make sure I have the right shape. I've also removed propertyTolerance from our constructors - it is only needed for CreateFaces, so now it's just an input to AsOriginal.

Next I'm going to work on a follow-on that splits the concepts of faceID and coplanarity. I believe this will allow me to remove the slow part of CreateFaces entirely (connected components) and allow Warp and Refine to retain their mesh relations - currently those get destroyed since coplanarity gets broken.

@elalish elalish self-assigned this Sep 17, 2024
if (meshGL.runOriginalID.empty()) {
// FIXME: This affects Impl::InitializeOriginal, and removing this
// apparently make things fail. Not sure if this is expected.
meshRelation_.originalID = Impl::ReserveIDs(1);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @pca006132 I fixed this as part of the rest of this cleanup.

for (int i = 0; i < numTri; ++i) {
for (const int j : {0, 1, 2}) {
triProperties[i][j] = idx++;
triProperties[i][j] = pImpl->halfedge_[3 * i + j].startVert;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bug was causing duplicate propVerts to be created unnecessarily.

CalculateNormals();
InitializeOriginal();
CreateFaces({});
SimplifyTopology();
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @Kushal-Shah-03 I simplified the hull setup - hopefully improves the speed a bit.

@elalish elalish merged commit ced53e2 into master Sep 17, 2024
20 checks passed
@elalish elalish deleted the createFaces branch September 17, 2024 21:59
@elalish elalish mentioned this pull request Nov 5, 2024
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

Successfully merging this pull request may close these issues.

1 participant