@@ -419,7 +419,7 @@ def __setstate__(self, state: typing.Dict):
419
419
if "_center" in state and state ["_center" ] is not None :
420
420
state ["_center" ] = rg .Point3d .FromJSON (state ["_center" ])
421
421
if "_axis" in state and state ["_axis" ] is not None :
422
- state ["_axis" ] = rg .Vector3d .FromJSON (state ["_axis" ])
422
+ state ["_axis" ] = rg .Line .FromJSON (state ["_axis" ])
423
423
self .__dict__ .update (state )
424
424
425
425
def __repr__ (self ):
@@ -428,13 +428,12 @@ def __repr__(self):
428
428
def deepcopy (self ):
429
429
return DFBeam (self .name , [face .deepcopy () for face in self .faces ])
430
430
431
- def compute_axis (self , is_unitized : bool = True ) -> rg .Vector3d :
431
+ def compute_axis (self , is_unitized : bool = True ) -> rg .Line :
432
432
"""
433
- This is an utility function that computes the axis of the beam.
433
+ This is an utility function that computes the axis of the beam as a line .
434
434
The axis is calculated as the vector passing through the two most distance joint's centroids.
435
435
436
- :param is_unitized: If True, the beam's axis is unitized
437
- :return axis: The axis of the beam
436
+ :return axis: The axis of the beam as a line
438
437
"""
439
438
joints = self .joints
440
439
joint1 = joints [0 ]
@@ -451,15 +450,12 @@ def compute_axis(self, is_unitized: bool = True) -> rg.Vector3d:
451
450
joint1 = j1
452
451
joint2 = j2
453
452
454
- axis = rg .Vector3d (
453
+ axis_ln = rg .Line (
455
454
joint1 .center .to_rg_point3d (),
456
455
joint2 .center .to_rg_point3d ()
457
456
)
458
457
459
- if is_unitized :
460
- axis .Unitize ()
461
-
462
- return axis
458
+ return axis_ln
463
459
464
460
@classmethod
465
461
def from_brep_face (cls , brep , is_roundwood = False ):
0 commit comments