VS:PtOnArc: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
No edit summary
Line 5: Line 5:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<desc>
<desc>
Determines if a point is on an arc.
Determines if a point is on an arc.</desc>
</desc>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<def>
<def>
<funcDef lang="vs">
<funcDef lang="vs">
FUNCTION PtOnArc(ptX, ptY, ptZ :REAL; cenPtX, cenPtY, cenPtZ :REAL; radius :REAL; startAng :REAL; sweepAng :REAL; tolerance :REAL) :BOOLEAN;
FUNCTION PtOnArc(pt:VECTOR; cenPt:VECTOR; radius:REAL; startAng:REAL; sweepAng:REAL; tolerance:REAL) : BOOLEAN;
</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>
cenPtX, cenPtY, cenPtZ
cenPt
REAL
VECTOR


</line>
</line>
Line 54: Line 53:
</lineList>
</lineList>
</params>
</params>


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


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


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<sample>
<seeAlso></seeAlso>
<code lang="pas">
PROCEDURE Example;
VAR
  pt, beg_pt, END_pt, cen_pt :VECTOR;
  startAng, sweepAng, radius :REAL;
 
  PROCEDURE ArcInfo(h :HANDLE; VAR cen_pt :vector; VAR startAng, sweepAng, Radius :REAL);
  BEGIN
      Hcenter(h, cen_pt.x, cen_pt.y);
      GetArc (h, startAng, sweepAng);
      IF GetType(h) = 6 then Radius := Hperim(h) / Deg2Rad(sweepAng) ELSE
      IF GetType(h) = 89 THEN Radius := 5729.28 / ((100 * Hangle(h)) / Hlength(h));
  END;
 
BEGIN
  CallTool(-202);
  ArcInfo(FSActLayer, cen_pt, startAng, sweepAng, radius);
  CallTool(-221);
  GetLocPt(FSActLayer, pt.x, pt.y);
  Message(PtOnArc(pt, cen_pt, radius, startAng, sweepAng, RealDialog(&#039;Fuzz:&#039;, &#039;1&#039;)));
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>

Revision as of 17:35, 18 September 2013

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

Description

Determines if a point is on an arc.

FUNCTION PtOnArc(
pt :VECTOR;
cenPt :VECTOR;
radius :REAL;
startAng :REAL;
sweepAng :REAL;
tolerance :REAL) : BOOLEAN;
def vs.PtOnArc(pt, cenPt, radius, startAng, sweepAng, tolerance):
    return BOOLEAN

Parameters

pt VECTOR
cenPt VECTOR
radius REAL
startAng REAL
sweepAng REAL
tolerance REAL

Version

Availability: from Vectorworks 2014