diff --git a/src/manifold/src/csg_tree.cpp b/src/manifold/src/csg_tree.cpp index ad58b5796..0b0d5da81 100644 --- a/src/manifold/src/csg_tree.cpp +++ b/src/manifold/src/csg_tree.cpp @@ -223,7 +223,7 @@ Manifold::Impl CsgLeafNode::Compose( const bool invert = glm::determinant(glm::mat3(node->transform_)) < 0; for_each_n( policy, - zip(combined.halfedgeTangent_.begin(), countAt(edgeIndices[i])), + zip(combined.halfedgeTangent_.begin() + edgeIndices[i], countAt(0)), node->pImpl_->halfedgeTangent_.size(), TransformTangents{glm::mat3(node->transform_), invert, node->pImpl_->halfedgeTangent_.cptrD(), diff --git a/test/manifold_test.cpp b/test/manifold_test.cpp index 37c600817..0f4ad2144 100644 --- a/test/manifold_test.cpp +++ b/test/manifold_test.cpp @@ -1088,3 +1088,12 @@ TEST(Manifold, Invalid) { EXPECT_EQ(Manifold::Extrude(empty_circ, 10.).Status(), invalid); EXPECT_EQ(Manifold::Revolve(empty_sq).Status(), invalid); } + +TEST(Manifold, MultiCompose) { + auto legAssembly = Manifold::Compose({Manifold::Cube({100, 140, 38})}); + auto finalAssembly = Manifold::Compose( + {legAssembly, legAssembly.Translate({0, 300, 0}), + legAssembly.Mirror({1, 0, 0}).Translate({300, 0, 0}), + legAssembly.Mirror({1, 0, 0}).Translate({300, 300, 0})}); + finalAssembly.GetMesh(); +}