Skip to content

Commit

Permalink
Draft: WorkingPlane, Pythonic style, added whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
vocx-fc authored and yorikvanhavre committed Aug 9, 2019
1 parent 1161cbb commit 15b11b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Mod/Draft/WorkingPlane.py
Expand Up @@ -145,7 +145,8 @@ def alignToPointAndAxis(self, point, axis, offset=0, upvec=None):
self.v = axis.cross(Vector(1, 0, 0))
self.v.normalize()
self.u = DraftVecUtils.rotate(self.v, -math.pi/2, self.axis)
offsetVector = Vector(axis); offsetVector.multiply(offset)
offsetVector = Vector(axis)
offsetVector.multiply(offset)
self.position = point.add(offsetVector)
self.weak = False
# FreeCAD.Console.PrintMessage("(position = " + str(self.position) + ")\n")
Expand Down Expand Up @@ -475,6 +476,7 @@ def getDeviation(self):
norm = proj.cross(self.u)
return DraftVecUtils.angle(self.u, proj, norm)


def getPlacementFromPoints(points):
"returns a placement from a list of 3 or 4 vectors"
pl = plane()
Expand All @@ -492,6 +494,7 @@ def getPlacementFromPoints(points):
del pl
return p


def getPlacementFromFace(face, rotated=False):
"returns a placement from a face"
pl = plane()
Expand Down

0 comments on commit 15b11b8

Please sign in to comment.