SRL Archive - OSR Help

RemoveDistTPointArray() broken?


Gala

2012-02-21 08:59:50

Hello all.
I was fighting with this problem for a few hours now, so I decided to ask.
Is RemoveDistTPointArray() still working or broken?

Here is how I use it:

TPA := RemoveDistTPointArray(x, y, 90, TPA, false);

The Point P(x,y) exists (I checked it a few times) and in TPA are many points (also in the circle with radius 90 with M(x,y))

Is there another function to remove points from a TPA in a give circle?

thx, Gala

NCDS

2012-02-21 09:04:34


* procedure FilterPointsPie(var Points: TPointArray; const SD, ED, MinR, MaxR: Extended; Mx, My: Integer);

Gala

2012-02-21 10:05:06

@ncds
thx, I will test if this works for me.

masterBB

2012-02-21 10:10:23

How does this work for you:

program new;

function getBlackSquare:TPointArray;
var
x,y:Integer;
begin
setLength(result,400*400);
for x := 0 to 399 do
for y := 0 to 399 do
result[x*400+y] := Point(x,y);
end;

var
points:TPointArray;
bitmap:integer;

begin
DisplayDebugImgWindow(400,400);
points := getBlackSquare;
points := RemoveDistTPointArray(200, 200, 90, points, false);
bitmap := CreateBitmap(400,400);
DrawTPABitmap(bitmap,points,2927209);
DrawBitmapDebugImg(bitmap);
end.

Gala

2012-02-21 12:02:30

@masterBB

I think it works well. It gives a black circle within a green square.
This means it should work for my script :/ But when I Debug the TPAs or even the ATPAs there aren't any removed.

Gala

2012-02-21 12:16:38

Ups :/
I think RemoveDistTPointArray() works perfectly for me. (same for FilterPointsPie())
I just failed to give a variable to another procedure :S
Can be closed, thanks for your answers.