-
Notifications
You must be signed in to change notification settings - Fork 111
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
Missing C bindings + revamp composition with opaque vectors #382
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #382 +/- ##
==========================================
+ Coverage 85.48% 85.91% +0.43%
==========================================
Files 36 36
Lines 4415 4444 +29
==========================================
+ Hits 3774 3818 +44
+ Misses 641 626 -15
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 in Codecov by Sentry. |
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.
Excellent cleanup, thank you!
return ms; | ||
ManifoldManifoldVec *manifold_decompose(void *mem, ManifoldManifold *m) { | ||
auto comps = from_c(m)->Decompose(); | ||
return to_c(new (mem) std::vector<Manifold>(comps)); |
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.
👍
@@ -75,9 +75,6 @@ class Manifold { | |||
*/ | |||
///@{ | |||
static Manifold Compose(const std::vector<Manifold>&); | |||
|
|||
Components GetComponents() const; | |||
std::vector<Manifold> Decompose(Components components) const; |
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.
💯
…ish#382) - Add bindings to `CrossSection::{Compose,Decompose,NumVert,NumContour,Warp}` - Add bindings to `Boolean` and `BatchBoolean` for both `Manifold` and `CrossSection` - Add `ManifoldManifoldVec` and `ManifoldCrossSectionVec` opaque types for `std::vector` pointers to help clean up bindings involving vectors (particularly when they are returned with dynamic size, *e.g.* `manifold_decompose` - Remove two-step Components workaround previously introduced to allow return of C array from `manifold_decompose`
This brings the C bindings up to date with the latest additions to
CrossSection
as well as adding a couple that were missing from theManifold
coverage as well (Boolean
andBatchBoolean
).With the addition of
CrossSection
'sDecompose
, I decided I should take the opportunity to remedy some silliness I introduced with the multistepDecompose
due to my desire to stick with arrays uniformly, without using an opaque vector API. NowDecompose
for both classes returns an opaque vector, and the basic methods have been added to support this.