-
Notifications
You must be signed in to change notification settings - Fork 97
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
Remove Mesh from interface + memcpy depuplication #313
Conversation
Codecov ReportBase: 91.36% // Head: 91.36% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #313 +/- ##
=======================================
Coverage 91.36% 91.36%
=======================================
Files 33 33
Lines 3626 3626
=======================================
Hits 3313 3313
Misses 313 313 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
Thanks, less code is always nice!
ManifoldMesh *manifold_level_set(void *mem, float (*sdf)(float, float, float), | ||
ManifoldBox *bounds, float edge_length, | ||
float level) { | ||
ManifoldMeshGL *manifold_level_set(void *mem, float (*sdf)(float, float, float), |
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.
You might consider returning a Manifold
instead. I return a Mesh
so there isn't a dependency, but here I'd guess the whole point would be to do further operations. It'll be fastest to push the Mesh
directly into the Manifold
constructor without the intermediate MeshGL
step in this case.
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.
In the higher level bindings I do provide a direct to manifold function (by including the manifold construction), but I suppose I could also expose one directly in the C. I think it still makes sense to have a mesh returning version in the case the user plans to go straight to pulling out / using properties.
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.
Thinking about it a bit more, providing a straight to manifold version would mean two more, rather than one more function since there already has to be a forced sequential version. Since it is so simple to provide the higher level direct manifold function in the FFI bindings, I think the MeshGL version should be sufficient for the C side.
In addition to the cleanup in the closed PR, I've removed Mesh from the interface in the spirit of your intention to keep it as a C++ only implementation detail.