@@ -56,7 +56,7 @@ namespace
5656 return block_boundary_uuids;
5757 }
5858
59- bool is_line_incident_to_other_block_boundary_surface (
59+ bool is_line_incident_to_another_block_boundary_surface (
6060 const geode::Line3D& line,
6161 const geode::BRep& brep,
6262 absl::Span< const geode::uuid > block_boundary_uuids,
@@ -77,30 +77,21 @@ namespace
7777 return false ;
7878 }
7979
80- std::vector< geode::uuid > inspect_boundary_surfaces (
81- const geode::BRep& brep )
80+ bool surface_should_not_be_boundary_to_block ( const geode::uuid& bsurf_uuid,
81+ const geode::BRep& brep,
82+ const std::vector< geode::uuid >& block_boundary_uuids )
8283 {
83- std::vector< geode::uuid > wrong_boundary_surfaces ;
84- for ( const auto & block : brep.blocks ( ) )
84+ const auto & surface = brep. surface ( bsurf_uuid ) ;
85+ for ( const auto & line : brep.boundaries ( surface ) )
8586 {
86- const auto block_boundary_uuids =
87- block_boundary_surfaces ( brep, block );
88- for ( const auto & bsurf_uuid : block_boundary_uuids )
87+ if ( is_line_incident_to_another_block_boundary_surface (
88+ line, brep, block_boundary_uuids, bsurf_uuid ) )
8989 {
90- const auto & surface = brep.surface ( bsurf_uuid );
91- for ( const auto & line : brep.boundaries ( surface ) )
92- {
93- if ( is_line_incident_to_other_block_boundary_surface (
94- line, brep, block_boundary_uuids, bsurf_uuid ) )
95- {
96- continue ;
97- }
98- wrong_boundary_surfaces.push_back ( bsurf_uuid );
99- break ;
100- }
90+ continue ;
10191 }
92+ return true ;
10293 }
103- return wrong_boundary_surfaces ;
94+ return false ;
10495 }
10596
10697 template < typename Condition >
@@ -435,12 +426,24 @@ namespace geode
435426 .add_issue ( unique_vertex_id, problem_message.value () );
436427 }
437428 }
438- for ( const auto & wrong_bsurf : inspect_boundary_surfaces ( brep_ ) )
429+ for ( const auto & block : brep_. blocks ( ) )
439430 {
440- result.wrong_block_boundary_surface .add_issue ( wrong_bsurf,
441- absl::StrCat ( " Boundary surface " , wrong_bsurf.string (),
442- " contains a line not incident to "
443- " any other block boundary surface." ) );
431+ const auto block_boundary_uuids =
432+ block_boundary_surfaces ( brep_, block );
433+ for ( const auto & bsurf_uuid : block_boundary_uuids )
434+ {
435+ if ( surface_should_not_be_boundary_to_block (
436+ bsurf_uuid, brep_, block_boundary_uuids ) )
437+ {
438+ result.wrong_block_boundary_surface .add_issue ( bsurf_uuid,
439+ absl::StrCat ( " Surface " , bsurf_uuid.string (),
440+ " should not be boundary of Block " ,
441+ block.id ().string (),
442+ " : it has a boundary line not incident to any "
443+ " other block "
444+ " boundary surface." ) );
445+ }
446+ }
444447 }
445448 return result;
446449 }
0 commit comments