VS:CreateNurbsSurface

From Vectorworks Developer
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Creates a new NURBS surface in the document. The surface has two directions, denoted u and v. The surface acts like a set of NURBS curves in each direction, with the number of control points and the degree specified in the parameter list. (Note that the degree parameters have to be lower than the numPts parameters.)

After creating the surface, you must set the location of each of the control points with NurbsSetPt3D, and when you are done call ResetBBox to make sure the bounding box is correct.

FUNCTION CreateNurbsSurface(
numUPts :LONGINT;
numVPts :LONGINT;
uDegree :INTEGER;
vDegree :INTEGER) : HANDLE;
def vs.CreateNurbsSurface(numUPts, numVPts, uDegree, vDegree):
    return HANDLE

Parameters

numUPts LONGINT The number of definition points along the u-axis of the surface.
numVPts LONGINT The number of definition points along the v-axis of the surface.
uDegree INTEGER Degree of the NURBS curve in the u direction.
vDegree INTEGER Degree of the NURBS curve in the v direction.

Return Value

Returns a HANDLE to the newly created NURBS surface object if successful, otherwise returns NIL.

Remarks

returns a handle to the newly created NURBS surface if it succeeds, return NULL if it fails

Creates a NURBS surface with the number of control points and degrees as specified. Call NurbsSetPt3D() to set the control net

Example

VectorScript

PROCEDURE Example;
VAR
h :HANDLE;
BEGIN
h := CreateNurbsSurface(3, 3, 1, 1);
NurbsSetPt3D(h, 0, 0, 0, 0, 0);
NurbsSetPt3D(h, 0, 1, 1, 0, 0);
NurbsSetPt3D(h, 0, 2, 2, 0, 0);
NurbsSetPt3D(h, 1, 0, 0, 1, 0);
NurbsSetPt3D(h, 1, 1, 1, 1, 1);
NurbsSetPt3D(h, 1, 2, 2, 1, 0);
NurbsSetPt3D(h, 2, 0, 0, 2, 0);
NurbsSetPt3D(h, 2, 1, 1, 2, 0);
NurbsSetPt3D(h, 2, 2, 2, 2, 0);
ResetBBox(h);
END;
RUN(Example);

Python

def Example():
	h = vs.CreateNurbsSurface(3, 3, 1, 1)
	vs.NurbsSetPt3D(h, 0, 0, 0, 0, 0)
	vs.NurbsSetPt3D(h, 0, 1, 1, 0, 0)
	vs.NurbsSetPt3D(h, 0, 2, 2, 0, 0)
	vs.NurbsSetPt3D(h, 1, 0, 0, 1, 0)
	vs.NurbsSetPt3D(h, 1, 1, 1, 1, 1)
	vs.NurbsSetPt3D(h, 1, 2, 2, 1, 0)
	vs.NurbsSetPt3D(h, 2, 0, 0, 2, 0)
	vs.NurbsSetPt3D(h, 2, 1, 1, 2, 0)
	vs.NurbsSetPt3D(h, 2, 2, 2, 2, 0)
	vs.ResetBBox(h)
Example()

Version

Availability: from VectorWorks9.0

See Also

VS Functions:

VS:NurbsSurfaceEvalPt

VS Functions: [[VS:NurbsSurfaceEvalPt]]