VS:LineLineIntersection/ja

From Vectorworks Developer
Revision as of 12:31, 14 January 2016 by Kimura (talk | contribs) (1 revision: Japanese Reference for 2016)
Jump to navigation Jump to search

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

Description

2つの線分の交点座標を返します。

PROCEDURE LineLineIntersection(
l1start :REAL;
l1end :REAL;
l2start :REAL;
l2end :REAL;
VAR parallel :BOOLEAN;
VAR intOnLines :BOOLEAN;
VAR sectpt :REAL);
def vs.LineLineIntersection(l1start, l1end, l2start, l2end):
    return (parallel, intOnLines, sectpt)

Parameters

l1start REAL 線分1の始点座標
l1end REAL 線分1の終点座標
l2start REAL 線分2の始点座標
l2end REAL 線分2の終点座標
parallel BOOLEAN 平行な場合はTRUE
intOnLines BOOLEAN 交差している場合はTRUE
sectpt REAL 交点の座標

Example

PROCEDURE Example;
VAR
   pt1, pt2, pt3, pt4, pt5 :POINT;
   parallel, intOnLines :BOOLEAN; 

BEGIN
   CallTool(-201); 
   GetSegPt1(FSActLayer, pt1.x, pt1.y); 
   GetSegPt2(FSActLayer, pt2.x, pt2.y); 
   CallTool(-201); 
   GetSegPt1(FSActLayer, pt3.x, pt3.y); 
   GetSegPt2(FSActLayer, pt4.x, pt4.y); 
   LineLineIntersection(pt1, pt2, pt3, pt4, parallel, intOnLines, pt5); 
   Locus(pt5.x, pt5.y);
END;
RUN(Example);

Version

利用可能バージョン: VectorWorks10.0