r3nurbs

r3nurbs

Class

real/objects/r3nurbs.h

Library

r3obj

Description:

NURBS (Non-Uniform Rational B-Spline) curve.

See Also

real/objects/r3prim.h

See Also

oops/r3vect.h oops/r3vect.h real/3d/r3nulib.h

Super Class

r3Primitive

R3CLID_PRIMITIVE

JavaScript

r3Nurbs

Class Identifier

R3CLID_NURBS - 130

Methods

CONCATENATE, SHARPEN, BREAK, INSERTKNOT, TOBEZIER, ELEVATEDEGREE, CUTHEAD, CUTTAIL, SWAPDIRECTION, CHANGEWEIGHTS, CHANGEORDER, INSERTKNOTARRAY, INTERPOLATE, UNIFY, OPEN, SETSTART, PARALLELCURVE, ADDTOSHRINK, PREPARESHRINK, SHRINK, FREESHRINK, INSERTCTRLPOINT, SETPOINT4, GETPOINT4, SETKNOT, GETKNOT, SETPOINTLOCAL, GETPOINTLOCAL, SHRINKISINSIDE, MEASURELENGTH, DISTRIBUTEEVENLY, SIMPLIFY,

Attributes

Count, Order, Knots, Points, KnotCount, Points3, Closed, InParentsParamSpace, DefaultTool, Parametrization, Diameter1, Diameter2, Ends, ScanLineQuality, Min, Max, DiameterChannel, RenderRaytrace, RenderScanline, MaxDisplacement, RenderPostProc, DrawKnots,

Registration

int R3RegisterNurbsClass(R3APP *app);

R3NUM_CONCATENATE

Method

CONCATENATE

Identifier

R3NUM_CONCATENATE

Return

R3BOOL, TRUE if concatenation succeeded.

Param 1:

R3BOOL, TRUE to autoconcatenate, FALSE to fixed order

Param 3:

R3OBJ**, null terminated array of objects to be concatenated

JavaScript

rc = obj.CONCATENATE(p1, p3);

Description

Concatenates given curves to itself. If the 'p1' is TRUE, fixed order concatenation is applied. if 'p1' is false, the order is is determined from the distances between the end points of the curves. Note: this method ignores all 'closed' curves.

R3NUM_SHARPEN

Method

SHARPEN

Identifier

R3NUM_SHARPEN

JavaScript

obj.SHARPEN();

Description

Make the curve 'sharp' at given parameter value by increasing the multiplicity of the given knot value. The shape of the curve remains unchanged.

R3NUM_BREAK

Method

BREAK

Identifier

R3NUM_BREAK

JavaScript

obj.BREAK();

Description

Break the curve selected point(s).

R3NUM_INSERTKNOT

Method

INSERTKNOT

Identifier

R3NUM_INSERTKNOT

Return

R3BOOL, true if knot was succesfully inserted. FALSE if failed.

Param 1:

R3BOOL, if true, parameter value 'p3' is local, if FALSE, 'p3' is global

Param 3:

R3FLOAT, parameter value

JavaScript

rc = obj.INSERTKNOT(p1, p3);

Description

Insert new knot to a curve. The shape of the curve is not changed.

R3NUM_TOBEZIER

Method

TOBEZIER

Identifier

R3NUM_TOBEZIER

JavaScript

obj.TOBEZIER();

Description

Convert the nurbs to bezier curve without changing the shape.

R3NUM_ELEVATEDEGREE

Method

ELEVATEDEGREE

Identifier

R3NUM_ELEVATEDEGREE

Return

R3BOOL, true if succeeded.

JavaScript

rc = obj.ELEVATEDEGREE();

Description

Elevate the degree of the curve. The shape of the curve remains unchanged.

R3NUM_CUTHEAD

Method

CUTHEAD

Identifier

R3NUM_CUTHEAD

Return

R3BOOL, true if succeeded.

JavaScript

rc = obj.CUTHEAD();

Description

Cut off the head of the curve at the given parameter value.

R3NUM_CUTTAIL

Method

CUTTAIL

Identifier

R3NUM_CUTTAIL

Return

R3BOOL, true if succeeded.

JavaScript

rc = obj.CUTTAIL();

Description

Cut off the tail of the curve at the given parameter value.

R3NUM_SWAPDIRECTION

Method

SWAPDIRECTION

Identifier

R3NUM_SWAPDIRECTION

Return

R3BOOL, true if succeeded

JavaScript

rc = obj.SWAPDIRECTION();

Description

Changes the direction of the curve.

R3NUM_CHANGEWEIGHTS

Method

CHANGEWEIGHTS

Identifier

R3NUM_CHANGEWEIGHTS

Param 1:

R3BOOL, if true, p3 translates the current weight. Otherwise p3 is taken as new absolute weight for the selected points.

Param 3:

R3FLOAT, abs/rel weight

JavaScript

obj.CHANGEWEIGHTS(p1, p3);

Description

Tranlate the weights of the selected control points.

R3NUM_CHANGEORDER

Method

CHANGEORDER

Identifier

R3NUM_CHANGEORDER

Return

R3BOOL, true of succeeded. FALSE if the curve order cannot be changed

Param 3:

R3INT, defines how much the curve order is increased/decreased. Positive values increase the order. Negative decrease.

JavaScript

rc = obj.CHANGEORDER(p3);

Description

Raise/drop the order of the curve. The shape of the curve doesn't remain the same.

R3NUM_INSERTKNOTARRAY

Method

INSERTKNOTARRAY

Identifier

R3NUM_INSERTKNOTARRAY

Return

R3BOOL, true if succeeded.

Param 1:

R3INT, number of knots

Param 3:

R3FLOAT, knots to be inserted.

JavaScript

rc = obj.INSERTKNOTARRAY(p1, p3);

Description

Inserts knots in the given array.

R3NUM_INTERPOLATE

Method

INTERPOLATE

Identifier

R3NUM_INTERPOLATE

JavaScript

obj.INTERPOLATE();

Description

Add two extra points to the curve (if curve is open) and run inversion so that the curve passes through its all original control points.

R3NUCM_UNIFY

Method

UNIFY

Identifier

R3NUCM_UNIFY

Return

R3BOOL, true if succeeded

Param 3:

R3OBJ**, null terminated array of curves

JavaScript

rc = obj.UNIFY(p3);

Description

Make the order, knot sequence and point count of the give nurbs curves the same. The operation doesn't change the shape of the curves. If all curves are closed, resulting curve is closed, if one of the curves is open, all resulting curves are opened.

R3NUM_OPEN

Method

OPEN

Identifier

R3NUM_OPEN

Return

R3BOOL, True if curve was succesfully opened.

Param 3:

R3BOOL, if true, resulting curve ends have multiplicity

JavaScript

rc = obj.OPEN(p3);

Description

Open the given closed curve. The shape of the curve is not changed.

R3NUM_SETSTART

Method

SETSTART

Identifier

R3NUM_SETSTART

Return

R3BOOL, true if succeeded.

JavaScript

rc = obj.SETSTART();

Description

Set start point (u = 0) for closed curve (translate parameter space 'p3' -> 0.0). The shape of the curve is not changed.

R3NUM_PARALLELCURVE

Method

PARALLELCURVE

Identifier

R3NUM_PARALLELCURVE

Return

R3OBJ*, parallel curve

Param 1:

R3VECTOR, normal

Param 3:

R3FLOAT, displacement. Positive value creates bigger parallel curve, negative shrunk curve.

JavaScript

rc = obj.PARALLELCURVE(p1, p3);

Description

Create parallel curve

R3NUM_ADDTOSHRINK

Method

ADDTOSHRINK

Identifier

R3NUM_ADDTOSHRINK

Return

R3BOOL, true if succeeded

Param 2:

R3VECTOR, normal

Param 3:

R3LIST, list for prepared curves

JavaScript

rc = obj.ADDTOSHRINK(0, p2, p3);

Description

Prepare curve for shrink operation.

R3NUCM_PREPARESHRINK

Method

PREPARESHRINK

Identifier

R3NUCM_PREPARESHRINK

Return

R3BOOL, true if succeeded

Param 1:

R3LIST, curves to be shrunk

Param 3:

R3BOOL, bevel out

JavaScript

rc = obj.PREPARESHRINK(p1, p3);

Description

Class message: Prepare all curves for shrink operation

R3NUCM_SHRINK

Method

SHRINK

Identifier

R3NUCM_SHRINK

Return

R3BOOL, true if succeeded

Param 1:

R3LIST, curves to be shrunk

Param 3:

R3FLOAT, radius

JavaScript

rc = obj.SHRINK(p1, p3);

Description

Class message: Shrink curves

R3NUCM_FREESHRINK

Method

FREESHRINK

Identifier

R3NUCM_FREESHRINK

Param 3:

R3LIST, curve node list

JavaScript

obj.FREESHRINK(p3);

Description

Free shrunk curves

R3NUM_INSERTCTRLPOINT

Method

INSERTCTRLPOINT

Identifier

R3NUM_INSERTCTRLPOINT

Return

R3BOOL, true if succeeded

Param 1:

R3INT, index of the new point

Param 3:

R3VECTOR4, value for the new point

JavaScript

rc = obj.INSERTCTRLPOINT(p1, p3);

Description

Insert control point to a curve

R3NUM_SETPOINT4

Method

SETPOINT4

Identifier

R3NUM_SETPOINT4

Return

R3BOOL, true if succeeded

Param 1:

R3INT, index of the point to be set

Param 3:

R3VECTOR4, new value for the point

JavaScript

rc = obj.SETPOINT4(p1, p3);

Description

Set control point

R3NUM_GETPOINT4

Method

GETPOINT4

Identifier

R3NUM_GETPOINT4

Return

R3BOOL, true if succeeded

Param 1:

R3VECTOR4, value for the point

Param 3:

R3INT, index of the point to be fetched

JavaScript

rc = obj.GETPOINT4(p1, p3);

Description

Fetch control point

R3NUM_SETKNOT

Method

SETKNOT

Identifier

R3NUM_SETKNOT

Return

R3BOOL, true if succeeded

Param 1:

R3INT, index of the point to be fetched

Param 3:

R3FLOAT, buffer

JavaScript

rc = obj.SETKNOT(p1, p3);

Description

Set knot value by index

R3NUM_GETKNOT

Method

GETKNOT

Identifier

R3NUM_GETKNOT

Return

R3BOOL, true if succeeded

Param 1:

R3FLOAT, knot value

Param 3:

R3INT, index

JavaScript

rc = obj.GETKNOT(p1, p3);

Description

Fetch knot value by index

R3NUM_SETPOINTLOCAL

Method

SETPOINTLOCAL

Identifier

R3NUM_SETPOINTLOCAL

Return

R3BOOL, true if succeeded

Param 1:

R3INT, index

Param 3:

R3VECTOR4, point

JavaScript

rc = obj.SETPOINTLOCAL(p1, p3);

Description

Low level set point method. The point is given in object space. * The method doesn't generate R3MM_CHANGED nor call R3TTM_CHANGENIMATEDTAG.

R3NUM_GETPOINTLOCAL

Method

GETPOINTLOCAL

Identifier

R3NUM_GETPOINTLOCAL

Return

R3BOOL, true if succeeded

Param 1:

R3INT, index

Param 3:

R3VECTOR4, point

JavaScript

rc = obj.GETPOINTLOCAL(p1, p3);

Description

Get point in object space

R3NUCM_SHRINKISINSIDE

Method

SHRINKISINSIDE

Identifier

R3NUCM_SHRINKISINSIDE

Return

R3BOOL, true if is inside

JavaScript

rc = obj.SHRINKISINSIDE();

Description

Class message: Test if R3CURVENODE *p1 is inside R3CURVENODE *p3. R3NUCM_PREPARESHRINK must be called prior this operation.

R3NUM_MEASURELENGTH

Method

MEASURELENGTH

Identifier

R3NUM_MEASURELENGTH

Param 3:

R3FLOAT, address of result value

JavaScript

obj.MEASURELENGTH(p3);

Description

measure lenght of curve

R3NUM_DISTRIBUTEEVENLY

Method

DISTRIBUTEEVENLY

Identifier

R3NUM_DISTRIBUTEEVENLY

JavaScript

obj.DISTRIBUTEEVENLY();

Description

Adjust points so that each curve segment is equally long. The operation sets parametrization to uniform and usually changes curve shape slightly.

R3NUM_SIMPLIFY

Method

SIMPLIFY

Identifier

R3NUM_SIMPLIFY

JavaScript

obj.SIMPLIFY();

Description

Simplify the curve by removing points with minimal * impact to the curve shape.

Count

Attribute

Count

Identifier

R3NUA_Count

JavaScript type

Integer

C type

R3INT

Description

number of control points

Syntax


jsobj.SetCount(value);
value = jsobj.GetCount();


R3INT value = ...;
R3SetAttrs(r3obj, R3NUA_Count, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3NUA_Count, &value, R3TAG_END);

Order

Attribute

Order

Identifier

R3NUA_Order

JavaScript type

Integer

C type

R3INT

Description

degree + 1, must be: order <= number of control points

Syntax


jsobj.SetOrder(value);
value = jsobj.GetOrder();


R3INT value = ...;
R3SetAttrs(r3obj, R3NUA_Order, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3NUA_Order, &value, R3TAG_END);

Knots

Attribute

Knots

Identifier

R3NUA_Knots

JavaScript type

Number

C type

R3FLOAT*

Description

array of knot values. If closed, number of knots == _Count, otherwise _Count+order

Syntax


jsobj.SetKnots(value);
value = jsobj.GetKnots();


R3FLOAT* value = ...;
R3SetAttrs(r3obj, R3NUA_Knots, value, R3TAG_END);
R3FLOAT* value;
R3GetAttrs(r3obj, R3NUA_Knots, &value, R3TAG_END);

Points

Attribute

Points

Identifier

R3NUA_Points

Type

r3Vect4

Description

array of control points

Syntax


jsobj.SetPoints(value);
value = jsobj.GetPoints();


R3VECTOR4* value = ...;
R3SetAttrs(r3obj, R3NUA_Points, value, R3TAG_END);
R3VECTOR4* value;
R3GetAttrs(r3obj, R3NUA_Points, &value, R3TAG_END);

KnotCount

Attribute

KnotCount

Identifier

R3NUA_KnotCount

JavaScript type

Integer

C type

R3INT

Description

NOTE: read only

Syntax


value = jsobj.GetKnotCount();


R3INT value;
R3GetAttrs(r3obj, R3NUA_KnotCount, &value, R3TAG_END);

Points3

Attribute

Points3

Identifier

R3NUA_Points3

Type

r3Vect

Description

set 3d vectors

Syntax


jsobj.SetPoints3(value);
value = jsobj.GetPoints3();


R3VECTOR* value = ...;
R3SetAttrs(r3obj, R3NUA_Points3, value, R3TAG_END);
R3VECTOR* value;
R3GetAttrs(r3obj, R3NUA_Points3, &value, R3TAG_END);

Closed

Attribute

Closed

Identifier

R3NUA_Closed

JavaScript type

Boolean

C type

R3BOOL

Description

if true closed, otherwse open curve

Syntax


jsobj.SetClosed(value);
value = jsobj.GetClosed();


R3BOOL value = ...;
R3SetAttrs(r3obj, R3NUA_Closed, value, R3TAG_END);
R3BOOL value;
R3GetAttrs(r3obj, R3NUA_Closed, &value, R3TAG_END);

InParentsParamSpace

Attribute

InParentsParamSpace

Identifier

R3NUA_InParentsParamSpace

JavaScript type

Boolean

C type

R3BOOL

Description

points defined there, like in a trim curve

Syntax


jsobj.SetInParentsParamSpace(value);
value = jsobj.GetInParentsParamSpace();


R3BOOL value = ...;
R3SetAttrs(r3obj, R3NUA_InParentsParamSpace, value, R3TAG_END);
R3BOOL value;
R3GetAttrs(r3obj, R3NUA_InParentsParamSpace, &value, R3TAG_END);

DefaultTool

Attribute

DefaultTool

Identifier

R3NUA_DefaultTool

JavaScript type

Integer

C type

R3INT

Description

what happens when the user applies 'move point', see codes below

Syntax


jsobj.SetDefaultTool(value);
value = jsobj.GetDefaultTool();


R3INT value = ...;
R3SetAttrs(r3obj, R3NUA_DefaultTool, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3NUA_DefaultTool, &value, R3TAG_END);

Parametrization

Attribute

Parametrization

Identifier

R3NUA_Parametrization

JavaScript type

Integer

C type

R3INT

Description

see parametrization codes in r3nulib.h

Syntax


jsobj.SetParametrization(value);
value = jsobj.GetParametrization();


R3INT value = ...;
R3SetAttrs(r3obj, R3NUA_Parametrization, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3NUA_Parametrization, &value, R3TAG_END);

Diameter1

Attribute

Diameter1

Identifier

R3NUA_Diameter1

JavaScript type

Number

C type

R3FLOAT

Description

diameter for rendering

Syntax


jsobj.SetDiameter1(value);
value = jsobj.GetDiameter1();


R3FLOAT value = ...;
R3SetAttrs(r3obj, R3NUA_Diameter1, value, R3TAG_END);
R3FLOAT value;
R3GetAttrs(r3obj, R3NUA_Diameter1, &value, R3TAG_END);

Diameter2

Attribute

Diameter2

Identifier

R3NUA_Diameter2

JavaScript type

Number

C type

R3FLOAT

Description

diameter

Syntax


jsobj.SetDiameter2(value);
value = jsobj.GetDiameter2();


R3FLOAT value = ...;
R3SetAttrs(r3obj, R3NUA_Diameter2, value, R3TAG_END);
R3FLOAT value;
R3GetAttrs(r3obj, R3NUA_Diameter2, &value, R3TAG_END);

Ends

Attribute

Ends

Identifier

R3NUA_Ends

JavaScript type

Integer

C type

R3INT

Description

see end knot codes below

Syntax


jsobj.SetEnds(value);
value = jsobj.GetEnds();


R3INT value = ...;
R3SetAttrs(r3obj, R3NUA_Ends, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3NUA_Ends, &value, R3TAG_END);

ScanLineQuality

Attribute

ScanLineQuality

Identifier

R3NUA_ScanLineQuality

JavaScript type

Integer

C type

R3INT

Description

lines per interval

Syntax


jsobj.SetScanLineQuality(value);
value = jsobj.GetScanLineQuality();


R3INT value = ...;
R3SetAttrs(r3obj, R3NUA_ScanLineQuality, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3NUA_ScanLineQuality, &value, R3TAG_END);

Min

Attribute

Min

Identifier

R3NUA_Min

JavaScript type

Number

C type

R3FLOAT

Description

minimum evaluation parameter value

Syntax


jsobj.SetMin(value);
value = jsobj.GetMin();


R3FLOAT value = ...;
R3SetAttrs(r3obj, R3NUA_Min, value, R3TAG_END);
R3FLOAT value;
R3GetAttrs(r3obj, R3NUA_Min, &value, R3TAG_END);

Max

Attribute

Max

Identifier

R3NUA_Max

JavaScript type

Number

C type

R3FLOAT

Description

maximum evaluation parameter value

Syntax


jsobj.SetMax(value);
value = jsobj.GetMax();


R3FLOAT value = ...;
R3SetAttrs(r3obj, R3NUA_Max, value, R3TAG_END);
R3FLOAT value;
R3GetAttrs(r3obj, R3NUA_Max, &value, R3TAG_END);

DiameterChannel

Attribute

DiameterChannel

Identifier

R3NUA_DiameterChannel

JavaScript type

String

C type

char*

Description

name of channel that defines diameter in scanline rendering

Syntax


jsobj.SetDiameterChannel(value);
value = jsobj.GetDiameterChannel();


char* value = ...;
R3SetAttrs(r3obj, R3NUA_DiameterChannel, value, R3TAG_END);
char* value;
R3GetAttrs(r3obj, R3NUA_DiameterChannel, &value, R3TAG_END);

RenderRaytrace

Attribute

RenderRaytrace

Identifier

R3NUA_RenderRaytrace

JavaScript type

Boolean

C type

R3BOOL

Description

enables raytraced rendering

Syntax


jsobj.SetRenderRaytrace(value);
value = jsobj.GetRenderRaytrace();


R3BOOL value = ...;
R3SetAttrs(r3obj, R3NUA_RenderRaytrace, value, R3TAG_END);
R3BOOL value;
R3GetAttrs(r3obj, R3NUA_RenderRaytrace, &value, R3TAG_END);

RenderScanline

Attribute

RenderScanline

Identifier

R3NUA_RenderScanline

JavaScript type

Boolean

C type

R3BOOL

Description

enables scanline rendering

Syntax


jsobj.SetRenderScanline(value);
value = jsobj.GetRenderScanline();


R3BOOL value = ...;
R3SetAttrs(r3obj, R3NUA_RenderScanline, value, R3TAG_END);
R3BOOL value;
R3GetAttrs(r3obj, R3NUA_RenderScanline, &value, R3TAG_END);

MaxDisplacement

Attribute

MaxDisplacement

Identifier

R3NUA_MaxDisplacement

JavaScript type

Number

C type

R3FLOAT

Description

max. sum of ray tracing time radius + position displacement

Syntax


jsobj.SetMaxDisplacement(value);
value = jsobj.GetMaxDisplacement();


R3FLOAT value = ...;
R3SetAttrs(r3obj, R3NUA_MaxDisplacement, value, R3TAG_END);
R3FLOAT value;
R3GetAttrs(r3obj, R3NUA_MaxDisplacement, &value, R3TAG_END);

RenderPostProc

Attribute

RenderPostProc

Identifier

R3NUA_RenderPostProc

JavaScript type

Boolean

C type

R3BOOL

Description

enables postpr rendering

Syntax


jsobj.SetRenderPostProc(value);
value = jsobj.GetRenderPostProc();


R3BOOL value = ...;
R3SetAttrs(r3obj, R3NUA_RenderPostProc, value, R3TAG_END);
R3BOOL value;
R3GetAttrs(r3obj, R3NUA_RenderPostProc, &value, R3TAG_END);

DrawKnots

Attribute

DrawKnots

Identifier

R3NUA_DrawKnots

JavaScript type

Boolean

C type

R3BOOL

Description

draw knots

Syntax


jsobj.SetDrawKnots(value);
value = jsobj.GetDrawKnots();


R3BOOL value = ...;
R3SetAttrs(r3obj, R3NUA_DrawKnots, value, R3TAG_END);
R3BOOL value;
R3GetAttrs(r3obj, R3NUA_DrawKnots, &value, R3TAG_END);

Handle Types

R3NUHT_CONTROLPOINT
R3NUHT_KNOTPOINT

Default tools

R3NUT_MOVE
R3NUT_WEIGHT
R3NUT_INVERSEKINEMATICS

end condition codes for the parametrization

R3NUE_PHANTOM
R3NUE_MAXMULTIPLICITY

currently rendering engine specific optimizations limit max order to 6

R3NUMAXORDER

Local csys

The actual points

The shrinked/expanded curve

true if this curve defines a hole

Inside test handle

Registry function