Difference between revisions of "SplitTPA"

From SCAR Divi Manual
Jump to: navigation, search
 
(3 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
SCAR Divi 3.27 > Current
 
SCAR Divi 3.27 > Current
  
*Contained a bug 3.26 that caused the resulting 2d array to contain additional wrong arrays.
+
*Contained a bug in 3.26 that caused the resulting 2d array to contain additional wrong arrays.
  
 
===Aliases===
 
===Aliases===
*TPAChain (SCAR Divi 3.26 > Current)
+
*TPAChain (SCAR Divi 3.26 > 3.35)
  
 
==Description==
 
==Description==
This function splits a given [[TPointArray]] '''TPA''' into separated TPointArrays by grouping together the points that are within a given distance '''Dist''' from each other. The function returns a [[T2DPointArray]] containing all the resulting TPointArrays.
+
This function splits a given [[TPointArray]] '''TPA''' into separate TPointArrays by grouping together the points that are within a given distance '''Dist''' from each other. The function returns a [[T2DPointArray]] containing all the resulting TPointArrays. An extended function with additional functionality is available as [[SplitTPAEx]].
  
 
==Example==
 
==Example==
Line 36: Line 36:
 
==See Also==
 
==See Also==
 
*[[SplitTPAEx]]
 
*[[SplitTPAEx]]
*[[TPAGroup]]
+
*[[GroupTPA]]
*[[TPAGroupEx]]
+
*[[GroupTPAEx]]
  
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:TPA Functions]]
 
[[Category:TPA Functions]]
 
[[Category:Array Functions]]
 
[[Category:Array Functions]]

Latest revision as of 11:55, 14 July 2012

Definition

function SplitTPA(const TPA: TPointArray; const Dist: Integer): T2DPointArray;

Availability

SCAR Divi 3.27 > Current

  • Contained a bug in 3.26 that caused the resulting 2d array to contain additional wrong arrays.

Aliases

  • TPAChain (SCAR Divi 3.26 > 3.35)

Description

This function splits a given TPointArray TPA into separate TPointArrays by grouping together the points that are within a given distance Dist from each other. The function returns a T2DPointArray containing all the resulting TPointArrays. An extended function with additional functionality is available as SplitTPAEx.

Example

var
  i: Integer;
  TPA: TPointArray;
  ATPA: T2DPointArray;

begin
  TPA := [Point(0, 0), Point(2, 6), Point(1, 2), Point(1, 1)];
  ATPA := SplitTPA(TPA, 2);
  for i := Low(ATPA) to High(ATPA) do
    WriteLn(TPAToStr(ATPA[i]));
end.

Output:

(0,0);(1,1);(1,2)
(2,6)

See Also