VS:PointAlongPolyN: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
 
No edit summary
Line 5: Line 5:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<desc>
<desc>
Returns a point at the specified distance along the poly, and a vector tangent to the poly at that point. Returns FALSE if it fails for any reason.
Returns a point at the specified distance along the poly, and a vector tangent to the poly at that point. Similar to PointAlongPoly with an addition of an epsilon value.</desc>
 
This is similar to the function [[VS:PointAlongPoly]] but it allows for specifying epsilon value to handle curved cases better.
</desc>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<def>
<def>
<funcDef lang="vs">
<funcDef lang="vs">
FUNCTION PointAlongPolyN(h :HANDLE; dist :REAL; epsilon: REAL; VAR ptX, ptY, ptZ :REAL; VAR tangentX, tangentY, tangentZ :REAL) :BOOLEAN;
FUNCTION PointAlongPolyN(h:HANDLE; dist:REAL; epsilon:REAL; VAR pt:VECTOR; VAR tangent:VECTOR) : BOOLEAN;
</funcDef>
</funcDef>
<funcDef lang="py">
<funcDef lang="py">
Line 35: Line 32:
</line>
</line>
<line>
<line>
ptX, ptY, ptZ
epsilon
REAL
REAL
Output parameter.
 
</line>
<line>
pt
VECTOR
 
</line>
</line>
<line>
<line>
tangentX, tangentY, tangentZ
tangent
REAL
VECTOR
Output parameter.
 
</line>
</line>
</lineList>
</lineList>
</params>
</params>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<return>
<remark></remark>
</return>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<remark>
<sample></sample>
 
</remark>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<sample>
<seeAlso></seeAlso>
<code lang="pas">
PROCEDURE Example;
VAR
  h    :HANDLE;
  p, t :VECTOR;
  dist :REAL;
BEGIN
  h := FSActLayer;
  IF h = NIL THEN
      AlrtDialog('Select a poly before running this script.')
  ELSE BEGIN
      dist := RealDialog('Enter distance:', '1');
      DSelectAll;
      IF PointAlongPolyN(h, dist, 0.1, p, t) THEN BEGIN
        Locus(p.x, p.y);
        MoveTo(p.x, p.y);
        LineTo(p.x + (t.x * 10), p.y + (t.y * 10));
      END ELSE AlrtDialog('Error!');
  END;
END;
RUN(Example);</code>
 
</sample>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<version>
<version>
Availability: from Vectorworks 2012
Availability: from Vectorworks 2014


This is drop-in function.
</version>
</version>
-----------------------------------------------------------------------------------------------------------
<seeAlso>
[[VS:PointAlongPoly]]
</seeAlso>


</vwDoc>
</vwDoc>


[[Category:VS Function Reference|PointAlongPoly]]
[[Category:VS Function Reference|PointAlongPolyN]]
[[Category:VS Function Reference:Graphic Calculation|PointAlongPoly]]
[[Category:VS Function Reference:Graphic Calculation|PointAlongPolyN]]

Revision as of 17:36, 18 September 2013

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

Description

Returns a point at the specified distance along the poly, and a vector tangent to the poly at that point. Similar to PointAlongPoly with an addition of an epsilon value.

FUNCTION PointAlongPolyN(
h :HANDLE;
dist :REAL;
epsilon :REAL;
VAR pt :VECTOR;
VAR tangent :VECTOR) : BOOLEAN;
def vs.PointAlongPolyN(h, dist, epsilon):
    return (BOOLEAN, pt, tangent)

Parameters

h HANDLE
dist REAL
epsilon REAL
pt VECTOR
tangent VECTOR

Version

Availability: from Vectorworks 2014