@@ -419,7 +419,7 @@ def __setstate__(self, state: typing.Dict):
419419 if "_center" in state and state ["_center" ] is not None :
420420 state ["_center" ] = rg .Point3d .FromJSON (state ["_center" ])
421421 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" ])
423423 self .__dict__ .update (state )
424424
425425 def __repr__ (self ):
@@ -428,13 +428,12 @@ def __repr__(self):
428428 def deepcopy (self ):
429429 return DFBeam (self .name , [face .deepcopy () for face in self .faces ])
430430
431- def compute_axis (self , is_unitized : bool = True ) -> rg .Vector3d :
431+ def compute_axis (self , is_unitized : bool = True ) -> rg .Line :
432432 """
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 .
434434 The axis is calculated as the vector passing through the two most distance joint's centroids.
435435
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
438437 """
439438 joints = self .joints
440439 joint1 = joints [0 ]
@@ -451,15 +450,12 @@ def compute_axis(self, is_unitized: bool = True) -> rg.Vector3d:
451450 joint1 = j1
452451 joint2 = j2
453452
454- axis = rg .Vector3d (
453+ axis_ln = rg .Line (
455454 joint1 .center .to_rg_point3d (),
456455 joint2 .center .to_rg_point3d ()
457456 )
458457
459- if is_unitized :
460- axis .Unitize ()
461-
462- return axis
458+ return axis_ln
463459
464460 @classmethod
465461 def from_brep_face (cls , brep , is_roundwood = False ):
0 commit comments