File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,8 @@ struct Manifold::Impl {
163163 runIndex = {0 , static_cast <I>(runEnd)};
164164 } else if (runIndex.size () == meshGL.runOriginalID .size ()) {
165165 runIndex.push_back (runEnd);
166+ } else if (runIndex.size () == 1 ) {
167+ runIndex.push_back (runEnd);
166168 }
167169
168170 const auto startID = Impl::ReserveIDs (meshGL.runOriginalID .size ());
Original file line number Diff line number Diff line change @@ -103,6 +103,14 @@ TEST(Manifold, ValidInput) {
103103 EXPECT_EQ (tet.Status (), Manifold::Error::NoError);
104104}
105105
106+ TEST (Manifold, ValidInputOneRunIndex) {
107+ MeshGL emptyMesh;
108+ emptyMesh.runIndex = {0 };
109+ Manifold empty (emptyMesh);
110+ EXPECT_TRUE (empty.IsEmpty ());
111+ EXPECT_EQ (empty.Status (), Manifold::Error::NoError);
112+ }
113+
106114TEST (Manifold, InvalidInput1) {
107115 MeshGL in = TetGL ();
108116 in.vertProperties [2 * 3 + 1 ] = NAN;
@@ -155,6 +163,14 @@ TEST(Manifold, InvalidInput6) {
155163 EXPECT_EQ (tet.Status (), Manifold::Error::VertexOutOfBounds);
156164}
157165
166+ TEST (Manifold, InvalidInput7) {
167+ MeshGL cube = CubeUV ();
168+ cube.runIndex = {0 , 1 , static_cast <uint32_t >(cube.triVerts .size ())};
169+ Manifold tet (cube);
170+ EXPECT_TRUE (tet.IsEmpty ());
171+ EXPECT_EQ (tet.Status (), Manifold::Error::RunIndexWrongLength);
172+ }
173+
158174TEST (Manifold, OppositeFace) {
159175 MeshGL gl;
160176 gl.vertProperties = {
You can’t perform that action at this time.
0 commit comments