VS:PtPerpLine: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
No edit summary
 
m (1 revision)
 
(2 intermediate revisions by the same user not shown)
Line 5: Line 5:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<desc>
<desc>
Returns a point on the input line which is closest to the input point. Doesn't check to see that the point is ON the line.
Returns a point on the input line which is closest to the input point. Doesn't check to see that the point is ON the line.</desc>
</desc>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<def>
<def>
<funcDef lang="vs">
<funcDef lang="vs">
FUNCTION PtPerpLine(ptX, ptY, ptZ :REAL; begPtX, begPtY, begPtZ :REAL; endPtX, endPtY, endPtZ :REAL) VECTOR;
FUNCTION PtPerpLine(pt:VECTOR; begPt:VECTOR; endPt:VECTOR) : VECTOR;
</funcDef>
</funcDef>
<funcDef lang="py">
<funcDef lang="py">
Line 23: Line 22:
<lineList ident=1>
<lineList ident=1>
<line>
<line>
ptX, ptY, ptZ
pt
REAL
VECTOR


</line>
</line>
<line>
<line>
begPtX, begPtY, begPtZ
begPt
REAL
VECTOR


</line>
</line>
<line>
<line>
endPtX, endPtY, endPtZ
endPt
REAL
VECTOR


</line>
</line>
</lineList>
</lineList>
</params>
</params>


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


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


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<sample>
<seeAlso></seeAlso>
<code lang="pas">
PROCEDURE Example;
VAR
  beg_pt, END_pt, pt, r :VECTOR;
BEGIN
  CallTool(-201);
  GetSegPt1(FSActLayer, beg_pt.x, beg_pt.y);
  GetSegPt2(FSActLayer, END_pt.x, END_pt.y);
  CallTool(-221);
  GetLocPt(FSActLayer, pt.x, pt.y);
  r := PtPerpLine(pt, beg_pt, END_pt);
  Locus(r.x, r.y);
END;
RUN(Example);</code>
 
</sample>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<version>
<version>
Availability: from All Versions
Availability: from Vectorworks 2014


This is drop-in function.
</version>
</version>
-----------------------------------------------------------------------------------------------------------
<seeAlso>
</seeAlso>


</vwDoc>
</vwDoc>

Latest revision as of 17:35, 18 September 2013

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

Description

Returns a point on the input line which is closest to the input point. Doesn't check to see that the point is ON the line.

FUNCTION PtPerpLine(
pt :VECTOR;
begPt :VECTOR;
endPt :VECTOR) : VECTOR;
def vs.PtPerpLine(pt, begPt, endPt):
    return VECTOR

Parameters

pt VECTOR
begPt VECTOR
endPt VECTOR

Version

Availability: from Vectorworks 2014