Skip to content

Commit 2d66bfd

Browse files
committed
fix(Topology): Added test to verify if unique vertices linked to an internal component are also linked to its embedding(s) component(s).
1 parent 4551cb6 commit 2d66bfd

File tree

3 files changed

+84
-6
lines changed

3 files changed

+84
-6
lines changed

src/geode/inspector/topology/private/brep_lines_topology_impl.cpp

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
#include <geode/inspector/topology/private/brep_lines_topology_impl.h>
2525

26+
#include <absl/algorithm/container.h>
27+
2628
#include <geode/basic/logger.h>
2729

2830
#include <geode/mesh/core/solid_mesh.h>
@@ -97,29 +99,54 @@ namespace geode
9799
vertex_is_part_of_line_with_invalid_internal_topology(
98100
const index_t unique_vertex_index ) const
99101
{
100-
for( const auto line : brep_.mesh_component_vertices(
101-
unique_vertex_index, Line3D::component_type_static() ) )
102+
for( const auto line_id :
103+
components_uuids( brep_.mesh_component_vertices(
104+
unique_vertex_index, Line3D::component_type_static() ) ) )
102105
{
103-
const auto embeddings =
104-
brep_.embeddings( line.component_id.id() );
106+
const auto embeddings = brep_.embeddings( line_id );
105107

106108
for( const auto embedding : embeddings )
107109
{
108110
if( brep_.Relationships::is_boundary(
109-
line.component_id.id(), embedding.id() ) )
111+
line_id, embedding.id() ) )
110112
{
111113
if( verbose_ )
112114
{
113115
Logger::info( "Unique vertex with index ",
114116
unique_vertex_index,
115117
" is part of line with uuid '",
116-
line.component_id.id().string(),
118+
line_id.string(),
117119
"', which is both boundary and embedded in "
118120
"surface with uuid '",
119121
embedding.id().string(), "'." );
120122
}
121123
return true;
122124
}
125+
if( embedding.type() == Block3D::component_type_static()
126+
&& !brep_blocks_are_meshed( brep_ ) )
127+
{
128+
continue;
129+
}
130+
if( !absl::c_any_of(
131+
brep_.mesh_component_vertices(
132+
unique_vertex_index, embedding.type() ),
133+
[&embedding]( const MeshComponentVertex& mcv ) {
134+
return mcv.component_id.id() == embedding.id();
135+
} ) )
136+
{
137+
if( verbose_ )
138+
{
139+
Logger::info( "Unique vertex with index ",
140+
unique_vertex_index,
141+
" is part of line with uuid '",
142+
line_id.string(),
143+
"', which is embedded in surface with uuid '",
144+
embedding.id().string(),
145+
"', but the unique vertex is not linked to the "
146+
"surface mesh vertices." );
147+
}
148+
return true;
149+
}
123150
}
124151
}
125152
return false;

src/geode/inspector/topology/private/brep_surfaces_topology_impl.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
#include <geode/inspector/topology/private/brep_surfaces_topology_impl.h>
2525

26+
#include <absl/algorithm/container.h>
27+
2628
#include <geode/basic/algorithm.h>
2729
#include <geode/basic/logger.h>
2830

@@ -155,6 +157,27 @@ namespace geode
155157
}
156158
return true;
157159
}
160+
if( brep_blocks_are_meshed( brep_ )
161+
&& !absl::c_any_of(
162+
brep_.mesh_component_vertices( unique_vertex_index,
163+
Block3D::component_type_static() ),
164+
[&embedding]( const MeshComponentVertex& mcv ) {
165+
return mcv.component_id.id() == embedding.id();
166+
} ) )
167+
{
168+
if( verbose_ )
169+
{
170+
Logger::info( "Unique vertex with index ",
171+
unique_vertex_index,
172+
" is part of surface with uuid '",
173+
surface_id.string(),
174+
"', which is embedded in block with uuid '",
175+
embedding.id().string(),
176+
"', but the unique vertex is not linked to the "
177+
"block vertices." );
178+
}
179+
return true;
180+
}
158181
}
159182
}
160183
return false;

src/geode/inspector/topology/private/section_lines_topology_impl.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
#include <geode/inspector/topology/private/section_lines_topology_impl.h>
2525

26+
#include <absl/algorithm/container.h>
27+
2628
#include <geode/basic/logger.h>
2729

2830
#include <geode/mesh/core/surface_mesh.h>
@@ -127,6 +129,32 @@ namespace geode
127129
}
128130
return true;
129131
}
132+
for( const auto& embedding :
133+
section_.embeddings( line.component_id.id() ) )
134+
{
135+
if( section_surfaces_are_meshed( section_ )
136+
&& !absl::c_any_of(
137+
section_.mesh_component_vertices(
138+
unique_vertex_index,
139+
Surface2D::component_type_static() ),
140+
[&embedding]( const MeshComponentVertex& mcv ) {
141+
return mcv.component_id.id() == embedding.id();
142+
} ) )
143+
{
144+
if( verbose_ )
145+
{
146+
Logger::info( "Unique vertex with index ",
147+
unique_vertex_index,
148+
" is part of line with uuid '",
149+
line.component_id.string(),
150+
"', which is embedded in surface with uuid '",
151+
embedding.id().string(),
152+
"', but the unique vertex is not linked to the "
153+
"surface mesh vertices." );
154+
}
155+
return true;
156+
}
157+
}
130158
}
131159
return false;
132160
}

0 commit comments

Comments
 (0)