Hi Sven en Vincent,
Thanks for your hints. Indeed the dynamic
array was the problem. I have now replaced it by a linked list of
verts/edges/faces. It now works perfectly.
Regards, Darius
On 11 apr
'12, Sven Barth wrote:
> Am 10.04.2012 22:16, schrieb Vincent
Snijders:
>
>> Op 10 april
Vincent Snijders schrieb:
>> type
>> TVertex = record
>>x: double;
>>y: double;
>> end;
>> PVertex = ^TVertex;
>>
>> TEdge = record
>>v1: PVertex;
>>v2: PVertex;
>> end;
.
.
>> Result := @vert_list[vert_count - 1];
>
> I think this is not correct. If you increase the size of
Am 10.04.2012 22:16, schrieb Vincent Snijders:
Op 10 april 2012 22:06 heeft Darius Blaszyk
het volgende geschreven:
Here's a minimal example that has the bug. First of all the first output is
wrong as it says 0,50 instead of 20,50 (so the x item is overwritten). The
second printed output diffe
Op 10 april 2012 22:06 heeft Darius Blaszyk
het volgende geschreven:
> Here's a minimal example that has the bug. First of all the first output is
> wrong as it says 0,50 instead of 20,50 (so the x item is overwritten). The
> second printed output differs from the first, so again the x item is
Here's a minimal example that has the bug. First of all the first output is
wrong as it says 0,50 instead of 20,50 (so the x item is overwritten). The
second printed output differs from the first, so again the x item is
overwritten. I'm clueless.
program test;
{$mode objfpc}{$H+}
type
TVert
Can't reproduce with the following program:
type
TVertex = record
x: double;
y: double;
end;
PVertex = ^TVertex;
TEdge = record
v1: PVertex;
v2: PVertex;
end;
var
edge_count: LongWord = 0;
edge_list: array of TEdge;
procedure add_edge(v1, v2: PVertex);
begin
inc(