Skip to content

Commit

Permalink
Draft: WorkingPlane, Pythonic style, improved the docstrings
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 cf430bf commit f13529d
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/Mod/Draft/WorkingPlane.py
Expand Up @@ -692,7 +692,18 @@ def reset(self):
self.weak = True

def getRotation(self):
"returns a placement describing the working plane orientation ONLY"
"""Return a placement describing the plane orientation only.
If `FreeCAD.GuiUp` is `True`, that is, if the graphical interface
is loaded, it will test if the active object is an `Arch` container
and will calculate the placement accordingly.
Returns
-------
Base::Placement
A placement, comprised of a basepoint `Base::Vector3`,
and a rotation `Base::Rotation`.
"""
m = DraftVecUtils.getPlaneRotation(self.u, self.v, self.axis)
p = FreeCAD.Placement(m)
# Arch active container
Expand All @@ -705,7 +716,14 @@ def getRotation(self):
return p

def getPlacement(self, rotated=False):
"returns the placement of the working plane"
"""Return the placement of the plane.
Parameters
----------
rotated : bool, optional
It defaults to `False`. If it is `True`, it switches `axis`
with `-v` to produce a rotated placement.
"""
if rotated:
m = FreeCAD.Matrix(
self.u.x, self.axis.x, -self.v.x, self.position.x,
Expand Down

0 comments on commit f13529d

Please sign in to comment.