Difference between revisions of "SplitTPAEx"
From SCAR Divi Manual
(Created page with "==Definition== <source lang="scar" lines="false"> function SplitTPAEx(const TPA: TPointArray; const XMax, YMax: Integer): T2DPointArray; </source> ==Availability== SCAR Divi 3.2...") |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
==Availability== | ==Availability== | ||
SCAR Divi 3.27 > Current | SCAR Divi 3.27 > Current | ||
+ | |||
+ | *Contained a bug in 3.26 that caused the resulting 2d array to contain additional wrong arrays. | ||
===Aliases=== | ===Aliases=== | ||
− | *TPAChainEx (SCAR Divi 3.26 > | + | *TPAChainEx (SCAR Divi 3.26 > 3.35) |
==Description== | ==Description== | ||
− | This function splits a given [[TPointArray]] '''TPA''' into | + | This function splits a given [[TPointArray]] '''TPA''' into separate TPointArrays by grouping together the points that are within a given distance from each other. The distance is given separately for the x and y components of the points in '''XDist''' and '''YDist'''. The function returns a [[T2DPointArray]] containing all the resulting TPointArrays. |
==Example== | ==Example== | ||
Line 35: | Line 37: | ||
==See Also== | ==See Also== | ||
*[[SplitTPA]] | *[[SplitTPA]] | ||
− | *[[ | + | *[[GroupTPAEx]] |
− | *[[ | + | *[[GroupTPA]] |
[[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 SplitTPAEx(const TPA: TPointArray; const XMax, YMax: 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
- TPAChainEx (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 from each other. The distance is given separately for the x and y components of the points in XDist and YDist. The function returns a T2DPointArray containing all the resulting TPointArrays.
Example
var i: Integer; TPA: TPointArray; ATPA: T2DPointArray; begin TPA := [Point(0, 0), Point(2, 6), Point(1, 2), Point(1, 1)]; ATPA := SplitTPAEx(TPA, 0, 1); for i := Low(ATPA) to High(ATPA) do WriteLn(TPAToStr(ATPA[i])); end.
Output:
(0,0) (1,1);(1,2) (2,6)