NurbsCurve

Inheritance diagram of rumba.NurbsCurve
class NurbsCurve

A nurbs curve value.

This object is a standard nurbs curve with no other parameter than a position.:cvar NurbsCurve default_value: Static. The default value.

Methods

__init__

Constructor(s)

closest(p, r, error, max_try, cache)

Compute the curve closest point to p.

degree()

Return the curve degree.

evaluate(u)

Evaluate the curve at a u coordinate.

evaluate_dp(u)

Evaluate the curve position derivatives at a u coordinate.

length(error)

Compute the curve length.

mode()

Return the curve degree.

range()

Return the curve parameter visible range.

read_knots()

Return the readable curve knots.

read_weights()

Return the readable control points weights.

resample(knots, degree)

Resample a curve.

reverse()

Reverse the control point order.

span()

Return the number of span.

write_knots()

Return the writable curve knots.

write_weights()

Return the writable control points weights.

Properties

default_value

class Mode

Members:

Periodic

Open

Closed

__init__()
__init__()

Constructor(s)

NurbsCurve ()

Create an empty curve.

NurbsCurve (points: BufferConstV3f,knots: BufferConstFloat,degree: int,mode: Mode)

Create a curve.

NurbsCurve (v: Value)

Cast a Value in NurbsCurve.

If v is not a NurbsCurve object, this object will be an empty curve.

closest(p: Imath.V3f, r: Imath.V3f, error: float, max_try: int, cache) float

Compute the curve closest point to p.

Returns the curve parameter value of the closest point. To speedup many closest queries on the same curve, it is possible to provide a cache of the subdivided curve. The subdivision must be done from start=knots[degree] to end=knots[knots.size()-degree-1] using a uniform parameter step. The default subdivision step count is 6*(knots.size()-degree*2).

Parameters
  • p (Imath.V3f) – The position to project on the curve

  • r (Imath.V3f) – If not null, it is filled with the closest curve position

  • error (float) – The minimum error in vertex space

  • max_try (int) – Maximum numbr of try

  • cache – An optionnal nurbs subdivision cache

Return type

float

degree() int

Return the curve degree.

Return type

int

evaluate(u: float) Imath.V3f

Evaluate the curve at a u coordinate.

Return type

Imath.V3f

evaluate(u: double) -> Imath.V3d

Evaluate the curve at a u coordinate in double precision.

Return type

Imath.V3d

evaluate_dp(u: float) Imath.V3f

Evaluate the curve position derivatives at a u coordinate.

Return the dp/du vector which may not be normalized.

Return type

Imath.V3f

length(error: float) float

Compute the curve length.

Parameters

error (float) – The relative accepted error of the result

Return type

float

length(start: float,end: float,error: float) -> float

Compute the curve length between the start and end u parameters.

Parameters
  • start (float) – The starting u parameter of the arc

  • end (float) – The ending u parameter of the arc

  • error (float) – The relative accepted error of the result

Return type

float

length(error: float) -> float

Compute the curve length.

Parameters

error (float) – The relative accepted error of the result

Return type

float

length(start: float,end: float,error: float) -> float

Compute the curve length between the start and end u parameters.

Parameters
  • start (float) – The starting u parameter of the arc

  • end (float) – The ending u parameter of the arc

  • error (float) – The relative accepted error of the result

Return type

float

mode() Mode

Return the curve degree.

Return type

Mode

range() Imath.V2f

Return the curve parameter visible range.

For periodic curves, this is not the same than the first and last knots.

Return type

Imath.V2f

read_knots() BufferConstFloat

Return the readable curve knots.

Return type

BufferConstFloat

read_weights() BufferConstFloat

Return the readable control points weights.

Return type

BufferConstFloat

resample(knots, degree: int) None

Resample a curve.

Modify the curve knots and degree and rebuild the curve in order to keep its shape if possible.

reverse() None

Reverse the control point order.

span() int

Return the number of span.

Return type

int

write_knots() BufferFloat

Return the writable curve knots.

Return type

BufferFloat

write_weights() BufferFloat

Return the writable control points weights.

Return type

BufferFloat