Programmer Guide/Command Reference/EVAL/pgiline: Difference between revisions
From STX Wiki
< Programmer Guide | Command Reference | EVAL
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 5: | Line 5: | ||
:;<var>X</var>:a [[../#polygons|closed point-list]] or a [[../#polygons|polygon-stream]] defining one or more polygons. | :;<var>X</var>:a [[../#polygons|closed point-list]] or a [[../#polygons|polygon-stream]] defining one or more polygons. | ||
:;<var>IX</var>:The index of the polygon of ''X'' to be tested; 0 <= <var>IX</var> < <code>[[../pgget|pgget]](''X'')</code> | :;<var>IX</var>:The index of the polygon of ''X'' to be tested; 0 <= <var>IX</var> < <code>[[../pgget|pgget]](''X'')</code> | ||
:;<var>PX1, PY1, PX2, PY2</var>: The | :;<var>PX1, PY1, PX2, PY2</var>: The points <''PX1'',''PY1''> and <''PX2'',''PY2''> defining the line to be tested. | ||
;Result 3: The result ''r'' is a Nx3 matrix. Each row of the matrix contains the coordinates of a point of the line and its state. | ;Result 3: The result ''r'' is a Nx3 matrix. Each row of the matrix contains the coordinates of a point of the line and its state. | ||
::{|class="einrahmen" | ::{|class="einrahmen" | ||
Line 22: | Line 22: | ||
|0 if the end point is outside ''X<sub>IX</sub>''<BR>1 if the end point is inside ''X<sub>IX</sub>'' | |0 if the end point is outside ''X<sub>IX</sub>''<BR>1 if the end point is inside ''X<sub>IX</sub>'' | ||
|} | |} | ||
;See also: [[../pginit|pginit]], [[../pgget|pgget]], [[../ | ;See also: [[../pginit|pginit]], [[../pgget|pgget]], [[../pgitest|pgitest]], [[../pgxgrid|pgxgrid]], [[../pgsplit|pgsplit]], [[../pgtrans|pgtrans]], [[../pghull|pghull]] | ||
[[../#Functions|<function list>]] | [[../#Functions|<function list>]] |
Revision as of 08:30, 20 April 2011
Find all intersections of a line, defined by two points, with a polygon.
- Usage
pgiline(X, IX, PX1scalar, PY1scalar), PX2scalar, PY2scalar)
- X
- a closed point-list or a polygon-stream defining one or more polygons.
- IX
- The index of the polygon of X to be tested; 0 <= IX <
pgget(X)
- PX1, PY1, PX2, PY2
- The points <PX1,PY1> and <PX2,PY2> defining the line to be tested.
- Result 3
- The result r is a Nx3 matrix. Each row of the matrix contains the coordinates of a point of the line and its state.
i r[i,0], r[i,1] r[i,2] 0 start point of the line 0 if the start point is outside XIX
1 if the start point is inside XIX1 .. N-2 intersection point 0 if the line leaves XIX
1 if the line enters XIXN-1 end point of the line 0 if the end point is outside XIX
1 if the end point is inside XIX