Difference between revisions of "TPAExtractTriangle"
From SCAR Divi Manual
m (Freddy moved page TPAExtractTraingle to TPAExtractTriangle without leaving a redirect) |
|||
Line 30: | Line 30: | ||
==See Also== | ==See Also== | ||
− | *[[ | + | *[[TPAFilterTriangle]] |
*[[TPAExtractCircle]] | *[[TPAExtractCircle]] | ||
*[[TPAExtractPie]] | *[[TPAExtractPie]] |
Revision as of 13:01, 21 November 2012
Definition
procedure TPAExtractTriangle(var TPA: TPointArray; const X1, Y1, X2, Y2, X3, Y3: Integer);
Availability
SCAR Divi 3.35 > Current
- Before 3.37.01 the function didn't resize the filtered array
Description
Extracts points from a given TPointArray TPA by removing all points that are not inside of the given triangle area. (X1, Y1), (X2, Y2) and (X3, Y3) define the corner points of the triangle.
Example
var TPA: TPointArray; begin TPA := [Point(0, 0), Point(2, 2), Point(2, 3), Point(5, 10)]; WriteLn(TPAToStr(TPA)); TPAExtractTriangle(TPA, 1, 1, 1, 4, 3, 4); WriteLn('Extracted: ' + TPAToStr(TPA)); end.
Output:
(0,0);(2,2);(2,3);(5,10) Extracted: (2,3)