Skip to content

Commit ad9e07e

Browse files
authored
Merge pull request #922 from Geode-solutions/fix/solid-edge-find
fix(SolidMesh): more robust edge finder
2 parents 9f0f979 + 22db353 commit ad9e07e

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/geode/mesh/core/solid_mesh.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,17 +191,21 @@ namespace
191191
const geode::SolidMesh< dimension >& solid,
192192
const std::array< geode::index_t, 2 >& vertices )
193193
{
194-
for( const auto& polyhedron :
195-
solid.polyhedra_around_vertex( vertices[0] ) )
194+
for( const auto vertex : vertices )
196195
{
197-
for( const auto& edge_vertices :
198-
solid.polyhedron_edges_vertices( polyhedron.polyhedron_id ) )
196+
for( const auto& polyhedron :
197+
solid.polyhedra_around_vertex( vertex ) )
199198
{
200-
if( vertices == edge_vertices
201-
|| ( vertices[0] == edge_vertices[1]
202-
&& vertices[1] == edge_vertices[0] ) )
199+
for( const auto& edge_vertices :
200+
solid.polyhedron_edges_vertices(
201+
polyhedron.polyhedron_id ) )
203202
{
204-
return polyhedron.polyhedron_id;
203+
if( vertices == edge_vertices
204+
|| ( vertices[0] == edge_vertices[1]
205+
&& vertices[1] == edge_vertices[0] ) )
206+
{
207+
return polyhedron.polyhedron_id;
208+
}
205209
}
206210
}
207211
}

0 commit comments

Comments
 (0)