Just downloaded FreeSOLID from CVS and tried to run
sample.cpp. Compiled with MSVC 7.1. It gets stuck in
an infinite loop at test iter loop i=811. If you know
how to find out the translations and orientations used
from the debugger, I'd be happy to provide that info too.
The place it gets stuck is here in polygon.cpp:
Point Polygon::support(const Vector& v) const {
Scalar h = dot((*this)[ci], v), d;
int ni = ci < numVerts()-1 ? ci+1 : 0;
if ((d = dot((*this)[ni], v)) > h) {
do {
h = d; ci = ni;
if (++ni == numVerts()) ni = 0; <<< HERE
}
while ((d = dot((*this)[ni], v)) > h);
}
else {
ni = ci ? ci-1 : numVerts()-1;
while ((d = dot((*this)[ni], v)) > h) {
h = d; ci = ni;
if (ni) --ni; else ni = numVerts()-1;
}
}
return (*this)[ci];
}
Looking at the values involved some of it looks pretty
screwey:
this.polytope.index for instance contains these:
+ indices 0x3cc628da unsigned int *
count 1094312824 int
I highly doubt this polytope contains a billion vertices...
Looks like it could be memory corruption somewhere.
Logged In: YES
user_id=821871
Ok, I take it back about the garbage values. Turns out I
was picking up the release dll instead of the debug dll when
I was stepping through the debugger.
BUT.. once I got the debug dll in place, I found a curious
thing. These lines:
while ((d = dot((*this)[ni], v)) > h)
were causing the loops to continue even though when I typed
'd>h' in the watch window, the debugger told me it evaluated
to 'false'.
So it think it might be an optimizer error of some sort.
First I tried turning off optimization for polygon.cpp. No
luck. Still got stuck.
Then I noticed the "Floating-Point Consistency" option and
tried setting it to "Improve Consistency /Op" for just
polygon.cpp. THAT seems to do the trick.
FYI, here's my detailed compiler info from the "About" dialog.
Microsoft Visual C++ .NET 69462-270-0000007-18265