VS:GetPointAndParameterOnNurbsCurveAtGivenLength

From Vectorworks Developer
Revision as of 14:32, 12 August 2013 by Root (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

Description

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

FUNCTION GetPointAndParameterOnNurbsCurveAtGivenLength(
inNurbCurve :HANDLE;
inPercentOfLength :REAL;
VAR pX,pY,pZ :REAL;
VAR outParam :REAL;
VAR outIndex :LONGINT) : BOOLEAN;
def vs.GetPointAndParameterOnNurbsCurveAtGivenLength(inNurbCurve, inPercentOfLength):
    return (BOOLEAN, p, outParam, outIndex)

Parameters

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

Example

VectorScript

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

Python

def Example():
	vs.CallTool(-325)
	inNurbCurve = vs.FSActLayer()
	inPercentOfLength = 0.5
	isNurbss, outPt, outParam, outIndex = vs.GetPointAndParameter(inNurbCurve, inPercentOfLength)
	if isNurbss:
		vs.Locus3D(outPt[0], outPt[1], outPt[2])

Example()

Version

Availability: from VectorWorks10.1