Skip to content

Commit f7016b4

Browse files
fix: main axis of DFBeam computed such that the main axes are also the ones where we will have the most normals in the point cloud
1 parent adf1576 commit f7016b4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/gh/diffCheck/diffCheck/df_geometries.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ def __post_init__(self):
382382

383383
self._center: rg.Point3d = None
384384
self._axis: rg.Line = self.compute_axis()
385+
self.plane: rg.Plane = self.compute_plane()
385386
self._length: float = self._axis.Length
386387

387388
self.__uuid = uuid.uuid4().int
@@ -524,15 +525,16 @@ def compute_plane(self) -> rg.Plane:
524525
raise ValueError("The beam has no joints to compute a plane")
525526

526527
#main axis as defined above
527-
main_vector = self.compute_axis().Direction
528+
main_direction = self.compute_axis().Direction
528529

529530
#secondary axis as normal to the largest face of the beam
530531
largest_face = max(self.faces, key=lambda f: f.area)
531532
secondary_axis = largest_face.normal
532533
secondary_vector = rg.Vector3d(secondary_axis[0], secondary_axis[1], secondary_axis[2])
534+
first_vector = rg.Vector3d.CrossProduct(main_direction, secondary_vector)
533535
origin = self.center
534536

535-
return rg.Plane(origin, main_vector, secondary_vector)
537+
return rg.Plane(origin, first_vector, secondary_vector)
536538

537539
def compute_joint_distances_to_midpoint(self) -> typing.List[float]:
538540
"""

0 commit comments

Comments
 (0)