splinepy.spline.Spline#

class splinepy.spline.Spline(spline=None, **kwargs)[source]#

Bases: SplinepyBase, PySpline

Spline base class. Extends PySpline with documentation.

Generally, all types of splines can be seen as mappings from a \(N_{param}\)-dimensional parametric domain \(\Omega_{param} \subset \mathbb{R}^{N_{param}}\) to a \(N_{phys}\)-dimensional physical domain \(\Omega_{phys} \subset \mathbb{R}^{N_{phys}}\), i.e.,

\[M : \Omega_{param} \to \Omega_{phys}\]

splinepy generally supports different combinations of embeddings, that is different combinations of dimensionalities \(N_{param}\) and \(N_{phys}\), up to dimension 10. The supported spline types differ in the way how the spline function \(M\) is defined. For an overview of the mathematical theories for the different types of supported splines, we refer to the documentation of the classes BSplineBase and BezierBase for a more in-depth discussion of the theory on B-Spline/Bezier families, as well as to their children BSpline, NURBS, Bezier, and RationalBezier for usage examples.

Parameters:
  • spline (Spline) – Initialize using another spline. Will SHARE core spline.

  • degrees ((para_dim,) array-like) – Keyword only parameter.

  • knot_vectors ((para_dim, n) list of array-like) – Keyword only parameter.

  • control_points ((m, dim) array-like) – Keyword only parameter.

  • weights ((m,) array-like) – Keyword only parameter.

Return type:

None

Methods

Spline.basis(queries[, nthreads])

Returns basis function values on the supports of given queries.

Spline.basis_and_support(queries[, nthreads])

Returns basis function values and their support ids of given queries.

Spline.basis_derivative(queries, orders[, ...])

Returns derivative of basis functions evaluated on the supports of given queries.

Spline.basis_derivative_and_support(queries, ...)

Returns derivative of basis functions and their support ids of given queries.

Spline.clear()

Clears core spline and saved data

Spline.copy([saved_data])

Returns deepcopy of stored data and newly initialized self.

Spline.current_core_properties(self)

Spline.derivative(queries, orders[, nthreads])

Evaluates derivatives of spline.

Spline.elevate_degrees(parametric_dimensions)

Elevate degree.

Spline.evaluate(queries[, nthreads])

Evaluates spline.

Spline.export(fname)

Export spline.

Spline.greville_abscissae([duplicate_tolerance])

Returns greville abscissae.

Spline.jacobian(queries[, nthreads])

Evaluates jacobians on spline.

Spline.mapper(reference)

Retrieve a mapper that can be used to get physical derivatives such as a gradient or hessian in physical space

Spline.proximities(queries[, ...])

Given physical coordinate, finds a parametric coordinate that maps to the nearest physical coordinate.

Spline.reduce_degrees(parametric_dimensions)

Tries to reduce degree.

Spline.sample(resolutions[, nthreads])

Uniformly sample along each parametric dimensions from spline.

Spline.show(**kwargs)

Equivalent to

Spline.showable(**kwargs)

Equivalent to

Spline.support(queries[, nthreads])

Returns basis support ids of given queries.

Spline.todict([tolist])

Return current spline as dict.

Attributes

Spline.check

Returns spline checker.

Spline.control_mesh_resolutions

Returns control mesh resolutions.

Spline.control_point_bounds

Returns bounds of control points.

Spline.control_points

Returns control points.

Spline.cps

Returns control points.

Spline.create

Returns spline creator Can be used to create new splines using geometric relations.

Spline.degrees

Returns Degrees.

Spline.dim

Returns physical dimension.

Spline.ds

Returns Degrees.

Spline.extract

Returns spline extractor.

Spline.has_knot_vectors

Returns True iff spline has knot vectors.

Spline.integrate

Returns spline integrator.

Spline.is_rational

Returns True iff spline is rational.

Spline.knot_multiplicities

Returns knot multiplicities.

Spline.knot_vectors

Returns knot vectors.

Spline.kvs

Returns knot vectors.

Spline.multi_index

Easy control point / weights access using (unraveled) multi index.

Spline.name

Name of the spline provided by cpp side as a str.

Spline.para_dim

Returns parametric dimension.

Spline.parametric_bounds

Returns bounds of parametric_space.

Spline.required_properties

Returns required property of current spline.

Spline.show_options

Show option manager for splines.

Spline.spline_data

Spline data helper for splines.

Spline.unique_knots

Returns unique knots.

Spline.weights

Returns weights.

Spline.whatami

Answers a deep philosophical question of "what am i?"

Spline.ws

Returns weights.