Skip to content

Commit ddcbf3c

Browse files
fix: discard null face normals in the pose estimation
1 parent 9e6eed5 commit ddcbf3c

File tree

1 file changed

+3
-0
lines changed
  • src/gh/components/DF_pose_estimation

1 file changed

+3
-0
lines changed

src/gh/components/DF_pose_estimation/code.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ def RunScript(self,
4242
df_face_cloud = df_cvt_bindings.cvt_rhcloud_2_dfcloud(face_cloud)
4343
df_cloud.add_points(df_face_cloud)
4444
plane_normal = df_face_cloud.fit_plane_ransac()
45+
if plane_normal == [0,0,0]:
46+
ghenv.Component.AddRuntimeMessage(RML.Warning, f"There was a missing face in the cloud of beam {i}: the face was skipped in the pose estimation of that beam") # noqa: F821
47+
continue
4548
rh_face_normals.append(Rhino.Geometry.Vector3d(plane_normal[0], plane_normal[1], plane_normal[2]))
4649

4750
df_bb_points = df_cloud.get_axis_aligned_bounding_box()

0 commit comments

Comments
 (0)