WorkingPlane Namespace Reference

This module handles the Working Plane and grid of the Draft module. More...

Classes

class  Plane
 

Functions

def getPlacementFromFace (face, rotated=False)
 
def getPlacementFromPoints (points)
 

Variables

 DraftGeomUtils = lz.LazyLoader("DraftGeomUtils", globals(), "DraftGeomUtils")
 
 FreeCADGui = lz.LazyLoader("FreeCADGui", globals(), "FreeCADGui")
 
 Part = lz.LazyLoader("Part", globals(), "Part")
 
 plane = Plane
 

Detailed Description

This module handles the Working Plane and grid of the Draft module.

This module provides the plane class which provides a virtual working plane in FreeCAD and a couple of utility functions.

Function Documentation

◆ getPlacementFromFace()

def WorkingPlane.getPlacementFromFace (   face,
  rotated = False 
)
Return a placement from a face.

It creates a temporary `plane` and uses `alignToFace(face)`
to set its orientation.

Then it returns the `Base::Placement` returned
from `plane.getPlacement(rotated)`.

Parameter
---------
face : Part.Face
    A shape of type `'Face'`.
rotated : bool, optional
    It defaults to `False`. If it is `True`, the temporary plane
    switches `axis` with `-v` to produce a rotated placement.

Returns
-------
Base::Placement
    A placement obtained from the temporary plane
    defined by `face`,
    or `None` if it fails to use `face`.

See Also
--------
alignToFace, getPlacement

References plane.

Referenced by ArchWindow.recolorize().

◆ getPlacementFromPoints()

def WorkingPlane.getPlacementFromPoints (   points)
Return a placement from a list of 3 or 4 points.

With these points a temporary `plane` is defined.

Then it returns the `Base::Placement` returned from `plane.getPlacement()`.

Parameters
----------
points : list of Base::Vector3
    A list with 3 or 4 points to create a temporary plane
    from which to extract the placement.

    The first point is the plane's `position`.
    The other two points are used to define the `u` and `v` axes,
    as originating from the first point.

    If the fourth point exists, it is used to define the plane's `axis`
    as originating from the first point.
    If no fourth point is provided, the cross product bewtween
    the previously defined `u` and `v` is used as `axis`.

Return
------
Base::Placement
    A placement obtained from the temporary plane
    defined by `points`,
    or `None` is it fails to use the points.

See Also
--------
getPlacement

References plane.

Referenced by draftguitools.gui_trackers.boxTracker.update().

Variable Documentation

◆ DraftGeomUtils

WorkingPlane.DraftGeomUtils = lz.LazyLoader("DraftGeomUtils", globals(), "DraftGeomUtils")

◆ FreeCADGui

WorkingPlane.FreeCADGui = lz.LazyLoader("FreeCADGui", globals(), "FreeCADGui")

◆ Part

WorkingPlane.Part = lz.LazyLoader("Part", globals(), "Part")

◆ plane