ConvertToNURBS Objects - NURBS 
VectorWorks10.0

VectorScript Declaration:

FUNCTION   ConvertToNURBS
(   h :HANDLE;
    keepOrig :BOOLEAN
) :HANDLE ;

Python:

def  vs.ConvertToNURBS(h, keepOrig):
   return HANDLE

Description:

This function converts the input object into a new NURBS object or a group of NURBS objects in the document.

Parameters:

h Handle of original object.
keepOrig Leave the original object in the drawing.

Example:

PROCEDURE Example;
VAR
	h :handle;
BEGIN
	CallTool(-204);
	h := FSActLayer;
	h := ConvertToNURBS(h, false);
	h := CreateOffsetNurbsObjectHandle(h, 1);
END;
RUN(Example);



  CreateInterpolatedSurface Objects - NURBS 
VectorWorks10.0

VectorScript Declaration:

FUNCTION   CreateInterpolatedSurface
(   surfaceHandle :HANDLE;
    numUPts :LONGINT;
    numVPts :LONGINT;
    uDegree :INTEGER;
    vDegree :INTEGER
) :HANDLE ;

Python:

def  vs.CreateInterpolatedSurface(surfaceHandle, numUPts, numVPts, uDegree, vDegree):
   return HANDLE

Description:

Creates an interpolated surface with the specified degrees and number of points. The resulting surface passes through each of the interpoliation points. If a handle to a NURBS surface is provided, the interpolated surface will approximate that surface. If the handle is NULL, it creates a rectangular surface.

Parameters:

surfaceHandle Handle to a NURBS surface to approximate
numUPts Number of interpolation points in the U parametric direction. Must be greater than uDegree.
numVPts Number of interpolation points in the V parametric direction. Must be greater than vDegree.
uDegree Degree of the surface in the u parametric direction
vDegree Degree of the surface in the v parametric direction

Result:

Handle to the new interpolated surface object.



  CreateLoftSurfaces Objects - NURBS 
VectorWorks10.0

VectorScript Declaration:

FUNCTION   CreateLoftSurfaces
(   groupCurvesHd :HANDLE;
    bRule :BOOLEAN;
    bClose :BOOLEAN;
    bSolid :BOOLEAN
) :HANDLE ;

Python:

def  vs.CreateLoftSurfaces(groupCurvesHd, bRule, bClose, bSolid):
   return HANDLE

Description:

Creates NURBS surfaces by interpolating a group of cross-section curves. The nurbs curves are lofted in the order in which they were added to the group.

Example:

PROCEDURE Example;
VAR
	h, groupHand :HANDLE;
	bRule, bClose, bSolid :BOOLEAN;
BEGIN
	BeginGroup;

	h := CreateNurbsCurve(-PLENGTH/2, 0, 0, true, 1);
	AddVertex3D(h, -PLENGTH/2,PHEIGHT,0);
	AddVertex3D(h, PLENGTH/2,PHEIGHT,0);
	AddVertex3D(h, PLENGTH/2,0,0);

	h := CreateNurbsCurve(-PLENGTH/2-POFFSET,0,pWidth, true, 1);
	AddVertex3D(h, -PLENGTH/2-POFFSET, PHEIGHT+POFFSET, pWidth);
	AddVertex3D(h, PLENGTH/2+POFFSET, PHEIGHT+POFFSET, pWidth);
	AddVertex3D(h, PLENGTH/2+POFFSET, 0, pWidth);

	EndGroup;
	groupHand := LNewObj;
	bRule := TRUE;
	bClose := FALSE;
	bSolid := FALSE;
	groupHand := CreateLoftSurfaces(groupHand, bRule, bClose, bSolid);
	SetRot3D(LNewObj,#90d,#0d,#0d,0,0,0);
END;
RUN(Example);



  CreateNurbsCurve Objects - NURBS 
VectorWorks9.0

VectorScript Declaration:

FUNCTION   CreateNurbsCurve
(   firstX :REAL;
    firstY :REAL;
    firstZ :REAL;
    byCtrlPts :BOOLEAN;
    degree :INTEGER
) :HANDLE ;

Python:

def  vs.CreateNurbsCurve(first, byCtrlPts, degree):
   return HANDLE

Description:

Creates a new NURBS curve in the document.

Parameters:

first Coordinates of the first point in the curve definiton.
byCtrlPts Create curve by control points (not interpolation).
degree The degree of the NURBS curve.

Result:

Returns a HANDLE to the new NURBS curve if successful, otherwise returns NIL.

Example:

PROCEDURE NewNurbsCurve;
VAR
	nC :HANDLE;
BEGIN
	nC := CreateNurbsCurve(0, 0, 0, true, 2);
	AddVertex3D(nC, 1, 1, 0);
	AddVertex3D(nC, 2, 0, 0);
END;
RUN(NewNurbsCurve);



  CreateNurbsSurface Objects - NURBS 
VectorWorks9.0

VectorScript Declaration:

FUNCTION   CreateNurbsSurface
(   numUPts :LONGINT;
    numVPts :LONGINT;
    uDegree :INTEGER;
    vDegree :INTEGER
) :HANDLE ;

Python:

def  vs.CreateNurbsSurface(numUPts, numVPts, uDegree, vDegree):
   return HANDLE

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.

Parameters:

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

Result:

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

Example:

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);

See Also:

NurbsSurfaceEvalPt  



  CreateOffsetNurbsObjectHandle Objects - NURBS 
VectorWorks10.0

VectorScript Declaration:

FUNCTION   CreateOffsetNurbsObjectHandle
(   h :HANDLE;
    offsetDistance :REAL (Coordinate)
) :HANDLE ;

Python:

def  vs.CreateOffsetNurbsObjectHandle(h, offsetDistance):
   return HANDLE

Description:

Returns a handle to a NURBS object that is offset from the given NURBS object h by the offset distance.

Parameters:

h Handle to object.
offsetDistance Offset distance. Positive offsets outwards.

Example:

PROCEDURE Example;
VAR
	h :handle;
BEGIN
	CallTool(-204);
	h := FSActLayer;
	h := ConvertToNURBS(h, false);
	h := CreateOffsetNurbsObjectHandle(h, 1);
END;
RUN(Example);



  CreateSurfacefromCurvesNetwork Objects - NURBS 
VectorWorks10.0

VectorScript Declaration:

FUNCTION   CreateSurfacefromCurvesNetwork
:BOOLEAN ;

Python:

def  vs.CreateSurfacefromCurvesNetwork():
   return BOOLEAN

Description:

This function will create a NURBS surface from a network of selected intersecting curves in the document



  DrawNurbsObject Objects - NURBS 
VectorWorks10.0

VectorScript Declaration:

PROCEDURE   DrawNurbsObject
( h:HANDLE ) ;

Python:

def  vs.DrawNurbsObject(h):
   return None

Description:

Draws the NURBS object h on the screen.



  EvaluateNurbsSurfacePointAndNormal Objects - NURBS 
VectorWorks10.0

VectorScript Declaration:

FUNCTION   EvaluateNurbsSurfacePointAndNormal
(   surfaceHandle :HANDLE;
    u :REAL;
    v :REAL;
  VAR  pointX :REAL;
  VAR  pointY :REAL;
  VAR  pointZ :REAL;
  VAR  normalX :REAL;
  VAR  normalY :REAL;
  VAR  normalZ :REAL
) :BOOLEAN ;

Python:

def  vs.EvaluateNurbsSurfacePointAndNormal(surfaceHandle, u, v):
   return (BOOLEAN, point, normal)

Description:

Determines the point and normal on the NURBS surface at the given u/v value.

Parameters:

surfaceHandle Handle to NURBS surface being evaluated
u parameter value of the point on the surface being evaluated
v parameter value of the point on the surface being evaluated
point Coordinate of the point on the surface
normal normal vector of the surface computed at the point



  ExtendNurbsCurve Objects - NURBS 
VectorWorks10.0

VectorScript Declaration:

FUNCTION   ExtendNurbsCurve
(   curveHandle :HANDLE;
    distance :REAL;
    bStart :BOOLEAN;
    bLinear :BOOLEAN
) :HANDLE ;

Python:

def  vs.ExtendNurbsCurve(curveHandle, distance, bStart, bLinear):
   return HANDLE

Description:

Extends a curve by a given distance at the start or the end. The extension can either be linear or can match the curvature of the existing end.

Parameters:

curveHandle Handle to a NURBS curve
distance Distance to extend the curve
bStart True to extend the curve at the beginning, false to extend it at the end.
bLinear True for linear, false to match curvature of existing end.

Result:

Returns a handle to the extended curve.



  ExtendNurbsSurface Objects - NURBS 
VectorWorks10.0

VectorScript Declaration:

FUNCTION   ExtendNurbsSurface
(   surfaceHandle :HANDLE;
    distance :REAL;
    bStart :BOOLEAN;
    bLinear :BOOLEAN;
    bUDir :BOOLEAN
) :HANDLE ;

Python:

def  vs.ExtendNurbsSurface(surfaceHandle, distance, bStart, bLinear, bUDir):
   return HANDLE

Description:

Extends a surface by a given distance at the start or the end of the U direction or V direction.

Parameters:

surfaceHandle Handle to a NURBS surface.
distance Distance to extend the surface.
bStart True to extend from the beginning, false to extend from the end.
bLinear True for linear, false to match curvature of existing surface.
bUDir True extends the surface in the u parametric
direction, otherwise extends it in the v parametric direction.

Result:

Returns a handle to the extended surface



  GetNurbsObjectDistanceFromPoint Objects - NURBS 
VectorWorks10.0

VectorScript Declaration:

FUNCTION   GetNurbsObjectDistanceFromPoint
(   h :HANDLE;
    pointX :REAL;
    pointY :REAL;
  VAR  distance :REAL
) :BOOLEAN ;

Python:

def  vs.GetNurbsObjectDistanceFromPoint(h, point):
   return (BOOLEAN, distance)

Description:

Returns the distance from the input point to the input NURBS Object h.

Parameters:

h Handle to a NURBS object.
point point
distance Distance between point and object.



  GetParameterOnNurbsCurve Objects - NURBS 
VectorWorks10.0

VectorScript Declaration:

FUNCTION   GetParameterOnNurbsCurve
(   h :HANDLE;
    pointX :REAL;
    pointY :REAL;
    pointZ :REAL;
  VAR  parameter :REAL;
  VAR  index :LONGINT
) :BOOLEAN ;

Python:

def  vs.GetParameterOnNurbsCurve(h, point):
   return (BOOLEAN, parameter, index)

Description:

Given a NURBS curve handle and a point (in world space), this function returns the parameter of the point obtained by projecting the input point. The function also returns the index of the piece in the piecewise NURBS curve on which the projected point lies.



  GetPointAndParameterOnNurbsCurveAtGivenLength Objects - NURBS 
VectorWorks10.1

VectorScript Declaration:

FUNCTION   GetPointAndParameterOnNurbsCurveAtGivenLength
(   inNurbCurve :HANDLE;
    inPercentOfLength :REAL;
  VAR  pX :REAL;
  VAR  pY :REAL;
  VAR  pZ :REAL;
  VAR  outParam :REAL;
  VAR  outIndex :LONGINT
) :BOOLEAN ;

Python:

def  vs.GetPointAndParameterOnNurbsCurveAtGivenLength(inNurbCurve, inPercentOfLength):
   return (BOOLEAN, p, outParam, outIndex)

Description:

Gets point, parametric parameter, and curve index of specified location along a NURBS Curve.

Parameters:

inNurbCurve Handle to the NURBS curve.
inPercentOfLength Specify location on curve as percent of total length. (0 - 1)
p Point of specified location.
outParam Parametric parameter of location.
outIndex 0-based index of piece for piecewise NURBS curve.

Example:

PROCEDURE Example;
VAR
	inNurbCurve :HANDLE;
	inPercentOfLength :REAL;
	pX, pY, pZ :REAL;
	outParam :REAL;
	outIndex :LONGINT;
BEGIN
	CallTool(-325);
	inNurbCurve := FSActLayer;
	inPercentOfLength := .5;
	IF GetPointAndParameter(inNurbCurve, inPercentOfLength, pX, pY, pZ, outParam, outIndex) THEN BEGIN
		Locus3D(pX, pY, pZ);
	END;
END;
RUN(Example);



  NurbsCurveEvalPt Objects - NURBS 
VectorWorks9.5

VectorScript Declaration:

PROCEDURE   NurbsCurveEvalPt
(   objectHd :HANDLE;
    index :LONGINT;
    u :REAL;
  VAR  pX :REAL;
  VAR  pY :REAL;
  VAR  pZ :REAL
) ;

Python:

def  vs.NurbsCurveEvalPt(objectHd, index, u):
   return p

Description:

This procedure determines the point on the nurbs curve at the given u value in the indexed piece.

The index is zero based (0 to number of knots - 1). The u value can range from 0 to the value of the last knot in the curve segment.

Parameters:

objectHd Handle to a NURBS curve.
index Segment of curve to be queried.
u Parameter between the minimum and maximum knot value.
p Location of the u point on the curve.

See Also:

NurbsKnot   NurbsNumKnots  



  NurbsCurveGetNumPieces Objects - NURBS 
VectorWorks9.0

VectorScript Declaration:

FUNCTION   NurbsCurveGetNumPieces
( objectHd:HANDLE ) :INTEGER ;

Python:

def  vs.NurbsCurveGetNumPieces(objectHd):
   return INTEGER

Description:

Returns the number of pieces that compose the referenced NURBS curve.

Parameters:

objectHd Handle to NURBS curve.

Result:

An INTEGER count of the pieces composing the curve.



  NurbsCurveType Objects - NURBS 
VectorWorks9.0

VectorScript Declaration:

PROCEDURE   NurbsCurveType
(   objectHd :HANDLE;
    index :LONGINT;
  VAR  isByFit :BOOLEAN
) ;

Python:

def  vs.NurbsCurveType(objectHd, index):
   return isByFit

Description:

Returns the curve type of a segment of the referenced NURBS curve.

The index is zero based (0 to number of segments - 1).

Parameters:

objectHd Handle to NURBS curve.
index Index of curve segment.
isByFit Type of curve segment.

Result:

Returns a BOOLEAN indicating whether the curve is created by fit point (TRUE) or by control point (FALSE).



  NurbsDegree Objects - NURBS 
VectorWorks9.0

VectorScript Declaration:

FUNCTION   NurbsDegree
(   objectHd :HANDLE;
    index :INTEGER
) :INTEGER ;

Python:

def  vs.NurbsDegree(objectHd, index):
   return INTEGER

Description:

Returns the degree of a segment in a NURBS curve or surface.

For NURBS curves, the index indicates which segment of the curve is to be queried. The index is zero based (0 to number of segments - 1).

For NURBS surfaces, specify an index of 1 to indicate u-direction, and an index of 0 to indicate v-direction when querying the surface object.

Parameters:

objectHd Handle to NURBS curve or surface.
index Index of curve segment (NURBS curve) or direction index (NURBS surface).

Result:

The degree of the segment as an INTEGER value.



  NurbsDelVertex Objects - NURBS 
VectorWorks9.0

VectorScript Declaration:

PROCEDURE   NurbsDelVertex
(   objectHd :HANDLE;
    index1 :LONGINT;
    index2 :LONGINT
) ;

Python:

def  vs.NurbsDelVertex(objectHd, index1, index2):
   return None

Description:

Deletes a point in the referenced NURBS curve or surface.

The index is zero based (0 to number of points - 1).

Parameters:

objectHd Handle to NURBS curve or surface.
index1 Index of point in NURBS curve, or U-index of a point in NURBS surface.
index2 V-index of point in NURBS surface.



  NurbsGetNumPts Objects - NURBS 
VectorWorks9.0

VectorScript Declaration:

FUNCTION   NurbsGetNumPts
(   objectHd :HANDLE;
    index :LONGINT
) :LONGINT ;

Python:

def  vs.NurbsGetNumPts(objectHd, index):
   return LONGINT

Description:

Returns the number of points for segment of the referenced NURBS curve, or the number of points of the referenced NURBS surface in the u- or v-direction.

For NURBS curves, the index indicates which segment of the curve is to be queried. The index is zero based (0 to number of segments - 1).

For NURBS surfaces, specify an index of 1 to indicate u-direction, and an index of 0 to indicate v-direction when querying the surface object.

Parameters:

objectHd Handle to NURBS curve or surface.
index Index of curve segment (NURBS curve) or direction index (NURBS surface).

Result:

The number of control points as a LONGINT value.



  NurbsGetPt3D Objects - NURBS 
VectorWorks9.0

VectorScript Declaration:

PROCEDURE   NurbsGetPt3D
(   objectHd :HANDLE;
    index1 :LONGINT;
    index2 :LONGINT;
  VAR  pX :REAL;
  VAR  pY :REAL;
  VAR  pZ :REAL
) ;

Python:

def  vs.NurbsGetPt3D(objectHd, index1, index2):
   return p

Description:

Returns the coordinates of a point in the referenced NURBS curve or surface.

The index is zero based (0 to number of points - 1).

Parameters:

objectHd Handle to NURBS curve or surface.
index1 Index of point in NURBS curve, or u-coordinate of point location in NURBS surface.
index2 V-coordinate of point location in NURBS surface.
p Coordinates of the control point.

See Also:

NurbsCurveEvalPt   NurbsSurfaceEvalPt  



  NurbsGetWeight Objects - NURBS 
VectorWorks9.0

VectorScript Declaration:

PROCEDURE   NurbsGetWeight
(   objectHd :HANDLE;
    index1 :LONGINT;
    index2 :LONGINT;
  VAR  weight :REAL
) ;

Python:

def  vs.NurbsGetWeight(objectHd, index1, index2):
   return weight

Description:

Returns the weight of a point in a NURBS curve or surface.

For NURBS curves, index1 corresponds to the segment of the curve to be queried, and index2 corresponds to the index of the point in the segment.

For NURBS surfaces, index1 corresponds to the u-index and index2 corresponds to the v-index of the surface.

The index is zero based (0 to number of points - 1).

Parameters:

objectHd Handle to NURBS curve or surface.
index1 Segment of curve to be queried (NURBS curve), or u-index (NURBS surface).
index2 Index of point (NURBS curve) or v-index (NURBS surface).
weight Weight of point.



  NurbsKnot Objects - NURBS 
VectorWorks9.0

VectorScript Declaration:

PROCEDURE   NurbsKnot
(   objectHd :HANDLE;
    index1 :LONGINT;
    index2 :LONGINT;
  VAR  knot :REAL
) ;

Python:

def  vs.NurbsKnot(objectHd, index1, index2):
   return knot

Description:

Returns the specified knot in a NURBS curve or surface.

For NURBS curves, index1 corresponds to the segment of the curve to be queried, and index2 corresponds to the knot in the segment.

For NURBS surfaces, index1 corresponds to the u- or v-direction of the surface (u=1, v=0), and index2 corresponds to the knot index.

The index is zero based (0 to number of knots - 1).

Parameters:

objectHd Handle to NURBS curve or surface.
index1 Segment of curve to be queried (NURBS curve), or direction (NURBS surface).
index2 Index of segment or direction knot.
knot Knot value.

Example:

See 



  NurbsNumKnots Objects - NURBS 
VectorWorks9.0

VectorScript Declaration:

FUNCTION   NurbsNumKnots
(   objectHd :HANDLE;
    index :LONGINT
) :LONGINT ;

Python:

def  vs.NurbsNumKnots(objectHd, index):
   return LONGINT

Description:

Returns the number of knots for the referenced NURBS curve or surface. If the object is a curve, then index indicates the segment of the curve to consider. If the object is a surface, then the index indicates the U direction (for index = 1) or the V direction (for index = 0).

Parameters:

objectHd Handle to NURBS curve or surface.
index Index of curve, or U/V choice for surface.

Example:

See 



  NurbsSetKnot Objects - NURBS 
VectorWorks9.0

VectorScript Declaration:

PROCEDURE   NurbsSetKnot
(   objectHd :HANDLE;
    index1 :LONGINT;
    index2 :LONGINT;
    knot :REAL
) ;

Python:

def  vs.NurbsSetKnot(objectHd, index1, index2, knot):
   return None

Description:

Sets the specified knot in a NURBS curve or surface.

For NURBS curves, index1 corresponds to a segment of the curve, and index2 corresponds to the knot in the segment.

For NURBS surfaces, index1 corresponds to the u- or v-direction of the surface and index2 corresponds to the knot.

The index is zero based (0 to number of knots - 1).

Parameters:

objectHd Handle to NURBS curve or surface.
index1 Segment of curve to be queried (NURBS curve), or direction (NURBS surface).
index2 Index of segment or direction knot.
knot Knot value.



  NurbsSetPt3D Objects - NURBS 
VectorWorks9.0

VectorScript Declaration:

PROCEDURE   NurbsSetPt3D
(   objectHd :HANDLE;
    index1 :LONGINT;
    index2 :LONGINT;
    pX :REAL;
    pY :REAL;
    pZ :REAL
) ;

Python:

def  vs.NurbsSetPt3D(objectHd, index1, index2, p):
   return None

Description:

Sets the coordinates of a point in the referenced NURBS curve or surface.

The index is zero based (0 to number of points - 1).

For a nurbs curve, index1 is the piece number of the nurbs curve. Index2 is the vertex number within that piece. NurbsCurveGetNumPieces will give you the number of pieces inside of the nurbs curve (1-based). NurbsGetNumPts will give you the number of points inside of a piece.

Parameters:

objectHd Handle to NURBS curve or surface.
index1 Index of point in NURBS curve, or u-coordinate of point location in NURBS surface.
index2 V-coordinate of point location in NURBS surface.
p New coordinates for the point.

Example:

See 



  NurbsSetWeight Objects - NURBS 
VectorWorks9.0

VectorScript Declaration:

PROCEDURE   NurbsSetWeight
(   objectHd :HANDLE;
    index1 :LONGINT;
    index2 :LONGINT;
    weight :REAL
) ;

Python:

def  vs.NurbsSetWeight(objectHd, index1, index2, weight):
   return None

Description:

Sets the weight of a point in a NURBS curve or surface.

For NURBS curves, index1 corresponds to the segment of the curve to be queried, and index2 corresponds to the index of the point in the segment.

For NURBS surfaces, index1 corresponds to the u-index and index2 corresponds to the v-index of the surface.

The index is zero based (0 to number of points - 1).

Parameters:

objectHd Handle to NURBS curve or surface.
index1 Segment of curve to be queried (NURBS curve), or u-index (NURBS surface).
index2 Index of point (NURBS curve) or v-index (NURBS surface).
weight New weight of point.



  NurbsSurfaceEvalPt Objects - NURBS 
VectorWorks9.5

VectorScript Declaration:

PROCEDURE   NurbsSurfaceEvalPt
(   objectHd :HANDLE;
    u :REAL;
    v :REAL;
  VAR  pX :REAL;
  VAR  pY :REAL;
  VAR  pZ :REAL
) ;

Python:

def  vs.NurbsSurfaceEvalPt(objectHd, u, v):
   return p

Description:

This procedure determines the point on the nurbs surface at the given u,v values.

The u vand v values can range from 0 to the value of the last knot in each direction.

Parameters:

objectHd Handle to a NURBS surface.
u Parameter between the minimum and maximum knot value in U direction.
v Parameter between the minimum and maximum knot value in V direction.
p Location of the u,v point on the surface.

Example:

PROCEDURE LocusSurface;
{ Create a surface, then put loci on it }
CONST
    uMaxIndex   = 16;   { 17 points, 0 - 16 }
    vMaxIndex   = 16;   { 17 points, 0 - 16 }
    uDegree     = 3;    
    vDegree     = 4;
    xMin        = -3;
    xMax        = 3;
    yMin        = -3;
    yMax        = 3;
    zMax        = 3;
    numLoci     = 17;
VAR
    surfaceH                : HANDLE;
    x,y,z,u,v               : REAL;
    i,j                     : INTEGER;
    numKnotsU, numKnotsV    : INTEGER;
    maxFoundU, maxFoundV    : REAL;
    uStep, vStep            : REAL;
BEGIN
    { Create a Nurbs Surface }
    
    surfaceH := CreateNurbsSurface(uMaxIndex + 1, vMaxIndex + 1, uDegree, vDegree);
    IF surfaceH <> NIL THEN BEGIN
        FOR i := 0 TO uMaxIndex  DO BEGIN
            FOR j := 0 TO vMaxIndex DO BEGIN
                x := xMin + (xMax - xMin) * (i / uMaxIndex);
                y := yMin + (yMax - yMin) * (j / vMaxIndex);
                z := Cos(i - uMaxIndex / 2) *
                     Cos(j - vMaxIndex / 2) * 
                     zMax / (1 + x*x + y*y);
                NurbsSetPt3D(surfaceH, i, j, x,y,z);
            END;
        END;
        ResetBBox(surfaceH);
        
        { Add Loci }
        
        { Find number of knots in each direction }
        numKnotsU := NurbsNumKnots(surfaceH, 1);
        numKnotsV := NurbsNumKnots(surfaceH, 0);
        
        { Find the u and v real values that correspond the knots with the 
          maximum u and v indices. }
        NurbsKnot(surfaceH, 1, numKnotsU - 1, maxFoundU);       
        NurbsKnot(surfaceH, 0, numKnotsV - 1, maxFoundV);       
        
        Message(numKnotsU, ' ', numKnotsV);
        
        { Create 3D loci along each direction }
        uStep   := maxFoundU / (numLoci - 1);
        vStep   := maxFoundV / (numLoci - 1);
        
        u := 0;
        WHILE u <= maxFoundU DO BEGIN
            v := 0;
            WHILE v <= maxFoundV DO BEGIN
                NurbsSurfaceEvalPt(surfaceH, u, v, x,y,z);
                Locus3D(x,y,z);
                v := v + vStep;
            END;
            u := u + uStep;
        END;
    
        { Set View }
        Projection(0,0,9.76,-4.88,4.88,4.88,-4.88);
        SetView(#-45.0d,#-35.26438968275d,#-30.0d,0,0,0);
        RedrawAll;
    END;
END;
Run(LocusSurface);

See Also:

NurbsKnot   NurbsNumKnots  



  RevolveWithRail Objects - NURBS 
VectorWorks10.0

VectorScript Declaration:

FUNCTION   RevolveWithRail
(   profileH :HANDLE;
    railH :HANDLE;
    axisH :HANDLE
) :HANDLE ;

Python:

def  vs.RevolveWithRail(profileH, railH, axisH):
   return HANDLE

Description:

Creates a NURBS surface or a group of surfaces by revolving a profile about an axis and following a rail guide curve on a plane perpendicular to the plane containing the axis and the profile.

Parameters:

profileH Handle to a NURBS curve to be used as the profile object.
railH Handle to a NURBS curve to be used as the rail guide object
axisH Handle to a linear NURBS curve about which the
profile would be revolved

Result:

Handle to resulting NURBS surface.



  TrimNurbsSurface Objects - NURBS 
Vectorworks 2013

VectorScript Declaration:

FUNCTION   TrimNurbsSurface
(   surfaceHandle :HANDLE;
    curveHandle :HANDLE
) :BOOLEAN ;

Python:

def  vs.TrimNurbsSurface(surfaceHandle, curveHandle):
   return BOOLEAN

Description:

Trims the NURBS surface by a given NURBS curve.

Parameters:

surfaceHandle Handle to a NURBS surface to trim.
curveHandle Handle to a NURBS curve for trimming.

Result:

Returns TRUE if trimmed the surface, otherwise returns FALSE.

Example:

PROCEDURE Example;

VAR
surfaceH, curveH :HANDLE;
bFlag :BOOLEAN;

BEGIN
surfaceH := 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);

curveH := CreateNurbsCurve(0, 0, 0, TRUE, 2);
AddVertex3D(nC, 1, 1, 0);
AddVertex3D(nC, 2, 0, 0);

bFlag := TrimNurbsSurface(surfaceH, curveH);
END;

RUN(Example);

See Also:

CreateNurbsSurface   CreateNurbsCurve