FreeCAD Python
|
A WorkPlane object
Public Member Functions | |
def | offsetToPoint (self, p, direction=None) |
def | projectPoint (self, p, direction=None) |
def | projectPointOld (self, p, direction=None) |
def | alignToSelection (self, offset) |
def | setup (self, direction=None, point=None, upvec=None) |
def WorkingPlane.plane.alignToSelection | ( | self, | |
offset | |||
) |
If selection uniquely defines a plane, align working plane to it. Return success (bool)
def WorkingPlane.plane.offsetToPoint | ( | self, | |
p, | |||
direction = None |
|||
) |
Return the signed distance from p to the plane, such that p + offsetToPoint(p)*direction lies on the plane. direction defaults to -plane.axis
A picture will help explain the computation: p //| / / | / / | / / | / / | -------------------- plane -----c-----x-----a-------- Here p is the specified point, c is a point (in this case plane.position) on the plane x is the intercept on the plane from p in the specified direction, and a is the perpendicular intercept on the plane (i.e. along plane.axis) Using vertival bars to denote the length operator, |ap| = |cp| * cos(apc) = |xp| * cos(apx) so |xp| = |cp| * cos(apc) / cos(apx) = (cp . axis) / (direction . axis)
def WorkingPlane.plane.projectPoint | ( | self, | |
p, | |||
direction = None |
|||
) |
project point onto plane, default direction is orthogonal
def WorkingPlane.plane.projectPointOld | ( | self, | |
p, | |||
direction = None |
|||
) |
project point onto plane, default direction is orthogonal. Obsolete
def WorkingPlane.plane.setup | ( | self, | |
direction = None , |
|||
point = None , |
|||
upvec = None |
|||
) |
If working plane is undefined, define it!