Skip to content

Commit 0d22a58

Browse files
committed
Merge branch 'next' into fix/segmentation
2 parents c1aaf34 + 80ca4d7 commit 0d22a58

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/geode/mesh/builder/graph_builder.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@ namespace geode
129129

130130
index_t GraphBuilder::create_edge( index_t v0_id, index_t v1_id )
131131
{
132-
OPENGEODE_ASSERT( v0_id != v1_id, "[GraphBuilder::create_edge] "
133-
"Trying to create an edge with "
134-
"same extremities" );
135132
const auto added_edge = graph_.nb_edges();
136133
create_edge();
137134
set_edge_vertex( { added_edge, 0 }, v0_id );

src/geode/mesh/core/solid_mesh.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ namespace
163163
{
164164
geode::PolyhedraAroundEdge result;
165165
const auto first_polyhedron = facet.polyhedron_id;
166+
geode::index_t safety_count{ 0 };
167+
constexpr geode::index_t MAX_SAFETY_COUNT{ 1000 };
166168
do
167169
{
168170
if( const auto adj = solid.polyhedron_adjacent_facet( facet ) )
@@ -188,7 +190,16 @@ namespace
188190
{
189191
return std::make_tuple( std::move( result ), false );
190192
}
191-
} while( facet.polyhedron_id != first_polyhedron );
193+
} while( facet.polyhedron_id != first_polyhedron
194+
&& safety_count < MAX_SAFETY_COUNT );
195+
OPENGEODE_EXCEPTION( safety_count < MAX_SAFETY_COUNT,
196+
"[SolidMesh::propagate_around_edge] Too many polyhedra "
197+
"around edge ",
198+
edge_vertices[0], " ", edge_vertices[1], " (",
199+
solid.point( edge_vertices[0] ).string(), " ",
200+
solid.point( edge_vertices[1] ).string(),
201+
"). This is probably related to a bug in the polyhedron "
202+
"adjacencies." );
192203
return std::make_tuple( std::move( result ), true );
193204
}
194205

0 commit comments

Comments
 (0)