Skip to content

Commit

Permalink
Merge pull request #921 from Geode-solutions/fix/modify-component-mes…
Browse files Browse the repository at this point in the history
…h-edges-method

fix(SurfaceComponentMeshEdges): assure that component edges does not …
  • Loading branch information
panquez authored May 29, 2024
2 parents 81900f2 + 4cabadd commit 8a5a0c4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
14 changes: 11 additions & 3 deletions src/geode/model/helpers/component_mesh_edges.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,19 @@ namespace geode
const auto& mesh = surface.mesh();
for( const auto& pair : surface_pair.second )
{
for( auto& polygon_vertex :
mesh.polygons_from_edge_vertices( pair ) )
if( auto edge = mesh.polygon_edge_from_vertices(
pair[0], pair[1] ) )

{
edges[surface.id()].emplace_back(
std::move( edge.value() ) );
continue;
}
if( auto edge = mesh.polygon_edge_from_vertices(
pair[1], pair[0] ) )
{
edges[surface.id()].emplace_back(
std::move( polygon_vertex ) );
std::move( edge.value() ) );
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,25 @@ namespace geode
}
for( auto& edge : it->second )
{
edges.emplace_back( std::move( edge ) );
const auto& surface_mesh = surface.mesh();
const auto& edge_vertices =
surface_mesh.polygon_edge_vertices( edge );
edges.emplace_back(
surface_mesh
.polygon_edge_from_vertices(
edge_vertices[0], edge_vertices[1] )
.value() );
if( surface_mesh
.polygon_edge_from_vertices(
edge_vertices[1], edge_vertices[0] )
.has_value() )
{
edges.emplace_back(
surface_mesh
.polygon_edge_from_vertices(
edge_vertices[1], edge_vertices[0] )
.value() );
}
}
}
}
Expand Down

0 comments on commit 8a5a0c4

Please sign in to comment.