10.1.4.14. Spline

Module to implement Spline curve.

For resources on Spline curve see this section.

class Patro.GeometryEngine.Spline.BSpline2D(points, degree, closed=False, knots=None)[source]

Bases: Patro.GeometryEngine.Primitive.Primitive2DMixin, Patro.GeometryEngine.Primitive.PrimitiveNP

Class to implement a 2D B-Spline curve.

__init__(points, degree, closed=False, knots=None)[source]

Initialize self. See help(type(self)) for accurate signature.

_deboor(t)[source]

Compute point at t using De Boor algorithm

_naive_point_at_t(t)[source]

Compute point at t using a naive algorithm

basis_function(i, k, t)[source]

De Boor-Cox recursion formula

classmethod check_for_unifom_knots(degree, number_of_points, knots)[source]
degree
end_knot
insert_knot(t)[source]
is_closed

True if the primitive is a closed path.

Note: an infinite primitive cannot be closed.

knot_iter
knot_multiplicity(knot)[source]
knots
number_of_spans
order
point_at_t(t, naive=False)[source]
span(t)[source]
start_knot
to_bezier()[source]
to_bezier_form(degree=None)[source]
uniform
static uniform_knots(degree, number_of_points)[source]
class Patro.GeometryEngine.Spline.CubicUniformSpline2D(p0, p1, p2, p3)[source]

Bases: Patro.GeometryEngine.Primitive.Primitive2DMixin, Patro.GeometryEngine.Primitive.Primitive4P

Class to implements 2D Cubic Spline Curve.

BASIS = array([[ 0.16666667, -0.5 , 0.5 , -0.16666667], [ 0.66666667, 0. , -1. , 0.5 ], [ 0.16666667, 0.5 , 0.5 , -0.5 ], [ 0. , 0. , 0. , 0.16666667]])
INVERSE_BASIS = array([[ 1. , 1. , 1. , 1. ], [-1. , 0. , 1. , 2. ], [ 0.66666667, -0.33333333, 0.66666667, 3.66666667], [ 0. , 0. , 0. , 6. ]])
__init__(p0, p1, p2, p3)[source]

Initialize self. See help(type(self)) for accurate signature.

__repr__()[source]

Return repr(self).

point_at_t(t)[source]
to_bezier()[source]
class Patro.GeometryEngine.Spline.QuadraticUniformSpline2D(p0, p1, p2)[source]

Bases: Patro.GeometryEngine.Primitive.Primitive2DMixin, Patro.GeometryEngine.Primitive.Primitive3P

Class to implements 2D Quadratic Spline Curve.

BASIS = array([[ 1, -2, 1], [ 1, 2, -2], [ 0, 0, 1]])
INVERSE_BASIS = array([[-2, 1, -2], [-2, -3, 1], [-1, -1, -2]])
__init__(p0, p1, p2)[source]

Initialize self. See help(type(self)) for accurate signature.

__repr__()[source]

Return repr(self).

point_at_t(t)[source]
to_bezier()[source]