Skip to content

Commit 8c54bc5

Browse files
fix: create DFBeam base plane with coherent orientation with plane detection on point cloud side
1 parent 5beaaaf commit 8c54bc5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/gh/diffCheck/diffCheck/df_geometries.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,9 @@ def compute_plane(self) -> rg.Plane:
525525
df_faces = [face for face in self.faces]
526526
sorted_df_faces = sorted(df_faces, key=lambda face: Rhino.Geometry.AreaMassProperties.Compute(face._rh_brepface).Area if face._rh_brepface else 0, reverse=True)
527527
largest_side_face_normal = sorted_df_faces[0].normal
528+
rh_largest_side_face_normal = rg.Vector3d(largest_side_face_normal[0], largest_side_face_normal[1], largest_side_face_normal[2])
528529

529-
return rg.Plane(self.center, beam_direction, rg.Vector3d(largest_side_face_normal[0], largest_side_face_normal[1], largest_side_face_normal[2]))
530+
return rg.Plane(self.center, rg.Vector3d.CrossProduct(beam_direction, rh_largest_side_face_normal), rh_largest_side_face_normal)
530531

531532
def compute_joint_distances_to_midpoint(self) -> typing.List[float]:
532533
"""

0 commit comments

Comments
 (0)