Difference between revisions of "TPAFilterTriangle"

From SCAR Divi Manual
Jump to: navigation, search
(Created page with "==Definition== <source lang="scar" lines="false"> procedure TPAFilterTriangle(var TPA: TPointArray; const X1, Y1, X2, Y2, X3, Y3: Integer); </source> ==Availability== SCAR Di...")
 
Line 30: Line 30:
  
 
==See Also==
 
==See Also==
*[[TPAExtractTraingle]]
+
*[[TPAExtractTriangle]]
 
*[[TPAFilterCircle]]
 
*[[TPAFilterCircle]]
 
*[[TPAFilterPie]]
 
*[[TPAFilterPie]]

Revision as of 13:02, 21 November 2012

Definition

procedure TPAFilterTriangle(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

Filters points from a given TPointArray TPA by removing all points that are 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));
  TPAFilterTriangle(TPA, 1, 1, 1, 4, 3, 4);
  WriteLn('Filtered: ' + TPAToStr(TPA));
end.

Output:

(0,0);(2,2);(2,3);(5,10)
Filtered: (0,0);(2,2);(5,10)

See Also