Skip to content

Commit 8316f65

Browse files
committed
fix(BRep): remove non manifold edge test on model surfaces
1 parent 8a23178 commit 8316f65

File tree

2 files changed

+4
-93
lines changed

2 files changed

+4
-93
lines changed

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

Lines changed: 0 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -42,56 +42,6 @@
4242
#include <geode/inspector/criterion/manifold/solid_facet_manifold.hpp>
4343
#include <geode/inspector/criterion/manifold/solid_vertex_manifold.hpp>
4444

45-
namespace
46-
{
47-
bool is_vertex_on_free_border( const geode::Surface3D& surface,
48-
geode::index_t vertex,
49-
const geode::BRep& model )
50-
{
51-
const auto unique_vertex =
52-
model.unique_vertex( { surface.component_id(), vertex } );
53-
for( const auto& cmv : model.component_mesh_vertices( unique_vertex ) )
54-
{
55-
if( cmv.component_id.type()
56-
!= geode::Line3D::component_type_static() )
57-
{
58-
continue;
59-
}
60-
if( !model.relation_index( cmv.component_id.id(), surface.id() )
61-
.has_value() )
62-
{
63-
continue;
64-
}
65-
if( model.is_internal(
66-
model.line( cmv.component_id.id() ), surface ) )
67-
{
68-
continue;
69-
}
70-
if( model.nb_incidences( cmv.component_id.id() ) > 1 )
71-
{
72-
continue;
73-
}
74-
return true;
75-
}
76-
return false;
77-
}
78-
79-
std::vector< bool > vertices_on_free_border(
80-
const geode::Surface3D& surface,
81-
const geode::SurfaceMesh3D& surface_mesh,
82-
const geode::BRep& model )
83-
{
84-
std::vector< bool > is_on_free_border(
85-
surface_mesh.nb_vertices(), false );
86-
for( const auto vertex : geode::Range{ surface_mesh.nb_vertices() } )
87-
{
88-
is_on_free_border[vertex] =
89-
is_vertex_on_free_border( surface, vertex, model );
90-
}
91-
return is_on_free_border;
92-
}
93-
} // namespace
94-
9545
namespace geode
9646
{
9747
std::string BRepMeshesManifoldInspectionResult::string() const
@@ -241,44 +191,6 @@ namespace geode
241191
message );
242192
continue;
243193
}
244-
const auto& surface = model().surface( edge.second[0] );
245-
const auto& mesh = surface.mesh();
246-
const auto is_on_free_border =
247-
vertices_on_free_border( surface, mesh, model() );
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] )
270-
{
271-
continue;
272-
}
273-
std::string message = absl::StrCat(
274-
"Model edge between unique vertices ",
275-
edge.first.vertices()[0], " and ", edge.first.vertices()[1],
276-
" is not manifold: it has 2 point on the free border "
277-
"without being on the border of surface " );
278-
absl::StrAppend( &message, edge.second[0].string(), ", " );
279-
issues.add_issue(
280-
BRepNonManifoldEdge{ edge.first.vertices(), edge.second },
281-
message );
282194
}
283195
for( const auto& line : model().lines() )
284196
{
@@ -349,5 +261,4 @@ namespace geode
349261
impl_->add_model_non_manifold_facets( result.brep_non_manifold_facets );
350262
return result;
351263
}
352-
353264
} // namespace geode

tests/inspector/test-brep.cpp

Lines changed: 4 additions & 4 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 == 13503,
320+
OPENGEODE_EXCEPTION( nb_component_meshes_issues == 13494,
321321
"[Test] model_A1 has ", nb_component_meshes_issues,
322-
" meshes problems instead of 13503." );
322+
" meshes problems instead of 13494." );
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 == 13503,
343+
OPENGEODE_EXCEPTION( nb_component_meshes_issues == 13494,
344344
"[Test] model_A1_valid has ", nb_component_meshes_issues,
345-
" meshes problems instead of 13503." );
345+
" meshes problems instead of 13494." );
346346
}
347347

348348
void check_model_mss( bool string )

0 commit comments

Comments
 (0)