Skip to content

Commit b07cc21

Browse files
topology messages
1 parent c3c808c commit b07cc21

10 files changed

+376
-354
lines changed

src/geode/inspector/topology/brep_blocks_topology.cpp

Lines changed: 64 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ namespace
199199
const auto surface_id =
200200
surface_uuids_to_graph_edges
201201
.out2in( graph->edges_around_vertex( graph_vertex )
202-
.at( 0 )
203-
.edge_id )
202+
.at( 0 )
203+
.edge_id )
204204
.at( 0 );
205205
bool should_delete{ true };
206206
for( const auto& edge_around :
@@ -309,7 +309,7 @@ namespace
309309
const auto unique_vertex = brep.unique_vertex(
310310
{ boundary.component_id(), polygon_vertex } );
311311
if( !unique_vertices_to_polygonal_surface_vertices
312-
.has_mapping_input( unique_vertex ) )
312+
.has_mapping_input( unique_vertex ) )
313313
{
314314
const auto new_vertex =
315315
polygonal_surface_builder->create_point(
@@ -359,7 +359,7 @@ namespace
359359
const auto unique_vertex = brep.unique_vertex(
360360
{ boundary.component_id(), polygon_vertex } );
361361
if( !unique_vertices_to_polygonal_surface_vertices
362-
.has_mapping_input( unique_vertex ) )
362+
.has_mapping_input( unique_vertex ) )
363363
{
364364
const auto new_vertex =
365365
polygonal_surface_builder->create_point(
@@ -469,7 +469,7 @@ namespace geode
469469
{
470470
return message;
471471
}
472-
return "No issues with blocks topology \n";
472+
return "no issues with blocks topology \n";
473473
}
474474

475475
std::string BRepBlocksTopologyInspectionResult::inspection_type() const
@@ -549,10 +549,10 @@ namespace geode
549549
}
550550
}
551551
}
552-
return absl::StrCat( "Unique vertex with index ", unique_vertex_index,
553-
" is part of two blocks, but not of a surface boundary to the "
554-
"two blocks, nor of a line boundary to one of the blocks incident "
555-
"surfaces." );
552+
return absl::StrCat( "unique vertex ", unique_vertex_index,
553+
" is part of two Blocks, but not of a Surface boundary to the "
554+
"two Blocks, nor of a Line boundary to one of the Blocks incident "
555+
"Surfaces." );
556556
}
557557

558558
std::optional< std::string >
@@ -591,32 +591,35 @@ namespace geode
591591
&& absl::c_contains(
592592
not_boundary_surfaces, cmv.component_id.id() ) )
593593
{
594-
return absl::StrCat( "Unique vertex with index ",
595-
unique_vertex_index, " is part of surface with uuid '",
594+
return absl::StrCat( "unique vertex with index ",
595+
unique_vertex_index, " is part of Surface ",
596+
brep_.surface( cmv.component_id.id() ).name(), " (",
596597
cmv.component_id.id().string(),
597-
"', which should not be boundary of any block." );
598+
"), which should not be boundary of any Block." );
598599
}
599600
if( brep_.nb_embeddings( cmv.component_id.id() ) >= 1
600601
&& brep_.nb_incidences( cmv.component_id.id() ) < 1
601602
&& !absl::c_contains(
602603
not_boundary_surfaces, cmv.component_id.id() )
603604
&& absl::c_contains( dangling_surface, cmv.component_id.id() ) )
604605
{
605-
return absl::StrCat( "Unique vertex with index ",
606-
unique_vertex_index, " is part of surface with uuid '",
606+
return absl::StrCat( "unique vertex ", unique_vertex_index,
607+
" is part of Surface ",
608+
brep_.surface( cmv.component_id.id() ).name(), " (",
607609
cmv.component_id.id().string(),
608-
"', which should not be embedded in any block." );
610+
"), which should not be embedded in any Block." );
609611
}
610612
if( brep_.nb_incidences( cmv.component_id.id() ) < 1
611613
&& brep_.nb_embeddings( cmv.component_id.id() ) < 1
612614
&& !absl::c_contains(
613615
dangling_surface, cmv.component_id.id() ) )
614616
{
615-
return absl::StrCat( "Unique vertex with index ",
616-
unique_vertex_index, " is part of surface with uuid '",
617+
return absl::StrCat( "unique vertex ", unique_vertex_index,
618+
" is part of Surface ",
619+
brep_.surface( cmv.component_id.id() ).name(), " (",
617620
cmv.component_id.id().string(),
618-
"', which is not internal to "
619-
"a block while it should be." );
621+
"), which is not internal to "
622+
"a Block while it should be." );
620623
}
621624
}
622625
return std::nullopt;
@@ -642,30 +645,27 @@ namespace geode
642645
}
643646
if( block_uuids.size() > 2 )
644647
{
645-
return absl::StrCat( "Unique vertex with index ",
646-
unique_vertex_index,
647-
" is part of only one surface, but is part of more "
648-
"than two blocks." );
648+
return absl::StrCat( "unique vertex ", unique_vertex_index,
649+
" is part of only one Surface, but is part of more "
650+
"than two Blocks." );
649651
}
650652
if( brep_.nb_embeddings( surface_id ) > 0 )
651653
{
652654
if( internal::brep_blocks_are_meshed( brep_ ) )
653655
{
654656
if( block_uuids.size() != 1 )
655657
{
656-
return absl::StrCat( "Unique vertex with index ",
657-
unique_vertex_index,
658-
" is part of only one surface, which is "
659-
"embedded, but not part of only one block." );
658+
return absl::StrCat( "unique vertex ", unique_vertex_index,
659+
" is part of only one Surface, which is "
660+
"embedded, but not part of only one Block." );
660661
}
661662
else if( !brep_.Relationships::is_internal(
662663
surface_id, block_uuids[0] ) )
663664
{
664-
return absl::StrCat( "Unique vertex with index ",
665-
unique_vertex_index,
666-
" is part of only one surface, which is "
667-
"embedded, and one block, but the surface is "
668-
"not internal to the block." );
665+
return absl::StrCat( "unique vertex ", unique_vertex_index,
666+
" is part of only one Surface, which is "
667+
"embedded, and one Block, but the Surface is "
668+
"not internal to the Block." );
669669
}
670670
}
671671
}
@@ -675,13 +675,14 @@ namespace geode
675675
{
676676
if( !brep_.Relationships::is_boundary( surface_id, block_id ) )
677677
{
678-
return absl::StrCat( "Unique vertex with index ",
679-
unique_vertex_index,
680-
" is part of only one surface, with uuid'",
678+
return absl::StrCat( "unique vertex ", unique_vertex_index,
679+
" is part of only one Surface",
680+
brep_.surface( surface_id ).name(), " (",
681681
surface_id.string(),
682-
"' which is not embedded, but not boundary "
683-
"either of block with uuid '",
684-
block_id.string(), "', in which the vertex is." );
682+
") which is not embedded, but not boundary "
683+
"either of Block ",
684+
brep_.block( block_id ).name(), " (", block_id.string(),
685+
"), in which the vertex is." );
685686
}
686687
}
687688
}
@@ -738,14 +739,13 @@ namespace geode
738739
{
739740
const auto cmv =
740741
brep_.component_mesh_vertices( unique_vertex_index )[0];
741-
return absl::StrCat( "Unique vertex with index ",
742-
unique_vertex_index,
743-
" is part of multiple surfaces and multiple "
744-
"lines, but line with uuid'",
745-
line_id.string(),
746-
"' is neither internal, nor a boundary of at "
747-
"least two surfaces or one embedding "
748-
"surface." );
742+
return absl::StrCat( "unique vertex ", unique_vertex_index,
743+
" is part of multiple Surfaces and multiple "
744+
"Lines, but Line ",
745+
brep_.line( line_id ).name(), " (", line_id.string(),
746+
") is neither internal, nor a boundary of at "
747+
"least two Surfaces or one embedding "
748+
"Surface." );
749749
}
750750
}
751751
return std::nullopt;
@@ -797,8 +797,9 @@ namespace geode
797797
for( const auto& meshed_block_id : meshed_blocks )
798798
{
799799
result.some_blocks_not_meshed.add_issue( meshed_block_id,
800-
absl::StrCat( "Block ", meshed_block_id.string(),
801-
" is not meshed." ) );
800+
absl::StrCat( "Block ",
801+
brep_.block( meshed_block_id ).name(), " (",
802+
meshed_block_id.string(), ") is not meshed." ) );
802803
}
803804
}
804805
for( const auto& meshed_block_id : meshed_blocks )
@@ -809,25 +810,26 @@ namespace geode
809810
brep_, block.component_id(), block.mesh() );
810811
if( block_result.nb_issues() != 0 )
811812
{
812-
block_result.set_description(
813-
absl::StrCat( "Block ", meshed_block_id.string() ) );
813+
block_result.set_description( absl::StrCat( "Block ",
814+
brep_.block( meshed_block_id ).name(), " (",
815+
meshed_block_id.string(), ")" ) );
814816
result.blocks_not_linked_to_a_unique_vertex.add_issues_to_map(
815817
block.id(), std::move( block_result ) );
816818
}
817819
if( verify_blocks_boundaries( brep_, block ) )
818820
{
819821
result.blocks_with_not_closed_boundary_surfaces.add_issue(
820-
block.id(), absl::StrCat( "Block ", block.id().string(),
821-
" boundaries are valid." ) );
822+
block.id(),
823+
absl::StrCat( "Block ", block.name(), " (",
824+
block.id().string(), ") boundaries are valid." ) );
822825
}
823826
}
824827
if( brep_.nb_model_boundaries() != 0 )
825828
{
826829
if( !are_brep_boundaries_closed( brep_ ) )
827830
{
828-
result.model_boundaries_dont_form_a_closed_surface.add_issue(
829-
0, absl::StrCat(
830-
"Brep boundaries are not topologically valid." ) );
831+
result.model_boundaries_dont_form_a_closed_surface.add_issue( 0,
832+
absl::StrCat( "boundaries are not topologically valid." ) );
831833
}
832834
}
833835
for( const auto unique_vertex_id : Range{ brep_.nb_unique_vertices() } )
@@ -881,12 +883,13 @@ namespace geode
881883
bsurf_uuid, brep_, block_boundary_uuids ) )
882884
{
883885
result.wrong_block_boundary_surface.add_issue( bsurf_uuid,
884-
absl::StrCat( "Surface ", bsurf_uuid.string(),
885-
" should not be boundary of Block ",
886-
block.id().string(),
887-
" : it has a boundary line not incident to any "
888-
"other block "
889-
"boundary surface." ) );
886+
absl::StrCat( "Surface ",
887+
brep_.surface( bsurf_uuid ).name(), " (",
888+
bsurf_uuid.string(),
889+
") should not be boundary of Block ", block.name(),
890+
" (", block.id().string(),
891+
") : it has a boundary Line not incident to any "
892+
"other Block boundary Surface." ) );
890893
}
891894
}
892895
}

src/geode/inspector/topology/brep_corners_topology.cpp

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ namespace geode
7878
{
7979
return message;
8080
}
81-
return "No issues with corners topology \n";
81+
return "no issues with Corners topology \n";
8282
}
8383

8484
std::string BRepCornersTopologyInspectionResult::inspection_type() const
@@ -155,8 +155,8 @@ namespace geode
155155
{
156156
if( corner_found )
157157
{
158-
return absl::StrCat( "Unique vertex with index ",
159-
unique_vertex_index, " is part of several corners." );
158+
return absl::StrCat( "unique vertex ", unique_vertex_index,
159+
" is part of several Corners." );
160160
}
161161
corner_found = true;
162162
}
@@ -175,10 +175,11 @@ namespace geode
175175
&& brep_.nb_embeddings( cmv.component_id.id() ) < 1
176176
&& brep_.nb_incidences( cmv.component_id.id() ) < 1 )
177177
{
178-
return absl::StrCat( "Unique vertex with index ",
179-
unique_vertex_index, " is associated to corner with uuid '",
178+
return absl::StrCat( "unique vertex ", unique_vertex_index,
179+
" is associated to Corner ",
180+
brep_.corner( cmv.component_id.id() ).name(), " (",
180181
cmv.component_id.id().string(),
181-
"', which is neither internal nor boundary." );
182+
"), which is neither internal nor boundary." );
182183
}
183184
}
184185
return std::nullopt;
@@ -223,24 +224,26 @@ namespace geode
223224
}
224225
if( line_vertex_count != 2 )
225226
{
226-
return absl::StrCat( "Unique vertex with index ",
227-
unique_vertex_index,
228-
" is associated with corner with uuid '",
227+
return absl::StrCat( "unique vertex with index ",
228+
unique_vertex_index, " is associated with Corner ",
229+
brep_.corner( corner_uuid ).name(), " (",
229230
corner_uuid.string(),
230-
"', which is internal to line with uuid '",
231-
cmv_line.component_id.id().string(),
232-
"', so line should be closed and have two "
231+
"), which is internal to Line ",
232+
brep_.line( cmv_line.component_id.id() ).name(),
233+
" (", cmv_line.component_id.id().string(),
234+
"), so Line should be closed and have two "
233235
"different vertices on unique vertex, but has ",
234236
line_vertex_count, " vertices on it instead." );
235237
}
236238
continue;
237239
}
238-
return absl::StrCat( "Unique vertex with index ",
239-
unique_vertex_index,
240-
" is associated with corner with uuid '",
241-
corner_uuid.string() + "', part of line with uuid '",
240+
return absl::StrCat( "unique vertex ", unique_vertex_index,
241+
" is associated with Corner ",
242+
brep_.corner( corner_uuid ).name(), " (",
243+
corner_uuid.string() + "), part of line ",
244+
brep_.line( cmv_line.component_id.id() ).name(), " (",
242245
cmv_line.component_id.id().string(),
243-
"', but is neither boundary nor internal of it." );
246+
"), but is neither boundary nor internal of it." );
244247
}
245248
}
246249
return std::nullopt;
@@ -254,18 +257,18 @@ namespace geode
254257
{
255258
if( !corner_is_meshed( brep_.corner( corner.id() ) ) )
256259
{
257-
result.corners_not_meshed.add_issue(
258-
corner.id(), absl::StrCat( "Corner ", corner.id().string(),
259-
" is not meshed." ) );
260+
result.corners_not_meshed.add_issue( corner.id(),
261+
absl::StrCat( "Corner ", corner.name(), " (",
262+
corner.id().string(), ") is not meshed." ) );
260263
continue;
261264
}
262265
auto corner_result = internal::
263266
model_component_vertices_not_associated_to_unique_vertices(
264267
brep_, corner.component_id(), corner.mesh() );
265268
if( corner_result.nb_issues() != 0 )
266269
{
267-
corner_result.set_description(
268-
absl::StrCat( "Corner ", corner.id().string() ) );
270+
corner_result.set_description( absl::StrCat( "Corner ",
271+
corner.name(), " (", corner.id().string(), ")" ) );
269272
result.corners_not_linked_to_a_unique_vertex.add_issues_to_map(
270273
corner.id(), std::move( corner_result ) );
271274
}

0 commit comments

Comments
 (0)