Skip to content

Commit

Permalink
Merge pull request #511 from jdegenstein/plane_rounding
Browse files Browse the repository at this point in the history
Include rounding in Plane(face) and Plane(loc)
  • Loading branch information
jdegenstein authored Jan 30, 2024
2 parents 15a2b89 + f76b8aa commit 6e12787
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/build123d/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1828,15 +1828,19 @@ def optarg(kwargs, name, args, index, default):
BRep_Tool.Surface_s(arg_face.wrapped).Position().XDirection()
)
)
self.x_dir = Vector(round(i, 14) for i in self.x_dir)
self.z_dir = Plane.get_topods_face_normal(arg_face.wrapped)
self.z_dir = Vector(round(i, 14) for i in self.z_dir)
elif arg_location:
topo_face = BRepBuilderAPI_MakeFace(
Plane.XY.wrapped, -1.0, 1.0, -1.0, 1.0
).Face()
topo_face.Move(arg_location.wrapped)
self._origin = arg_location.position
self.x_dir = Vector(BRep_Tool.Surface_s(topo_face).Position().XDirection())
self.x_dir = Vector(round(i, 14) for i in self.x_dir)
self.z_dir = Plane.get_topods_face_normal(topo_face)
self.z_dir = Vector(round(i, 14) for i in self.z_dir)
elif arg_origin:
self._origin = Vector(arg_origin)
self.x_dir = Vector(arg_x_dir) if arg_x_dir else None
Expand Down

0 comments on commit 6e12787

Please sign in to comment.