Create a spline interpolated through the provided points (2D or 3D). :param listOfXYTuple: points to interpolate through :param tangents: vectors specifying the direction of the tangent to the curve at each of the specified interpolation points. If
(
self: T,
listOfXYTuple: Iterable[VectorLike],
tangents: Optional[Sequence[VectorLike]] = None,
periodic: bool = False,
parameters: Optional[Sequence[float]] = None,
scale: bool = True,
tol: Optional[float] = None,
forConstruction: bool = False,
includeCurrent: bool = False,
makeWire: bool = False,
)
| 1783 | return allPoints |
| 1784 | |
| 1785 | def spline( |
| 1786 | self: T, |
| 1787 | listOfXYTuple: Iterable[VectorLike], |
| 1788 | tangents: Optional[Sequence[VectorLike]] = None, |
| 1789 | periodic: bool = False, |
| 1790 | parameters: Optional[Sequence[float]] = None, |
| 1791 | scale: bool = True, |
| 1792 | tol: Optional[float] = None, |
| 1793 | forConstruction: bool = False, |
| 1794 | includeCurrent: bool = False, |
| 1795 | makeWire: bool = False, |
| 1796 | ) -> T: |
| 1797 | """ |
| 1798 | Create a spline interpolated through the provided points (2D or 3D). |
| 1799 | |
| 1800 | :param listOfXYTuple: points to interpolate through |
| 1801 | :param tangents: vectors specifying the direction of the tangent to the |
| 1802 | curve at each of the specified interpolation points. |
| 1803 | |
| 1804 | If only 2 tangents are given, they will be used as the initial and |
| 1805 | final tangent. |
| 1806 | |
| 1807 | If some tangents are not specified (i.e., are None), no tangent |
| 1808 | constraint will be applied to the corresponding interpolation point. |
| 1809 | |
| 1810 | The spline will be C2 continuous at the interpolation points where |
| 1811 | no tangent constraint is specified, and C1 continuous at the points |
| 1812 | where a tangent constraint is specified. |
| 1813 | :param periodic: creation of periodic curves |
| 1814 | :param parameters: the value of the parameter at each interpolation point. |
| 1815 | (The interpolated curve is represented as a vector-valued function of a |
| 1816 | scalar parameter.) |
| 1817 | |
| 1818 | If periodic == True, then len(parameters) must be |
| 1819 | len(interpolation points) + 1, otherwise len(parameters) must be equal to |
| 1820 | len(interpolation points). |
| 1821 | :param scale: whether to scale the specified tangent vectors before |
| 1822 | interpolating. |
| 1823 | |
| 1824 | Each tangent is scaled, so it's length is equal to the derivative of |
| 1825 | the Lagrange interpolated curve. |
| 1826 | |
| 1827 | I.e., set this to True, if you want to use only the direction of |
| 1828 | the tangent vectors specified by ``tangents``, but not their magnitude. |
| 1829 | :param tol: tolerance of the algorithm (consult OCC documentation) |
| 1830 | |
| 1831 | Used to check that the specified points are not too close to each |
| 1832 | other, and that tangent vectors are not too short. (In either case |
| 1833 | interpolation may fail.) |
| 1834 | |
| 1835 | Set to None to use the default tolerance. |
| 1836 | :param includeCurrent: use current point as a starting point of the curve |
| 1837 | :param makeWire: convert the resulting spline edge to a wire |
| 1838 | :return: a Workplane object with the current point at the end of the spline |
| 1839 | |
| 1840 | The spline will begin at the current point, and end with the last point in the |
| 1841 | XY tuple list. |
| 1842 |