Skip to content

Commit 7c3b907

Browse files
committed
fix(PythonTopologyInspector): Added previously defined functions to the python API (unique vertices in models not linked to a component mesh vertex).
1 parent 8e8ecc4 commit 7c3b907

File tree

5 files changed

+30
-3
lines changed

5 files changed

+30
-3
lines changed

bindings/python/src/inspector/topology/brep_topology.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
.def( "brep_meshed_components_are_linked_to_a_unique_vertex", \
3636
&BRepTopologyInspector:: \
3737
brep_meshed_components_are_linked_to_a_unique_vertex ) \
38+
.def( "brep_unique_vertices_are_linked_to_a_component_vertex", \
39+
&BRepTopologyInspector:: \
40+
brep_unique_vertices_are_linked_to_a_component_vertex ) \
3841
.def( "nb_corners_not_linked_to_a_unique_vertex", \
3942
&BRepTopologyInspector::nb_corners_not_linked_to_a_unique_vertex ) \
4043
.def( "nb_lines_meshed_but_not_linked_to_a_unique_vertex", \
@@ -46,6 +49,12 @@
4649
.def( "nb_blocks_meshed_but_not_linked_to_a_unique_vertex", \
4750
&BRepTopologyInspector:: \
4851
nb_blocks_meshed_but_not_linked_to_a_unique_vertex ) \
52+
.def( "nb_unique_vertices_not_linked_to_a_component_vertex", \
53+
&BRepTopologyInspector:: \
54+
nb_unique_vertices_not_linked_to_a_component_vertex ) \
55+
.def( "unique_vertices_not_linked_to_a_component_vertex", \
56+
&BRepTopologyInspector:: \
57+
unique_vertices_not_linked_to_a_component_vertex ) \
4958
.def( "invalid_components_topology_unique_vertices", \
5059
&BRepTopologyInspector:: \
5160
invalid_components_topology_unique_vertices ) \

bindings/python/src/inspector/topology/section_topology.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
.def( "section_meshed_components_are_linked_to_a_unique_vertex", \
3636
&SectionTopologyInspector:: \
3737
section_meshed_components_are_linked_to_a_unique_vertex ) \
38+
.def( "section_unique_vertices_are_linked_to_a_component_vertex", \
39+
&SectionTopologyInspector:: \
40+
section_unique_vertices_are_linked_to_a_component_vertex ) \
3841
.def( "nb_corners_not_linked_to_a_unique_vertex", \
3942
&SectionTopologyInspector:: \
4043
nb_corners_not_linked_to_a_unique_vertex ) \
@@ -44,6 +47,12 @@
4447
.def( "nb_surfaces_meshed_but_not_linked_to_a_unique_vertex", \
4548
&SectionTopologyInspector:: \
4649
nb_surfaces_meshed_but_not_linked_to_a_unique_vertex ) \
50+
.def( "nb_unique_vertices_not_linked_to_a_component_vertex", \
51+
&SectionTopologyInspector:: \
52+
nb_unique_vertices_not_linked_to_a_component_vertex ) \
53+
.def( "unique_vertices_not_linked_to_a_component_vertex", \
54+
&SectionTopologyInspector:: \
55+
unique_vertices_not_linked_to_a_component_vertex ) \
4756
.def( "invalid_components_topology_unique_vertices", \
4857
&SectionTopologyInspector:: \
4958
invalid_components_topology_unique_vertices ) \

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ def check_components_linking(brep_inspector):
4444
nb_unlinked_blocks = brep_inspector.nb_blocks_meshed_but_not_linked_to_a_unique_vertex()
4545
print("There are ", nb_unlinked_blocks,
4646
" blocks meshed but not linked to a unique vertex.")
47-
return nb_unlinked_blocks + nb_unlinked_surfaces + nb_unlinked_lines + nb_unlinked_corners
47+
nb_unlinked_uv = brep_inspector.nb_unique_vertices_not_linked_to_a_component_vertex()
48+
print( "There are ", nb_unlinked_uv, " unique vertices not linked to a component mesh vertex." )
49+
return nb_unlinked_blocks + nb_unlinked_surfaces + nb_unlinked_lines + nb_unlinked_corners + nb_unlinked_uv
4850

4951

5052
def check_unique_vertices_colocation(brep_inspector):

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ def check_components_linking(section_inspector):
4040
nb_unlinked_surfaces = section_inspector.nb_surfaces_meshed_but_not_linked_to_a_unique_vertex()
4141
print("There are ", nb_unlinked_surfaces,
4242
" surfaces meshed but not linked to a unique vertex.")
43-
return nb_unlinked_corners + nb_unlinked_lines + nb_unlinked_surfaces
43+
nb_unlinked_uv = section_inspector.nb_unique_vertices_not_linked_to_a_component_vertex()
44+
print( "There are ", nb_unlinked_uv, " unique vertices not linked to a component mesh vertex." )
45+
return nb_unlinked_corners + nb_unlinked_lines + nb_unlinked_surfaces + nb_unlinked_uv
4446

4547

4648
def check_unique_vertices_colocation(section_inspector):

tests/inspector/test-section.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ geode::index_t check_components_linking(
5353
.nb_surfaces_meshed_but_not_linked_to_a_unique_vertex();
5454
geode::Logger::info( "There are ", nb_unlinked_surfaces,
5555
" surfaces not linked to a unique vertex." );
56-
return nb_unlinked_corners + nb_unlinked_lines + nb_unlinked_surfaces;
56+
const auto nb_unlinked_uv =
57+
section_inspector.nb_unique_vertices_not_linked_to_a_component_vertex();
58+
geode::Logger::info( "There are ", nb_unlinked_uv,
59+
" unique vertices not linked to a component mesh vertex." );
60+
return nb_unlinked_corners + nb_unlinked_lines + nb_unlinked_surfaces
61+
+ nb_unlinked_uv;
5762
}
5863

5964
geode::index_t check_unique_vertices_colocation(

0 commit comments

Comments
 (0)