Skip to content

Commit 1dba340

Browse files
committed
WIP: working on wrap cad segmentator integration
1 parent b7cd47d commit 1dba340

File tree

3 files changed

+32
-9
lines changed

3 files changed

+32
-9
lines changed

src/diffCheckBindings.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,13 @@ PYBIND11_MODULE(diffcheck_bindings, m) {
179179
py::arg("knn_neighborhood_size") = 10,
180180
py::arg("radius_neighborhood_size") = 0.1,
181181
py::arg("color_clusters") = false)
182+
182183
.def_static("associate_clusters", &diffCheck::segmentation::DFSegmentation::AssociateClustersToMeshes,
183184
py::arg("reference_mesh"),
184185
py::arg("unassociated_clusters"),
185186
py::arg("angle_threshold") = 0.1,
186187
py::arg("association_threshold") = 0.1)
188+
187189
.def_static("clean_unassociated_clusters", &diffCheck::segmentation::DFSegmentation::CleanUnassociatedClusters,
188190
py::arg("unassociated_clusters"),
189191
py::arg("associated_clusters"),

src/gh/components/DF_CAD_segmentator/code.py

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
from diffCheck import df_cvt_bindings
1818

19+
import numpy as np
20+
1921

2022
class DFCADSegmentator(component):
2123
def RunScript(self,
@@ -37,18 +39,36 @@ def RunScript(self,
3739
df_clouds = [df_cvt_bindings.cvt_rhcloud_2_dfcloud(cloud) for cloud in i_clouds]
3840
# df_meshes = [df_cvt_bindings.cvt_rhmesh_2_dfmesh(mesh) for mesh in i_meshes]
3941

40-
# # get the point clouds corresponding to the beams
41-
# df_asssociated_clusters : List[dfCloud] = dfb_segmentation.DFSegmentation.associate_clusters(
42-
# reference_mesh=df_meshes,
43-
# unassociated_clusters=df_clouds,
44-
# angle_threshold=i_angle_threshold,
45-
# association_threshold=i_association_threshold
46-
# )
42+
df_beams = i_assembly.beams
43+
rh_beams_meshes = []
44+
for df_b in df_beams:
45+
#TODO: check this function to have a better triangluation of the mesh with the parameters
46+
rh_b_mesh_faces = [df_b_f.to_mesh() for df_b_f in df_b.side_faces]
47+
# rh_b_mesh_faces = [df_b_f.to_brep_face() for df_b_f in df_b.side_faces]
48+
49+
# df_b_mesh_faces = [df_cvt_bindings.cvt_rhmesh_2_dfmesh(rh_b_mesh_face) for rh_b_mesh_face in rh_b_mesh_faces]
50+
51+
52+
# _ = [rh_beams_meshes.append(m) for m in rh_b_mesh_faces]
53+
54+
for m in rh_b_mesh_faces:
55+
# print(type(m))
56+
rh_beams_meshes.append(m)
57+
58+
# # convert df_b_mesh_faces to numpy array
59+
# # get the point clouds corresponding to the beams
60+
# df_asssociated_clusters : List[dfCloud] = dfb_segmentation.DFSegmentation.associate_clusters(
61+
# reference_mesh=df_b_mesh_faces,
62+
# unassociated_clusters=df_clouds,
63+
# angle_threshold=i_angle_threshold,
64+
# association_threshold=i_association_threshold
65+
# )
4766

48-
print("test")
67+
# break
4968

69+
print("test2")
5070

51-
return o_clusters
71+
return rh_beams_meshes
5272

5373
if __name__ == "__main__":
5474
com = DFCADSegmentator()

src/gh/diffCheck/diffCheck.egg-info/SOURCES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ diffCheck/df_geometries.py
66
diffCheck/df_joint_detector.py
77
diffCheck/df_transformations.py
88
diffCheck/df_util.py
9+
diffCheck/diffcheck_bindings.cp39-win_amd64.pyd
910
diffCheck.egg-info/PKG-INFO
1011
diffCheck.egg-info/SOURCES.txt
1112
diffCheck.egg-info/dependency_links.txt

0 commit comments

Comments
 (0)