Skip to content

Commit e04b8e9

Browse files
fix(ModelColocation): Upgraded the verbose mode for the ModelComponentsMeshColocation and added a filter to the colocated points to remove those with the same unique vertices from the list.
fix(ModelColocation): Upgraded the verbose mode for the ModelComponentsMeshColocation and added a filter to the colocated points to remove those with the same unique vertices from the list.
1 parent 76c6bc3 commit e04b8e9

23 files changed

+471
-103
lines changed

bindings/python/tests/test-py-brep.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ def check_a1_vertices_topology():
235235
else:
236236
print( "model_A1 topology is invalid." )
237237
nb_model_issues = launch_topological_validity_checks( brep_inspector )
238-
if nb_model_issues != 1254:
239-
raise ValueError( "[Test] model model_A1 should have 1254 unique vertices with topological problems." )
238+
if nb_model_issues != 1998:
239+
raise ValueError( "[Test] model model_A1 should have 1998 unique vertices with topological problems." )
240240
nb_component_meshes_issues = launch_component_meshes_validity_checks( brep_inspector )
241241
if nb_component_meshes_issues != 0:
242242
raise ValueError( "[Test] model model_A1 should have 0 component meshes issues." )
@@ -251,8 +251,8 @@ def check_a1_valid_vertices_topology():
251251
else:
252252
print( "model_A1_valid topology is invalid." )
253253
nb_model_issues = launch_topological_validity_checks( brep_inspector )
254-
if nb_model_issues != 1254:
255-
raise ValueError( "[Test] model model_A1_valid should have 1254 unique vertices with topological problems." )
254+
if nb_model_issues != 1998:
255+
raise ValueError( "[Test] model model_A1_valid should have 1998 unique vertices with topological problems." )
256256
nb_component_meshes_issues = launch_component_meshes_validity_checks( brep_inspector )
257257
if nb_component_meshes_issues != 0:
258258
raise ValueError( "[Test] model model_A1_valid should have 0 component meshes issues." )
@@ -270,8 +270,8 @@ def check_mss_vertices_topology():
270270
if nb_model_issues != 17:
271271
raise ValueError( "[Test] model mss.og_strm should have 17 unique vertices with topological problems." )
272272
nb_component_meshes_issues = launch_component_meshes_validity_checks( brep_inspector )
273-
if nb_component_meshes_issues != 148:
274-
raise ValueError( "[Test] model mss should have 148 component meshes issues." )
273+
if nb_component_meshes_issues != 0:
274+
raise ValueError( "[Test] model mss should have no component meshes issues." )
275275

276276
def check_model_D_vertices_topology():
277277
test_dir = os.path.dirname(__file__)
@@ -286,8 +286,8 @@ def check_model_D_vertices_topology():
286286
if nb_model_issues != 0:
287287
raise ValueError( "[Test] model model_D.og_brep should have 0 unique vertices with topological problems." )
288288
nb_component_meshes_issues = launch_component_meshes_validity_checks( brep_inspector )
289-
if nb_component_meshes_issues != 2:
290-
raise ValueError( "[Test] model_D should have 2 component meshes issues." )
289+
if nb_component_meshes_issues != 0:
290+
raise ValueError( "[Test] model_D should have no component meshes issues." )
291291

292292
if __name__ == '__main__':
293293
check_a1_vertices_topology()

bindings/python/tests/test-py-edgedcurve-colocation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def check_colocation2D():
5959
colocation_inspector = inspector.EdgedCurveColocation2D ( curve )
6060
if not colocation_inspector.mesh_has_colocated_points():
6161
raise ValueError( "[Test] EdgedCurve doesn't have colocated points whereas it should have several." )
62-
if not colocation_inspector.nb_colocated_points() == 3:
62+
if not colocation_inspector.nb_colocated_points() == 5:
6363
raise ValueError( "[Test] EdgedCurve has wrong number of colocated points." )
6464
first_colocated_points_group = [ 0, 1, 6 ]
6565
if not colocation_inspector.colocated_points_groups()[0] == first_colocated_points_group:
@@ -101,7 +101,7 @@ def check_colocation3D():
101101
colocation_inspector = inspector.EdgedCurveColocation3D ( curve )
102102
if not colocation_inspector.mesh_has_colocated_points():
103103
raise ValueError( "[Test] (3D) EdgedCurve doesn't have colocated points whereas it should have several." )
104-
if not colocation_inspector.nb_colocated_points() == 3:
104+
if not colocation_inspector.nb_colocated_points() == 5:
105105
raise ValueError( "[Test] (3D) EdgedCurve has wrong number of colocated points." )
106106
first_colocated_points_group = [ 0, 1, 6 ]
107107
if not colocation_inspector.colocated_points_groups()[0] == first_colocated_points_group:

bindings/python/tests/test-py-pointset-colocation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def check_colocation2D():
6060
colocation_inspector = inspector.PointSetColocation2D( pointset )
6161
if not colocation_inspector.mesh_has_colocated_points():
6262
raise ValueError( "[Test] PointSet doesn't have colocated points whereas it should have several." )
63-
if not colocation_inspector.nb_colocated_points() == 3:
63+
if not colocation_inspector.nb_colocated_points() == 5:
6464
raise ValueError( "[Test] PointSet has wrong number of colocated points." )
6565
first_colocated_points_group = [ 0, 1, 6 ]
6666
if not colocation_inspector.colocated_points_groups()[0] == first_colocated_points_group:
@@ -102,7 +102,7 @@ def check_colocation3D():
102102
colocation_inspector = inspector.PointSetColocation3D( pointset )
103103
if not colocation_inspector.mesh_has_colocated_points():
104104
raise ValueError( "[Test] (3D) PointSet doesn't have colocated points whereas it should have several." )
105-
if not colocation_inspector.nb_colocated_points() == 3:
105+
if not colocation_inspector.nb_colocated_points() == 5:
106106
raise ValueError( "[Test] (3D) PointSet has wrong number of colocated points." )
107107
first_colocated_points_group = [ 0, 1, 6 ]
108108
if not colocation_inspector.colocated_points_groups()[0] == first_colocated_points_group:

bindings/python/tests/test-py-solid-colocation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def check_colocation():
6161
colocation_inspector = inspector.SolidMeshColocation3D( solid )
6262
if not colocation_inspector.mesh_has_colocated_points():
6363
raise ValueError( "[Test] Solid doesn't have colocated points whereas it should have several." )
64-
if not colocation_inspector.nb_colocated_points() == 3:
64+
if not colocation_inspector.nb_colocated_points() == 5:
6565
raise ValueError( "[Test] Solid has wrong number of colocated points." )
6666
first_colocated_points_group = [ 0, 1, 6 ]
6767
if not colocation_inspector.colocated_points_groups()[0] == first_colocated_points_group:

bindings/python/tests/test-py-surface-colocation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def check_colocation2D():
5959
colocation_inspector = inspector.SurfaceMeshColocation2D( surface )
6060
if not colocation_inspector.mesh_has_colocated_points():
6161
raise ValueError( "[Test] Surface doesn't have colocated points whereas it should have several." )
62-
if not colocation_inspector.nb_colocated_points() == 3:
62+
if not colocation_inspector.nb_colocated_points() == 5:
6363
raise ValueError( "[Test] Surface has wrong number of colocated points." )
6464
first_colocated_points_group = [ 0, 1, 6 ]
6565
if not colocation_inspector.colocated_points_groups()[0] == first_colocated_points_group:
@@ -101,7 +101,7 @@ def check_colocation3D():
101101
colocation_inspector = inspector.SurfaceMeshColocation3D( surface )
102102
if not colocation_inspector.mesh_has_colocated_points():
103103
raise ValueError( "[Test] (3D) Surface doesn't have colocated points whereas it should have several." )
104-
if not colocation_inspector.nb_colocated_points() == 3:
104+
if not colocation_inspector.nb_colocated_points() == 5:
105105
raise ValueError( "[Test] (3D) Surface has wrong number of colocated points." )
106106
first_colocated_points_group = [ 0, 1, 6 ]
107107
if not colocation_inspector.colocated_points_groups()[0] == first_colocated_points_group:

include/geode/inspector/topology/brep_topology.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ namespace geode
5656

5757
bool brep_meshed_components_are_linked_to_a_unique_vertex() const;
5858

59+
bool brep_unique_vertices_are_linked_to_a_component_vertex() const;
60+
5961
index_t nb_corners_not_linked_to_a_unique_vertex() const;
6062

6163
index_t nb_lines_meshed_but_not_linked_to_a_unique_vertex() const;
@@ -64,6 +66,11 @@ namespace geode
6466

6567
index_t nb_blocks_meshed_but_not_linked_to_a_unique_vertex() const;
6668

69+
index_t nb_unique_vertices_not_linked_to_a_component_vertex() const;
70+
71+
std::vector< index_t >
72+
unique_vertices_not_linked_to_a_component_vertex() const;
73+
6774
std::vector< index_t >
6875
invalid_components_topology_unique_vertices() const;
6976

include/geode/inspector/topology/section_topology.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,19 @@ namespace geode
5656

5757
bool section_meshed_components_are_linked_to_a_unique_vertex() const;
5858

59+
bool section_unique_vertices_are_linked_to_a_component_vertex() const;
60+
5961
index_t nb_corners_not_linked_to_a_unique_vertex() const;
6062

6163
index_t nb_lines_meshed_but_not_linked_to_a_unique_vertex() const;
6264

6365
index_t nb_surfaces_meshed_but_not_linked_to_a_unique_vertex() const;
6466

67+
index_t nb_unique_vertices_not_linked_to_a_component_vertex() const;
68+
69+
std::vector< index_t >
70+
unique_vertices_not_linked_to_a_component_vertex() const;
71+
6572
std::vector< index_t >
6673
invalid_components_topology_unique_vertices() const;
6774

src/bin/geode-inspector-brep.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void inspect_brep( const geode::BRep& brep )
6363
{
6464
const auto verbose = absl::GetFlag( FLAGS_verbose );
6565
const geode::BRepInspector brep_inspector{ brep, verbose };
66-
absl::InlinedVector< async::task< void >, 27 > tasks;
66+
absl::InlinedVector< async::task< void >, 28 > tasks;
6767
if( absl::GetFlag( FLAGS_component_linking ) )
6868
{
6969
tasks.emplace_back( async::spawn( [&brep_inspector] {
@@ -93,6 +93,13 @@ void inspect_brep( const geode::BRep& brep )
9393
geode::Logger::info(
9494
nb_blocks, " blocks meshed but not linked to a unique vertex" );
9595
} ) );
96+
tasks.emplace_back( async::spawn( [&brep_inspector] {
97+
const auto nb_unlinked_uv =
98+
brep_inspector
99+
.nb_unique_vertices_not_linked_to_a_component_vertex();
100+
geode::Logger::info( nb_unlinked_uv,
101+
" unique vertices not linked to a component mesh vertex" );
102+
} ) );
96103
}
97104
if( absl::GetFlag( FLAGS_unique_vertices_colocation ) )
98105
{

src/bin/geode-inspector-edgedcurve.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ void inspect_edgedcurve( const geode::EdgedCurve< dimension >& edgedcurve )
5858
if( absl::GetFlag( FLAGS_colocation ) )
5959
{
6060
tasks.emplace_back( async::spawn( [&inspector] {
61-
const auto nb = inspector.nb_colocated_points();
61+
geode::index_t nb{ 0 };
62+
for( const auto& pt_group : inspector.colocated_points_groups() )
63+
{
64+
nb += pt_group.size();
65+
}
6266
geode::Logger::info( nb, " colocated points" );
6367
} ) );
6468
}

src/bin/geode-inspector-pointset.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ void inspect_pointset( const geode::PointSet< dimension >& pointset )
5151
{
5252
const auto verbose = absl::GetFlag( FLAGS_verbose );
5353
const geode::PointSetInspector< dimension > inspector{ pointset, verbose };
54-
const auto nb = inspector.nb_colocated_points();
54+
geode::index_t nb{ 0 };
55+
for( const auto& pt_group : inspector.colocated_points_groups() )
56+
{
57+
nb += pt_group.size();
58+
}
5559
geode::Logger::info( nb, " colocated points" );
5660
}
5761

0 commit comments

Comments
 (0)