1616
1717from diffCheck import df_cvt_bindings
1818
19+ import numpy as np
20+
1921
2022class 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
5373if __name__ == "__main__" :
5474 com = DFCADSegmentator ()
0 commit comments