Skip to content

Commit 59a2a33

Browse files
feat: expose poses detected at segmentation step
1 parent f115187 commit 59a2a33

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

src/gh/components/DF_CAD_segmentator/code.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def RunScript(self,
4343
i_maximum_face_segment_distance = 0.1
4444

4545
o_face_clusters = []
46+
o_poses_from_icp = []
4647
transforms = []
4748
df_clusters = []
4849
# we make a deepcopy of the input clouds
@@ -88,6 +89,11 @@ def RunScript(self,
8889

8990
df_asssociated_cluster_faces_per_beam = []
9091
for i, df_b in enumerate(df_beams):
92+
beam_initial_pose = df_b.plane
93+
if beam_initial_pose.Transform(transforms[i]):
94+
beam_detected_pose = beam_initial_pose
95+
o_poses_from_icp.append(beam_detected_pose)
96+
9197
rh_b_mesh_faces = [df_b_f.to_mesh() for df_b_f in df_b.side_faces]
9298
rh_test_mesh = Rhino.Geometry.Mesh()
9399
for j in range(len(rh_b_mesh_faces)):
@@ -144,4 +150,4 @@ def RunScript(self,
144150

145151
o_face_clouds = th.list_to_tree(o_face_clusters)
146152

147-
return [o_beam_clouds, o_face_clouds]
153+
return [o_beam_clouds, o_face_clouds, o_poses_from_icp]

src/gh/components/DF_CAD_segmentator/metadata.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,14 @@
126126
"optional": false,
127127
"sourceCount": 0,
128128
"graft": false
129+
},
130+
{
131+
"name": "o_poses_from_icp",
132+
"nickname": "o_poses_from_icp",
133+
"description": "The list of poses resulting from the ICP registration. If i_make_registration is False, this output will be empty.",
134+
"optional": false,
135+
"sourceCount": 0,
136+
"graft": false
129137
}
130138
]
131139
}

0 commit comments

Comments
 (0)