Skip to content

Commit 0636816

Browse files
committed
fix model check for invalidity
1 parent 92b74dc commit 0636816

File tree

3 files changed

+28
-9
lines changed

3 files changed

+28
-9
lines changed

src/geode/inspector/criterion/manifold/brep_meshes_manifold.cpp

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,34 @@ namespace geode
239239
BRepNonManifoldEdge{
240240
edge.first.vertices(), edge.second },
241241
message );
242+
continue;
242243
}
243244
const auto& surface = model().surface( edge.second[0] );
244245
const auto& mesh = surface.mesh();
245246
const auto is_on_free_border =
246247
vertices_on_free_border( surface, mesh, model() );
247-
if( !is_on_free_border[edge.first.vertices()[0]]
248-
|| !is_on_free_border[edge.first.vertices()[1]] )
248+
geode::index_t first_edge_vertex;
249+
geode::index_t second_edge_vertex;
250+
for( const auto& cmv : model().component_mesh_vertices(
251+
edge.first.vertices()[0] ) )
252+
{
253+
if( cmv.component_id.id() == surface.id() )
254+
{
255+
first_edge_vertex = cmv.vertex;
256+
break;
257+
}
258+
}
259+
for( const auto& cmv : model().component_mesh_vertices(
260+
edge.first.vertices()[1] ) )
261+
{
262+
if( cmv.component_id.id() == surface.id() )
263+
{
264+
second_edge_vertex = cmv.vertex;
265+
break;
266+
}
267+
}
268+
if( !is_on_free_border[first_edge_vertex]
269+
|| !is_on_free_border[second_edge_vertex] )
249270
{
250271
continue;
251272
}

src/geode/inspector/criterion/manifold/surface_edge_manifold.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ namespace
5252
};
5353
if( !polygons_around_edges
5454
.try_emplace( polygon_edge_vertex_cycle,
55-
std::pair< geode::local_index_t, bool >{
56-
1, false } )
55+
std::make_pair( 1, false ) )
5756
.second )
5857
{
5958
polygons_around_edges[polygon_edge_vertex_cycle].first += 1;

tests/inspector/test-brep.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,9 @@ void check_model_a1( bool string )
317317

318318
const auto nb_component_meshes_issues =
319319
launch_component_meshes_validity_checks( result.meshes, string );
320-
OPENGEODE_EXCEPTION( nb_component_meshes_issues == 13494,
320+
OPENGEODE_EXCEPTION( nb_component_meshes_issues == 13503,
321321
"[Test] model_A1 has ", nb_component_meshes_issues,
322-
" meshes problems instead of 13494." );
322+
" meshes problems instead of 13503." );
323323
}
324324

325325
void check_model_a1_valid( bool string )
@@ -340,9 +340,9 @@ void check_model_a1_valid( bool string )
340340

341341
const auto nb_component_meshes_issues =
342342
launch_component_meshes_validity_checks( result.meshes, string );
343-
OPENGEODE_EXCEPTION( nb_component_meshes_issues == 13494,
343+
OPENGEODE_EXCEPTION( nb_component_meshes_issues == 13503,
344344
"[Test] model_A1_valid has ", nb_component_meshes_issues,
345-
" meshes problems instead of 13494." );
345+
" meshes problems instead of 13503." );
346346
}
347347

348348
void check_model_mss( bool string )
@@ -396,7 +396,6 @@ int main()
396396
check_model_a1_valid( false );
397397
check_model_mss( false );
398398
check_model_D( false );
399-
400399
geode::Logger::info( "TEST SUCCESS" );
401400
return 0;
402401
}

0 commit comments

Comments
 (0)