Skip to content

Commit

Permalink
geometry.py -> rename vec_dir to is_direction
Browse files Browse the repository at this point in the history
  • Loading branch information
jdegenstein authored Jun 23, 2024
1 parent f2d4dda commit 09a5ffd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/build123d/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,18 +465,18 @@ def to_dir(self) -> gp_Dir:
"""Convert to OCCT gp_Dir object"""
return gp_Dir(self.wrapped.XYZ())

def transform(self, affine_transform: Matrix, vec_dir: bool = True) -> Vector:
def transform(self, affine_transform: Matrix, is_direction: bool = False) -> Vector:
"""Apply affine transformation
Args:
affine_transform (Matrix): affine transformation matrix
vec_dir (bool, optional): Should self be transformed as a vector or direction?
Defaults to True (Vector)
is_direction (bool, optional): Should self be transformed as a vector or direction?
Defaults to False (vector)
Returns:
Vector: transformed vector
"""
if vec_dir:
if not is_direction:
# to gp_Pnt to obey build123d transformation convention (in OCP.vectors do not translate)
pnt = self.to_pnt()
pnt_t = pnt.Transformed(affine_transform.wrapped.Trsf())
Expand Down

0 comments on commit 09a5ffd

Please sign in to comment.