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

Maintain manifoldness when converting between PolySet and ManifoldGeometry #5020

Merged
merged 9 commits into from Mar 16, 2024

Conversation

kintel
Copy link
Member

@kintel kintel commented Feb 26, 2024

Fixes #5022

  • createManifoldFromPolySet() is now the main entry point for obtaining a ManifoldGeometry from a PolySet
  • We first try direct creation from vertices and indices (after triangulating if necessary)
  • Added ResultObject::mutableResult() and ResultObject::constResult() to make it more clear what to expect, plus clean up some wrong constness.
  • Fixed a test case with wrong polygon winding: tests/data/scad/stl/stl-export.scad

@kintel
Copy link
Member Author

kintel commented Feb 26, 2024

@pca006132 This is not mergeable, but could be a starting point for experimentation/discussion.

@pca006132
Copy link
Member

Wow this is a pretty large patch, I think we can probably start small and try to construct ManifoldGeometry from some primitives and polyhedron calls?

@kintel
Copy link
Member Author

kintel commented Feb 27, 2024

Oh, don't worry, just look at the very last commit.

@kintel kintel force-pushed the kintel-manifold-creation branch 2 times, most recently from b6f178b to 6e2c822 Compare February 27, 2024 02:45
@pca006132
Copy link
Member

Seems fine, not sure how the status thing will interact with multiple threads though (not that it matters now). I think manifold should probably provide some thread safe alternative to check the status, though it may be a hard problem (to keep compatibility).

@kintel
Copy link
Member Author

kintel commented Feb 27, 2024

What part of the status handling is not thread safe?

@pca006132
Copy link
Member

Ah, nevermind, I remembered the wrong API. I thought that status is static but it is not

@kintel kintel force-pushed the kintel-manifold-creation branch 2 times, most recently from 30236e9 to 84917c1 Compare March 5, 2024 02:55
@kintel kintel changed the title WIP: Attempt creating ManifoldGeometry from manifold PolySets Maintain manifoldness when converting between PolySet and ManifoldGeometry Mar 5, 2024
@kintel kintel force-pushed the kintel-manifold-creation branch 2 times, most recently from 8c84746 to 2aa9568 Compare March 10, 2024 16:23
@kintel
Copy link
Member Author

kintel commented Mar 14, 2024

@pca006132 If you find the time: The interesting pieces are createManifoldFromPolySet() and createManifoldFromTriangularPolySet()

@kintel kintel marked this pull request as ready for review March 14, 2024 00:51
@kintel kintel merged commit a529e11 into master Mar 16, 2024
5 checks passed
@kintel kintel deleted the kintel-manifold-creation branch March 16, 2024 16:35
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.

Some Manifold objects fail to import into Manifold
2 participants