Skip to content

Commit 5d7bf49

Browse files
committed
fix(Degeneration): use OpenGeode meshes defintion or degeneration
1 parent 9b28505 commit 5d7bf49

File tree

5 files changed

+15
-37
lines changed

5 files changed

+15
-37
lines changed

src/geode/inspector/criterion/degeneration/brep_meshes_degeneration.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ namespace geode
5858

5959
std::string BRepMeshesDegenerationInspectionResult::inspection_type() const
6060
{
61-
return "Adjacencies inspection";
61+
return "Degeneration inspection";
6262
}
6363

6464
class BRepComponentMeshesDegeneration::Impl

src/geode/inspector/criterion/degeneration/edgedcurve_degeneration.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ namespace geode
4141

4242
bool is_mesh_degenerated() const
4343
{
44-
for( const auto edge_index : Range{ mesh_.nb_edges() } )
44+
for( const auto edge_id : Range{ mesh_.nb_edges() } )
4545
{
46-
if( mesh_.edge_length( edge_index ) < global_epsilon )
46+
if( mesh_.is_edge_degenerated( edge_id ) )
4747
{
4848
return true;
4949
}
@@ -56,15 +56,15 @@ namespace geode
5656
InspectionIssues< index_t > degenerated_edges_index{
5757
"Degenerated Edges of EdgeCurve " + mesh_.id().string() + "."
5858
};
59-
for( const auto edge_index : Range{ mesh_.nb_edges() } )
59+
for( const auto edge_id : Range{ mesh_.nb_edges() } )
6060
{
61-
if( mesh_.edge_length( edge_index ) < global_epsilon )
61+
if( mesh_.is_edge_degenerated( edge_id ) )
6262
{
63-
degenerated_edges_index.add_issue( edge_index,
64-
absl::StrCat( "Edge with index ", edge_index,
65-
", at position [",
66-
mesh_.edge_barycenter( edge_index ).string(),
67-
"], is degenerated." ) );
63+
degenerated_edges_index.add_issue(
64+
edge_id, absl::StrCat( "Edge with index ", edge_id,
65+
", at position [",
66+
mesh_.edge_barycenter( edge_id ).string(),
67+
"], is degenerated." ) );
6868
}
6969
}
7070
return degenerated_edges_index;

src/geode/inspector/criterion/degeneration/section_meshes_degeneration.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace geode
5555
std::string
5656
SectionMeshesDegenerationInspectionResult::inspection_type() const
5757
{
58-
return "Adjacencies inspection";
58+
return "Degeneration inspection";
5959
}
6060

6161
class SectionComponentMeshesDegeneration::Impl

src/geode/inspector/criterion/degeneration/solid_degeneration.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace geode
5555
for( const auto polyhedron_id :
5656
Range{ this->mesh().nb_polyhedra() } )
5757
{
58-
if( polyhedron_is_degenerated( polyhedron_id ) )
58+
if( this->mesh().is_polyhedron_degenerated( polyhedron_id ) )
5959
{
6060
return true;
6161
}
@@ -71,7 +71,7 @@ namespace geode
7171
for( const auto polyhedron_id :
7272
Range{ this->mesh().nb_polyhedra() } )
7373
{
74-
if( polyhedron_is_degenerated( polyhedron_id ) )
74+
if( this->mesh().is_polyhedron_degenerated( polyhedron_id ) )
7575
{
7676
wrong_polyhedra.add_issue( polyhedron_id,
7777
absl::StrCat( "Polyhedron ", polyhedron_id,
@@ -81,17 +81,6 @@ namespace geode
8181
}
8282
return wrong_polyhedra;
8383
}
84-
85-
private:
86-
bool polyhedron_is_degenerated( index_t polyhedron_id ) const
87-
{
88-
const auto& mesh = this->mesh();
89-
if( mesh.polyhedron_volume( polyhedron_id ) > global_epsilon )
90-
{
91-
return false;
92-
}
93-
return true;
94-
}
9584
};
9685

9786
template < index_t dimension >

src/geode/inspector/criterion/degeneration/surface_degeneration.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ namespace geode
5454
}
5555
for( const auto polygon_id : Range{ this->mesh().nb_polygons() } )
5656
{
57-
if( polygon_is_degenerated( polygon_id ) )
57+
if( this->mesh().is_polygon_degenerated( polygon_id ) )
5858
{
5959
return true;
6060
}
@@ -69,7 +69,7 @@ namespace geode
6969
};
7070
for( const auto polygon_id : Range{ this->mesh().nb_polygons() } )
7171
{
72-
if( polygon_is_degenerated( polygon_id ) )
72+
if( this->mesh().is_polygon_degenerated( polygon_id ) )
7373
{
7474
wrong_polygons.add_issue( polygon_id,
7575
absl::StrCat( "Polygon ", polygon_id, " of Surface ",
@@ -78,17 +78,6 @@ namespace geode
7878
}
7979
return wrong_polygons;
8080
}
81-
82-
private:
83-
bool polygon_is_degenerated( index_t polygon_id ) const
84-
{
85-
const auto& mesh = this->mesh();
86-
if( mesh.polygon_area( polygon_id ) > global_epsilon )
87-
{
88-
return false;
89-
}
90-
return true;
91-
}
9281
};
9382

9483
template < index_t dimension >

0 commit comments

Comments
 (0)