From 007acd970bfc7d21af9626d094989d873c97cb72 Mon Sep 17 00:00:00 2001 From: Johnathon Selstad Date: Tue, 5 Dec 2023 14:33:30 -0800 Subject: [PATCH] Fix Formatting --- bindings/c/include/manifoldc.h | 2 +- bindings/wasm/helpers.cpp | 4 +++- src/manifold/src/manifold.cpp | 2 +- test/manifold_test.cpp | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bindings/c/include/manifoldc.h b/bindings/c/include/manifoldc.h index 1998aa703..77d29e4bf 100644 --- a/bindings/c/include/manifoldc.h +++ b/bindings/c/include/manifoldc.h @@ -120,7 +120,7 @@ ManifoldManifold *manifold_hull_pts(void *mem, ManifoldVec3 *ps, size_t length); // Sweeps ManifoldManifold *manifold_sweep(void *mem, ManifoldManifold *m, float x, - float y, float z); + float y, float z); // Manifold Transformations diff --git a/bindings/wasm/helpers.cpp b/bindings/wasm/helpers.cpp index c7304b99b..c5e8e81e8 100644 --- a/bindings/wasm/helpers.cpp +++ b/bindings/wasm/helpers.cpp @@ -190,7 +190,9 @@ Manifold IntersectionN(const std::vector& manifolds) { Manifold Sweep(Manifold& manifold, const val& v) { std::vector array = convertJSArrayToNumberVector(v); glm::vec3 offset; - offset[0] = array[0]; offset[1] = array[1]; offset[2] = array[2]; + offset[0] = array[0]; + offset[1] = array[1]; + offset[2] = array[2]; return manifold.Sweep(offset); } diff --git a/src/manifold/src/manifold.cpp b/src/manifold/src/manifold.cpp index ed296a948..9022a899f 100644 --- a/src/manifold/src/manifold.cpp +++ b/src/manifold/src/manifold.cpp @@ -845,7 +845,7 @@ Manifold Manifold::Sweep(glm::vec3 v) const { glm::vec3 normal = glm::cross( mesh.vertPos[mesh.triVerts[i].y] - mesh.vertPos[mesh.triVerts[i].x], mesh.vertPos[mesh.triVerts[i].z] - mesh.vertPos[mesh.triVerts[i].x]); - if (glm::dot(normal, v) > -0.0001f) { // Only Sweep Forward Triangles + if (glm::dot(normal, v) > -0.0001f) { // Only Sweep Forward Triangles Manifold sweptTriangle = Hull({ mesh.vertPos[mesh.triVerts[i].x], mesh.vertPos[mesh.triVerts[i].y], diff --git a/test/manifold_test.cpp b/test/manifold_test.cpp index 689f46ab4..1db511d18 100644 --- a/test/manifold_test.cpp +++ b/test/manifold_test.cpp @@ -762,8 +762,8 @@ TEST(Manifold, EmptyHull) { TEST(Manifold, SweptCube) { std::vector cubePts = { - {0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}, // corners - {1, 1, 0}, {0, 1, 1}, {1, 0, 1}, {1, 1, 1}, // corners + {0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}, // corners + {1, 1, 0}, {0, 1, 1}, {1, 0, 1}, {1, 1, 1}, // corners }; auto sweptCube = Manifold::Hull(cubePts).Sweep({1, 0, 0}); EXPECT_FLOAT_EQ(sweptCube.GetProperties().volume, 2);