VS:PointAlongPoly: 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.</desc>
</desc>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<def>
<def>
<funcDef lang="vs">
<funcDef lang="vs">
FUNCTION PointAlongPoly(h :HANDLE; dist :REAL; VAR ptX, ptY, ptZ :REAL; VAR tangentX, tangentY, tangentZ :REAL) :BOOLEAN;
FUNCTION PointAlongPoly(h:HANDLE; dist:REAL; VAR pt:VECTOR; VAR tangent:VECTOR) : BOOLEAN;
</funcDef>
</funcDef>
<funcDef lang="py">
<funcDef lang="py">
Line 33: Line 32:
</line>
</line>
<line>
<line>
ptX, ptY, ptZ
pt
REAL
VECTOR
Output parameter.
 
</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>
This appears to be annotated wrong? Shouldn't pt and tangent be POINT or VECTOR variables?
</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 PointAlongPoly(h, dist, 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 All Versions
Availability: from Vectorworks 2014


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


</vwDoc>
</vwDoc>

Revision as of 17:35, 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.

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

Parameters

h HANDLE
dist REAL
pt VECTOR
tangent VECTOR

Version

Availability: from Vectorworks 2014