From 12ef13e5f7a8dbef37e09c319f91ac453e5a5b6e Mon Sep 17 00:00:00 2001 From: vocx-fc Date: Thu, 8 Aug 2019 23:35:58 -0500 Subject: [PATCH] Draft: WorkingPlane, Pythonic style, improved the docstrings --- src/Mod/Draft/WorkingPlane.py | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/Mod/Draft/WorkingPlane.py b/src/Mod/Draft/WorkingPlane.py index e57ad79853..afb7df30ff 100644 --- a/src/Mod/Draft/WorkingPlane.py +++ b/src/Mod/Draft/WorkingPlane.py @@ -1119,7 +1119,32 @@ class plane: def getPlacementFromPoints(points): - "returns a placement from a list of 3 or 4 vectors" + """Return a placement from a list of 3 or 4 points. + + With these points a temporary plane is defined. + 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`. + + Then it returns the `Base::Placement` returned from `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. + + Return + ------ + Base::Placement + A placement obtained from the temporary plane + defined by the points. + """ pl = plane() try: pl.position = points[0]