NurbsCurveEvaluator

from panda3d.core import NurbsCurveEvaluator
class NurbsCurveEvaluator

Bases: ReferenceCount

This class is an abstraction for evaluating NURBS curves. It accepts an array of vertices, each of which may be in a different coordinate space (as defined by a NodePath), as well as an optional knot vector.

This is not related to NurbsCurve, CubicCurveseg or any of the ParametricCurve-derived objects in this module. It is a completely parallel implementation of NURBS curves, and will probably eventually replace the whole ParametricCurve class hierarchy.

Inheritance diagram

Inheritance diagram of NurbsCurveEvaluator

__init__(*args, **kwargs)
evaluate()

C++ Interface: evaluate(NurbsCurveEvaluator self) evaluate(NurbsCurveEvaluator self, const NodePath rel_to) evaluate(NurbsCurveEvaluator self, const NodePath rel_to, const LMatrix4f mat)

/**
  • Returns a NurbsCurveResult object that represents the result of applying

  • the knots to all of the current values of the vertices, transformed into

  • the indicated coordinate space.

*/

/**
  • Returns a NurbsCurveResult object that represents the result of applying

  • the knots to all of the current values of the vertices, transformed into

  • the indicated coordinate space, and then further transformed by the

  • indicated matrix.

*/

getExtendedVertex()

C++ Interface: get_extended_vertex(NurbsCurveEvaluator self, int i, int d)

/**
  • Returns an n-dimensional vertex value. See set_extended_vertex(). This

  • returns the value set for the indicated dimension, or 0.0 if nothing has

  • been set.

*/

getKnot()

C++ Interface: get_knot(NurbsCurveEvaluator self, int i)

/**
  • Returns the value of the nth knot.

*/

getKnots()
getNumKnots()

C++ Interface: get_num_knots(NurbsCurveEvaluator self)

/**
  • Returns the number of knot values in the curve. This is based on the

  • number of vertices and the order.

*/

getNumSegments()

C++ Interface: get_num_segments(NurbsCurveEvaluator self)

/**
  • Returns the number of piecewise continuous segments in the curve. This is

  • based on the knot vector.

*/

getNumVertices()

C++ Interface: get_num_vertices(NurbsCurveEvaluator self)

/**
  • Returns the number of control vertices in the curve. This is the number

  • passed to the last call to reset().

*/

getOrder()

C++ Interface: get_order(NurbsCurveEvaluator self)

/**
  • Returns the order of the curve as set by a previous call to set_order().

*/

getVertex()

C++ Interface: get_vertex(NurbsCurveEvaluator self, int i) get_vertex(NurbsCurveEvaluator self, int i, const NodePath rel_to)

/**
  • Returns the nth control vertex of the curve, relative to its indicated

  • coordinate space.

*/

/**
  • Returns the nth control vertex of the curve, relative to the given

  • coordinate space.

*/

getVertexSpace()

C++ Interface: get_vertex_space(NurbsCurveEvaluator self, int i, const NodePath rel_to)

/**
  • Returns the coordinate space of the nth control vertex of the curve,

  • expressed as a NodePath.

*/

getVertices()
get_extended_vertex()

C++ Interface: get_extended_vertex(NurbsCurveEvaluator self, int i, int d)

/**
  • Returns an n-dimensional vertex value. See set_extended_vertex(). This

  • returns the value set for the indicated dimension, or 0.0 if nothing has

  • been set.

*/

get_knot()

C++ Interface: get_knot(NurbsCurveEvaluator self, int i)

/**
  • Returns the value of the nth knot.

*/

get_knots()
get_num_knots()

C++ Interface: get_num_knots(NurbsCurveEvaluator self)

/**
  • Returns the number of knot values in the curve. This is based on the

  • number of vertices and the order.

*/

get_num_segments()

C++ Interface: get_num_segments(NurbsCurveEvaluator self)

/**
  • Returns the number of piecewise continuous segments in the curve. This is

  • based on the knot vector.

*/

get_num_vertices()

C++ Interface: get_num_vertices(NurbsCurveEvaluator self)

/**
  • Returns the number of control vertices in the curve. This is the number

  • passed to the last call to reset().

*/

get_order()

C++ Interface: get_order(NurbsCurveEvaluator self)

/**
  • Returns the order of the curve as set by a previous call to set_order().

*/

get_vertex()

C++ Interface: get_vertex(NurbsCurveEvaluator self, int i) get_vertex(NurbsCurveEvaluator self, int i, const NodePath rel_to)

/**
  • Returns the nth control vertex of the curve, relative to its indicated

  • coordinate space.

*/

/**
  • Returns the nth control vertex of the curve, relative to the given

  • coordinate space.

*/

get_vertex_space()

C++ Interface: get_vertex_space(NurbsCurveEvaluator self, int i, const NodePath rel_to)

/**
  • Returns the coordinate space of the nth control vertex of the curve,

  • expressed as a NodePath.

*/

get_vertices()
normalizeKnots()

C++ Interface: normalize_knots(const NurbsCurveEvaluator self)

/**
  • Normalizes the knot sequence so that the parametric range of the curve is 0

*/

normalize_knots()

C++ Interface: normalize_knots(const NurbsCurveEvaluator self)

/**
  • Normalizes the knot sequence so that the parametric range of the curve is 0

*/

output()

C++ Interface: output(NurbsCurveEvaluator self, ostream out)

/**

*/

reset()

C++ Interface: reset(const NurbsCurveEvaluator self, int num_vertices)

/**
  • Resets all the vertices and knots to their default values, and sets the

  • curve up with the indicated number of vertices. You must then call

  • set_vertex() repeatedly to fill in all of the vertex values appropriately.

*/

setExtendedVertex()

C++ Interface: set_extended_vertex(const NurbsCurveEvaluator self, int i, int d, float value)

/**
  • Sets an n-dimensional vertex value. This allows definition of a NURBS

  • surface or curve in a sparse n-dimensional space, typically used for

  • associating additional properties (like color or joint membership) with

  • each vertex of a surface.

  • The value d is an arbitrary integer value and specifies the dimension of

  • question for this particular vertex. Any number of dimensions may be

  • specified, and they need not be consecutive. If a value for a given

  • dimension is not specified, is it implicitly 0.0.

  • The value is implicitly scaled by the homogenous weight value–that is, the

  • fourth component of the value passed to set_vertex(). This means the

  • ordinary vertex must be set first, before the extended vertices can be set.

*/

setExtendedVertices()

C++ Interface: set_extended_vertices(const NurbsCurveEvaluator self, int i, int d, buffer values, int num_values)

/**
  • Simultaneously sets several extended values in the slots d through (d +

  • num_values - 1) from the num_values elements of the indicated array. This

  • is equivalent to calling set_extended_vertex() num_values times. See

  • set_extended_vertex().

*/

setKnot()

C++ Interface: set_knot(const NurbsCurveEvaluator self, int i, float knot)

/**
  • Sets the value of the nth knot. Each knot value should be greater than or

  • equal to the preceding value. If no knot values are set, a default knot

  • vector is supplied.

*/

setOrder()

C++ Interface: set_order(const NurbsCurveEvaluator self, int order)

/**
  • Sets the order of the curve. This resets the knot vector to the default

  • knot vector for the number of vertices.

  • The order must be 1, 2, 3, or 4, and the value is one more than the degree

  • of the curve.

*/

setVertex()

C++ Interface: set_vertex(const NurbsCurveEvaluator self, int i, const LVecBase3f vertex, float weight) set_vertex(const NurbsCurveEvaluator self, int i, const LVecBase4f vertex)

/**
  • Sets the nth control vertex of the curve, as a vertex in 4-d homogeneous

  • space. In this form, the first three components of the vertex should

  • already have been scaled by the fourth component, which is the homogeneous

  • weight.

*/

/**
  • Sets the nth control vertex of the curve. This flavor sets the vertex as a

  • 3-d coordinate and a weight; the 3-d coordinate values are implicitly

  • scaled up by the weight factor.

*/

setVertexSpace()

C++ Interface: set_vertex_space(const NurbsCurveEvaluator self, int i, const NodePath space) set_vertex_space(const NurbsCurveEvaluator self, int i, str space)

/**
  • Sets the coordinate space of the nth control vertex. If this is not

  • specified, or is set to an empty NodePath, the nth control vertex is deemed

  • to be in the coordinate space passed to evaluate().

  • This specifies the space as a fixed NodePath, which is always the same

  • NodePath. Also see setting the space as a path string, which can specify a

  • different NodePath for different instances of the curve.

*/

/**
  • Sets the coordinate space of the nth control vertex. If this is not

  • specified, or is set to an empty string, the nth control vertex is deemed

  • to be in the coordinate space passed to evaluate().

  • This specifies the space as a string, which describes the path to find the

  • node relative to the rel_to NodePath when the curve is evaluated.

*/

set_extended_vertex()

C++ Interface: set_extended_vertex(const NurbsCurveEvaluator self, int i, int d, float value)

/**
  • Sets an n-dimensional vertex value. This allows definition of a NURBS

  • surface or curve in a sparse n-dimensional space, typically used for

  • associating additional properties (like color or joint membership) with

  • each vertex of a surface.

  • The value d is an arbitrary integer value and specifies the dimension of

  • question for this particular vertex. Any number of dimensions may be

  • specified, and they need not be consecutive. If a value for a given

  • dimension is not specified, is it implicitly 0.0.

  • The value is implicitly scaled by the homogenous weight value–that is, the

  • fourth component of the value passed to set_vertex(). This means the

  • ordinary vertex must be set first, before the extended vertices can be set.

*/

set_extended_vertices()

C++ Interface: set_extended_vertices(const NurbsCurveEvaluator self, int i, int d, buffer values, int num_values)

/**
  • Simultaneously sets several extended values in the slots d through (d +

  • num_values - 1) from the num_values elements of the indicated array. This

  • is equivalent to calling set_extended_vertex() num_values times. See

  • set_extended_vertex().

*/

set_knot()

C++ Interface: set_knot(const NurbsCurveEvaluator self, int i, float knot)

/**
  • Sets the value of the nth knot. Each knot value should be greater than or

  • equal to the preceding value. If no knot values are set, a default knot

  • vector is supplied.

*/

set_order()

C++ Interface: set_order(const NurbsCurveEvaluator self, int order)

/**
  • Sets the order of the curve. This resets the knot vector to the default

  • knot vector for the number of vertices.

  • The order must be 1, 2, 3, or 4, and the value is one more than the degree

  • of the curve.

*/

set_vertex()

C++ Interface: set_vertex(const NurbsCurveEvaluator self, int i, const LVecBase3f vertex, float weight) set_vertex(const NurbsCurveEvaluator self, int i, const LVecBase4f vertex)

/**
  • Sets the nth control vertex of the curve, as a vertex in 4-d homogeneous

  • space. In this form, the first three components of the vertex should

  • already have been scaled by the fourth component, which is the homogeneous

  • weight.

*/

/**
  • Sets the nth control vertex of the curve. This flavor sets the vertex as a

  • 3-d coordinate and a weight; the 3-d coordinate values are implicitly

  • scaled up by the weight factor.

*/

set_vertex_space()

C++ Interface: set_vertex_space(const NurbsCurveEvaluator self, int i, const NodePath space) set_vertex_space(const NurbsCurveEvaluator self, int i, str space)

/**
  • Sets the coordinate space of the nth control vertex. If this is not

  • specified, or is set to an empty NodePath, the nth control vertex is deemed

  • to be in the coordinate space passed to evaluate().

  • This specifies the space as a fixed NodePath, which is always the same

  • NodePath. Also see setting the space as a path string, which can specify a

  • different NodePath for different instances of the curve.

*/

/**
  • Sets the coordinate space of the nth control vertex. If this is not

  • specified, or is set to an empty string, the nth control vertex is deemed

  • to be in the coordinate space passed to evaluate().

  • This specifies the space as a string, which describes the path to find the

  • node relative to the rel_to NodePath when the curve is evaluated.

*/