NurbsSurface

Inheritance diagram of rumba.NurbsSurface
class NurbsSurface

A nurbs surface value.

This object is a standard nurbs surface. The control points are stored in u order first:cvar NurbsSurface default_value: Static. The default value.

Methods

__init__

Constructor(s)

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

Compute the surface closest point to p.

control_point(u, v)

Return a single control point.

control_points_u()

Return the number of control points in u.

control_points_v()

Return the number of control points in v.

degree_u()

Return the surface degree in u.

degree_v()

Return the surface degree in v.

evaluate(u, v)

Evaluate the surface at a uv coordinate.

evaluate_dp(u, v, previous_u, previous_v)

Evaluate the surface position derivatives at a uv coordinate.

iso_curve(u, use_v)

Extract an iso curve from the surface.

mode_u()

Return the surface degree in u.

mode_v()

Return the surface degree in v.

range_u()

Return the u parameter range.

range_v()

Return the v parameter range.

read_knots_u()

Return the readable surface knots in u.

read_knots_v()

Return the readable surface knots in v.

set_range_u(r)

Set the u parameter range.

set_range_v(r)

Set the v parameter range.

span_u()

Return the number of span in u.

span_v()

Return the number of span in v.

tessellate(subdivision_u, subdivision_v, ...)

Return a mesh out of the nurbs surface, with the uv and normals if requested.

write_knots_u()

Return the writable surface knots in u.

write_knots_v()

Return the writable surface knots in v.

Properties

default_value

class Mode

Members:

Periodic

Open

Closed

__init__()
__init__()

Constructor(s)

NurbsSurface ()

Create an empty surface.

NurbsSurface (v: Value)

Cast a Value in NurbsSurface.

If v is not a NurbsSurface object, this object will be an empty nurbs surface.

NurbsSurface (curves,degree_v: int,mode: Mode,use_u_direction: bool,uniform: bool)

Build a nurbs surface using nurbs curves (loft)

The curve must have the same degree and the same knots.

Parameters
  • curves - The curves to use to loft the surface

  • degree_v (int) - The degree of the second dimension

  • mode (Mode) - The mode of the second dimension

  • use_u_direction (bool) - If true, loft in the u direction

  • uniform (bool) - If true, use an uniform parametrization, if false, use a chord length paramatrization

NurbsSurface (curves,parameters,degree_v: int,mode: Mode,use_u_direction: bool)

Build a nurbs surface using nurbs curves (loft)

The curve must have the same degree and the same knots.

Parameters
  • curves - The curves to use to loft the surface

  • parameters - The parameters of each curve in the final surface. Same size than curves.

  • degree_v (int) - The degree of the second dimension

  • mode (Mode) - The mode of the second dimension

  • use_u_direction (bool) - If true, loft in the u direction

NurbsSurface (points: BufferConstV3f,knots_u: BufferConstFloat,knots_v: BufferConstFloat,degree_u: int,degree_v: int,mode_u: Mode,mode_v: Mode)

Build a surface.

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

Compute the surface closest point to p.

Returns the surface parameters of the closest point.

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

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

  • error (float) – Stop to iterate when (du < error*(u_max-umin) && dv < error*(v_max-vmin))

  • max_try (int) – Maximum number of iterations

  • cache (NurbsSurfaceClosestCache) – An optionnal cache

Return type

Imath.V2f

control_point(u: int, v: int) Imath.V3f

Return a single control point.

Return type

Imath.V3f

control_points_u() int

Return the number of control points in u.

Return type

int

control_points_v() int

Return the number of control points in v.

Return type

int

degree_u() int

Return the surface degree in u.

Return type

int

degree_v() int

Return the surface degree in v.

Return type

int

evaluate(u: float, v: float) Imath.V3f

Evaluate the surface at a uv coordinate.

Return type

Imath.V3f

evaluate(u: double,v: double) -> Imath.V3d

Evaluate the surface at a uv coordinate in double precision.

Return type

Imath.V3d

evaluate_dp(u: float, v: float, previous_u: bool, previous_v: bool)

Evaluate the surface position derivatives at a uv coordinate.

Return the (dp/du, dp,dv) vectors . They are not normalized.

iso_curve(u: float, use_v: bool) NurbsCurve

Extract an iso curve from the surface.

Extract the curve at the u parameter. If use_v is true, extact the curve in the V direction, else in the U direction.

Return type

NurbsCurve

mode_u() Mode

Return the surface degree in u.

Return type

Mode

mode_v() Mode

Return the surface degree in v.

Return type

Mode

range_u() Imath.V2f

Return the u parameter range.

Return type

Imath.V2f

range_v() Imath.V2f

Return the v parameter range.

Return type

Imath.V2f

read_knots_u() BufferConstFloat

Return the readable surface knots in u.

Return type

BufferConstFloat

read_knots_v() BufferConstFloat

Return the readable surface knots in v.

Return type

BufferConstFloat

set_range_u(r: Imath.V2f) None

Set the u parameter range.

set_range_v(r: Imath.V2f) None

Set the v parameter range.

span_u() int

Return the number of span in u.

Return type

int

span_v() int

Return the number of span in v.

Return type

int

tessellate(subdivision_u: int, subdivision_v: int, compute_uv_and_normals: bool) Mesh

Return a mesh out of the nurbs surface, with the uv and normals if requested.

Return type

Mesh

write_knots_u() BufferFloat

Return the writable surface knots in u.

Return type

BufferFloat

write_knots_v() BufferFloat

Return the writable surface knots in v.

Return type

BufferFloat