From 3d1176053ffe1cb16f08fd249ed1e51873add8a1 Mon Sep 17 00:00:00 2001 From: Matt Ueckermann Date: Thu, 29 Apr 2021 16:54:46 -0400 Subject: [PATCH] Part [DOC]: Adding documentation to Python API of BSplineCurve (intersect and buildFromPoles) --- src/Mod/Part/App/BSplineCurvePy.xml | 17 +++++++++++++++++ src/Mod/Part/App/GeometryCurvePy.xml | 4 +++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/Mod/Part/App/BSplineCurvePy.xml b/src/Mod/Part/App/BSplineCurvePy.xml index 9924729e1c..32529fdff5 100644 --- a/src/Mod/Part/App/BSplineCurvePy.xml +++ b/src/Mod/Part/App/BSplineCurvePy.xml @@ -380,6 +380,23 @@ from the knots table of this B-Spline curve. Builds a B-Spline by a list of poles. + arguments: poles (sequence of Base.Vector), [periodic (default is False), degree (default is 3), interpolate (default is False)] + + Examples: + from FreeCAD import Base + import Part + V = Base.Vector + poles = [V(-2, 2, 0),V(0, 2, 1),V(2, 2, 0),V(2, -2, 0),V(0, -2, 1),V(-2, -2, 0)] + + # non-periodic spline + n=Part.BSplineCurve() + n.buildFromPoles(poles) + Part.show(n.toShape()) + + # periodic spline + n=Part.BSplineCurve() + n.buildFromPoles(poles, True) + Part.show(n.toShape()) diff --git a/src/Mod/Part/App/GeometryCurvePy.xml b/src/Mod/Part/App/GeometryCurvePy.xml index 6a76a796e6..f3862ddff4 100644 --- a/src/Mod/Part/App/GeometryCurvePy.xml +++ b/src/Mod/Part/App/GeometryCurvePy.xml @@ -91,7 +91,7 @@ length([uMin,uMax,Tol]) -> Float - Returns the parameter on the curve of a point at the given distance from a starting parameter. + Returns the parameter on the curve of a point at the given distance from a starting parameter. parameterAtDistance([abscissa, startingParameter]) -> Float the @@ -145,6 +145,8 @@ of the nearest orthogonal projection of the point. Returns all intersection points and curve segments between the curve and the curve/surface. + + arguments: curve/surface (for the intersection), precision (float)