Difference between revisions of "VS:TrimNurbsSurface"

From Vectorworks Developer
Jump to: navigation, search
m (1 revision)
(Fix example, it was rising error due to var names not in sync, wikify)
 
Line 45: Line 45:
 
-----------------------------------------------------------------------------------------------------------
 
-----------------------------------------------------------------------------------------------------------
 
<sample>
 
<sample>
<PRE>
+
<code lang="vs">
 
PROCEDURE Example;
 
PROCEDURE Example;
 
 
VAR
 
VAR
surfaceH, curveH :HANDLE;
+
surfaceH, curveH :HANDLE;
bFlag :BOOLEAN;
+
bFlag :BOOLEAN;
  
 
BEGIN
 
BEGIN
surfaceH := CreateNurbsSurface(3, 3, 1, 1);
+
surfaceH:= CreateNurbsSurface(3, 3, 1, 1);
NurbsSetPt3D(h, 0, 0, 0, 0, 0);
+
NurbsSetPt3D(surfaceH, 0, 0, 0, 0, 0);
NurbsSetPt3D(h, 0, 1, 1, 0, 0);
+
NurbsSetPt3D(surfaceH, 0, 1, 1, 0, 0);
NurbsSetPt3D(h, 0, 2, 2, 0, 0);
+
NurbsSetPt3D(surfaceH, 0, 2, 2, 0, 0);
NurbsSetPt3D(h, 1, 0, 0, 1, 0);
+
NurbsSetPt3D(surfaceH, 1, 0, 0, 1, 0);
NurbsSetPt3D(h, 1, 1, 1, 1, 1);
+
NurbsSetPt3D(surfaceH, 1, 1, 1, 1, 1);
NurbsSetPt3D(h, 1, 2, 2, 1, 0);
+
NurbsSetPt3D(surfaceH, 1, 2, 2, 1, 0);
NurbsSetPt3D(h, 2, 0, 0, 2, 0);
+
NurbsSetPt3D(surfaceH, 2, 0, 0, 2, 0);
NurbsSetPt3D(h, 2, 1, 1, 2, 0);
+
NurbsSetPt3D(surfaceH, 2, 1, 1, 2, 0);
NurbsSetPt3D(h, 2, 2, 2, 2, 0);
+
NurbsSetPt3D(surfaceH, 2, 2, 2, 2, 0);
  
curveH := CreateNurbsCurve(0, 0, 0, TRUE, 2);
+
curveH := CreateNurbsCurve(0, 0, 0, TRUE, 2);
AddVertex3D(nC, 1, 1, 0);
+
AddVertex3D(curveH, 1, 1, 0);
AddVertex3D(nC, 2, 0, 0);
+
AddVertex3D(curveH, 2, 0, 0);
  
bFlag := TrimNurbsSurface(surfaceH, curveH);
+
bFlag := TrimNurbsSurface(surfaceH, curveH);
 
END;
 
END;
 
+
RUN(Example);
RUN(Example);</PRE>
+
</code>
 
</sample>
 
</sample>
  

Latest revision as of 02:24, 13 May 2018

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


Description

Trims the NURBS surface by a given NURBS curve.
FUNCTION TrimNurbsSurface(
surfaceHandle  :HANDLE;
curveHandle  :HANDLE) : BOOLEAN;
def vs.TrimNurbsSurface(surfaceHandle, curveHandle):
    return BOOLEAN

Parameters

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

Return Value

Returns TRUE if trimmed the surface, otherwise returns FALSE.

Remarks

It returns true if the curve is attached to the surface as trimmed curve.

Example

PROCEDURE Example;
VAR
	surfaceH, curveH :HANDLE;
	bFlag :BOOLEAN;

BEGIN
	surfaceH:= CreateNurbsSurface(3, 3, 1, 1);
	NurbsSetPt3D(surfaceH, 0, 0, 0, 0, 0);
	NurbsSetPt3D(surfaceH, 0, 1, 1, 0, 0);
	NurbsSetPt3D(surfaceH, 0, 2, 2, 0, 0);
	NurbsSetPt3D(surfaceH, 1, 0, 0, 1, 0);
	NurbsSetPt3D(surfaceH, 1, 1, 1, 1, 1);
	NurbsSetPt3D(surfaceH, 1, 2, 2, 1, 0);
	NurbsSetPt3D(surfaceH, 2, 0, 0, 2, 0);
	NurbsSetPt3D(surfaceH, 2, 1, 1, 2, 0);
	NurbsSetPt3D(surfaceH, 2, 2, 2, 2, 0);

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

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

Version

Availability: from Vectorworks 2013

See Also

VS Functions:

VS:CreateNurbsSurface | VS:CreateNurbsCurve

VS Functions:

[[VS:CreateNurbsSurface]]

| [[VS:CreateNurbsCurve]]
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox