From eaa7c3e78fd84fd073184ca55af56e6b843e9f4b Mon Sep 17 00:00:00 2001 From: MelchiorSchuh Date: Tue, 13 Jan 2026 14:47:02 +0100 Subject: [PATCH 1/4] fix(SurfacesTopology): Enacted upgraded tests after fixing other issues. --- .../topology/brep_surfaces_topology.cpp | 77 +++++++++---------- tests/inspector/test-solid-adjacency.cpp | 1 + 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/geode/inspector/topology/brep_surfaces_topology.cpp b/src/geode/inspector/topology/brep_surfaces_topology.cpp index 8b97a87a..026e2771 100644 --- a/src/geode/inspector/topology/brep_surfaces_topology.cpp +++ b/src/geode/inspector/topology/brep_surfaces_topology.cpp @@ -218,45 +218,44 @@ namespace geode } const auto line_uuids = internal::components_uuids( brep_, unique_vertex_index, Line3D::component_type_static() ); - // if( line_uuids.empty() ) - // { - // bool has_corner_internal_to_all_surfaces{ false }; - // for( const auto& cmv : - // brep_.component_mesh_vertices( unique_vertex_index ) ) - // { - // if( cmv.component_id.type() - // != Corner3D::component_type_static() ) - // { - // continue; - // } - // const auto& corner = brep_.corner( cmv.component_id.id() ); - // for( const auto& surface_id : surface_uuids ) - // { - // const auto& surface = brep_.surface( surface_id ); - // if( surface.is_active() - // && !brep_.is_internal( corner, surface ) ) - // { - // return absl::StrCat( "unique vertex ", - // unique_vertex_index, " at position [", - // corner.mesh().point( cmv.vertex ).string(), - // "] is part of multiple active Surfaces, and not " - // "part of any Line, but is part of Corner ", - // corner.name(), " (", corner.id().string(), - // "), which is not internal to active Surface ", - // surface.name(), " (", surface_id.string(), ")." - // ); - // } - // } - // has_corner_internal_to_all_surfaces = true; - // } - // if( !has_corner_internal_to_all_surfaces ) - // { - // return absl::StrCat( "unique vertex ", unique_vertex_index, - // " is part of multiple active Surfaces, and not part of " - // "any Line, but not part of any Corner internal to all " - // "Surfaces." ); - // } - // } + if( line_uuids.empty() ) + { + bool has_corner_internal_to_all_surfaces{ false }; + for( const auto& cmv : + brep_.component_mesh_vertices( unique_vertex_index ) ) + { + if( cmv.component_id.type() + != Corner3D::component_type_static() ) + { + continue; + } + const auto& corner = brep_.corner( cmv.component_id.id() ); + for( const auto& surface_id : surface_uuids ) + { + const auto& surface = brep_.surface( surface_id ); + if( surface.is_active() + && !brep_.is_internal( corner, surface ) ) + { + return absl::StrCat( "unique vertex ", + unique_vertex_index, " at position [", + corner.mesh().point( cmv.vertex ).string(), + "] is part of multiple active Surfaces, and not " + "part of any Line, but is part of Corner ", + corner.name(), " (", corner.id().string(), + "), which is not internal to active Surface ", + surface.name(), " (", surface_id.string(), ")." ); + } + } + has_corner_internal_to_all_surfaces = true; + } + if( !has_corner_internal_to_all_surfaces ) + { + return absl::StrCat( "unique vertex ", unique_vertex_index, + " is part of multiple active Surfaces, and not part of " + "any Line, but not part of any Corner internal to all " + "Surfaces." ); + } + } if( line_uuids.size() == 1 ) { index_t nb_cmv_lines{ 0 }; diff --git a/tests/inspector/test-solid-adjacency.cpp b/tests/inspector/test-solid-adjacency.cpp index 265a896c..f7e52c59 100644 --- a/tests/inspector/test-solid-adjacency.cpp +++ b/tests/inspector/test-solid-adjacency.cpp @@ -167,6 +167,7 @@ int main() try { geode::InspectorInspectorLibrary::initialize(); + geode::Logger::set_level( geode::Logger::LEVEL::debug ); check_adjacency(); check_non_adjacency_no_bijection(); check_non_adjacency_wrong_facet(); From c9c7269381f37cf48dff66428850dc395eaff42a Mon Sep 17 00:00:00 2001 From: MelchiorSchuh Date: Thu, 5 Feb 2026 10:43:59 +0100 Subject: [PATCH 2/4] fix message output --- .../inspector/topology/brep_surfaces_topology.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/geode/inspector/topology/brep_surfaces_topology.cpp b/src/geode/inspector/topology/brep_surfaces_topology.cpp index 026e2771..bb6a9dcf 100644 --- a/src/geode/inspector/topology/brep_surfaces_topology.cpp +++ b/src/geode/inspector/topology/brep_surfaces_topology.cpp @@ -293,13 +293,22 @@ namespace geode } if( brep_.Relationships::nb_embeddings( cmv.component_id.id() ) + nb_of_line_relationships_with_surfaces - != surface_uuids.size() ) + < surface_uuids.size() ) { return absl::StrCat( "unique vertex ", unique_vertex_index, " is part of multiple active Surfaces and only one " "Line, is a Corner, but is not internal to all the " "Surfaces without relationships to the Line." ); } + if( brep_.Relationships::nb_embeddings( cmv.component_id.id() ) + + nb_of_line_relationships_with_surfaces + > surface_uuids.size() ) + { + return absl::StrCat( "unique vertex ", unique_vertex_index, + " is part of multiple active Surfaces and only one " + "Line, is a Corner, but is internal to Surfaces with " + "relationships to the Line." ); + } } } return std::nullopt; From 1cfae8373ff3e35d55a64eabb44bb7e9b5791833 Mon Sep 17 00:00:00 2001 From: MelchiorSchuh Date: Thu, 5 Feb 2026 11:37:14 +0100 Subject: [PATCH 3/4] fix(BRepLineTopology): Added test on line edges part of components the line is linked to --- .../topology/brep_lines_topology.cpp | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/geode/inspector/topology/brep_lines_topology.cpp b/src/geode/inspector/topology/brep_lines_topology.cpp index e1850bec..1da9e6e9 100644 --- a/src/geode/inspector/topology/brep_lines_topology.cpp +++ b/src/geode/inspector/topology/brep_lines_topology.cpp @@ -452,6 +452,36 @@ namespace geode surface.name(), " (", surface_id.string(), "), but is neither boundary of nor internal to it." ); } + for( const auto& embedding_surface : brep_.embedding_surfaces( line ) ) + { + if( !embedding_surface.is_active() ) + { + continue; + } + if( !cme.surface_edges.contains( embedding_surface.id() ) ) + { + return absl::StrCat( "Line ", line.name(), " (", + line.id().string(), ") is embedded in Surface ", + embedding_surface.name(), " (", + embedding_surface.id().string(), ") but edge ", edge_index, + " has no common edge with the surface" ); + } + } + for( const auto& incident_surface : brep_.incidences( line ) ) + { + if( !incident_surface.is_active() ) + { + continue; + } + if( !cme.surface_edges.contains( incident_surface.id() ) ) + { + return absl::StrCat( "Line ", line.name(), " (", + line.id().string(), ") is incident to Surface ", + incident_surface.name(), " (", + incident_surface.id().string(), ") but edge ", edge_index, + " has no common edge with the surface" ); + } + } for( const auto& [block_id, block_edges] : cme.block_edges ) { const auto& block = brep_.block( block_id ); @@ -468,6 +498,22 @@ namespace geode continue; } } + for( const auto& embedding_block : brep_.embedding_blocks( line ) ) + { + if( !embedding_block.is_active() + || embedding_block.mesh().nb_polyhedra() == 0 ) + { + continue; + } + if( !cme.block_edges.contains( embedding_block.id() ) ) + { + return absl::StrCat( "Line ", line.name(), " (", + line.id().string(), ") is embedded in Block ", + embedding_block.name(), " (", embedding_block.id().string(), + ") but edge ", edge_index, + " has no common edge with the block" ); + } + } return std::nullopt; } From dd6b128b191800a96480c7ceb4535783d43e1e9b Mon Sep 17 00:00:00 2001 From: Arnaud Botella Date: Thu, 5 Feb 2026 14:15:46 +0100 Subject: [PATCH 4/4] missing output --- .../topology/brep_lines_topology.cpp | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/geode/inspector/topology/brep_lines_topology.cpp b/src/geode/inspector/topology/brep_lines_topology.cpp index 1da9e6e9..1ac8c945 100644 --- a/src/geode/inspector/topology/brep_lines_topology.cpp +++ b/src/geode/inspector/topology/brep_lines_topology.cpp @@ -44,14 +44,15 @@ namespace geode index_t BRepLinesTopologyInspectionResult::nb_issues() const { return lines_not_meshed.nb_issues() + + unique_vertices_linked_to_line_with_wrong_relationship_to_surface + .nb_issues() + lines_not_linked_to_a_unique_vertex.nb_issues() + unique_vertices_linked_to_a_line_with_invalid_embeddings .nb_issues() + unique_vertices_linked_to_a_single_and_invalid_line.nb_issues() - + unique_vertices_linked_to_line_with_wrong_relationship_to_surface - .nb_issues() + unique_vertices_linked_to_several_lines_but_not_linked_to_a_corner - .nb_issues(); + .nb_issues() + + line_edges_with_wrong_component_edges_around.nb_issues(); } std::string BRepLinesTopologyInspectionResult::string() const @@ -61,6 +62,15 @@ namespace geode { absl::StrAppend( &message, lines_not_meshed.string() ); } + if( unique_vertices_linked_to_line_with_wrong_relationship_to_surface + .nb_issues() + != 0 ) + { + absl::StrAppend( &message, + unique_vertices_linked_to_line_with_wrong_relationship_to_surface + .string(), + "\n" ); + } if( lines_not_linked_to_a_unique_vertex.nb_issues() != 0 ) { absl::StrAppend( @@ -80,15 +90,6 @@ namespace geode unique_vertices_linked_to_a_single_and_invalid_line.string(), "\n" ); } - if( unique_vertices_linked_to_line_with_wrong_relationship_to_surface - .nb_issues() - != 0 ) - { - absl::StrAppend( &message, - unique_vertices_linked_to_line_with_wrong_relationship_to_surface - .string(), - "\n" ); - } if( unique_vertices_linked_to_several_lines_but_not_linked_to_a_corner .nb_issues() != 0 ) @@ -97,6 +98,11 @@ namespace geode unique_vertices_linked_to_several_lines_but_not_linked_to_a_corner .string() ); } + if( line_edges_with_wrong_component_edges_around.nb_issues() != 0 ) + { + absl::StrAppend( &message, + line_edges_with_wrong_component_edges_around.string() ); + } if( !message.empty() ) { return message;