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

Add manifold_meshgl_merge to c bindings #820

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bindings/c/include/manifoldc.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ ManifoldMeshGL *manifold_meshgl_w_tangents(void *mem, float *vert_props,
float *halfedge_tangent);
ManifoldMeshGL *manifold_get_meshgl(void *mem, ManifoldManifold *m);
ManifoldMeshGL *manifold_meshgl_copy(void *mem, ManifoldMeshGL *m);
ManifoldMeshGL *manifold_meshgl_merge(void *mem, ManifoldMeshGL *m);

// SDF
// By default, the execution policy (sequential or parallel) of
Expand Down
9 changes: 9 additions & 0 deletions bindings/c/manifoldc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,15 @@
return to_c(new (mem) MeshGL(*from_c(m)));
}

ManifoldMeshGL *manifold_meshgl_merge(void *mem, ManifoldMeshGL *m) {
auto duplicate = new (mem) MeshGL(*from_c(m));

Check warning on line 421 in bindings/c/manifoldc.cpp

View check run for this annotation

Codecov / codecov/patch

bindings/c/manifoldc.cpp#L420-L421

Added lines #L420 - L421 were not covered by tests
if (duplicate->Merge()) {
return to_c(duplicate);

Check warning on line 423 in bindings/c/manifoldc.cpp

View check run for this annotation

Codecov / codecov/patch

bindings/c/manifoldc.cpp#L423

Added line #L423 was not covered by tests
}
delete duplicate;

Check warning on line 425 in bindings/c/manifoldc.cpp

View check run for this annotation

Codecov / codecov/patch

bindings/c/manifoldc.cpp#L425

Added line #L425 was not covered by tests
return m;
}

int manifold_meshgl_num_prop(ManifoldMeshGL *m) { return from_c(m)->numProp; }
int manifold_meshgl_num_vert(ManifoldMeshGL *m) { return from_c(m)->NumVert(); }
int manifold_meshgl_num_tri(ManifoldMeshGL *m) { return from_c(m)->NumTri(); }
Expand Down
Loading