Skip to content

Commit

Permalink
Add More Test Coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
zalo committed Dec 5, 2023
1 parent 007acd9 commit e78c21a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bindings/wasm/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ EMSCRIPTEN_BINDINGS(whatever) {
.function("_SplitByPlane", &man_js::SplitByPlane)
.function("_TrimByPlane", &Manifold::TrimByPlane)
.function("hull", select_overload<Manifold() const>(&Manifold::Hull))
.function("sweep", select_overload<Manifold() const>(&Manifold::Sweep))
.function("sweep", &Manifold::Sweep)
.function("_GetMeshJS", &js::GetMeshJS)
.function("refine", &Manifold::Refine)
.function("_Warp", &man_js::Warp)
Expand Down
7 changes: 7 additions & 0 deletions test/manifold_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -768,3 +768,10 @@ TEST(Manifold, SweptCube) {
auto sweptCube = Manifold::Hull(cubePts).Sweep({1, 0, 0});
EXPECT_FLOAT_EQ(sweptCube.GetProperties().volume, 2);
}

TEST(Manifold, SweptComplex) {
auto sphere = Manifold::Sphere(0.6, 20);
auto cube = Manifold::Cube({1.0, 1.0, 1.0}, true);
auto sweptShape = (cube - sphere).Sweep({0.1, 0.3, 0.1});
EXPECT_FLOAT_EQ(sweptShape.GetProperties().volume, 0.7779319882392883);
}

0 comments on commit e78c21a

Please sign in to comment.