Closed GoogleCodeExporter closed 9 years ago
Here is an XML-file for the example where the triangulation goes crazy.
Original comment by nyblom...@gmail.com
on 9 Feb 2010 at 1:53
Attachments:
Forgot to mention that the lines are supposed to be the constrained edges, but
you
might have figured that out anyway ;)
I also attached a file that shows the lines and the points.
Original comment by nyblom...@gmail.com
on 9 Feb 2010 at 1:57
Attachments:
I tried to perturb the input points randomly and this made it work. I guess
that the
problem has something to do with points that lies on the same line.
In the book "Numerical Recipies" the "fix" this in their Delaunay triangulator
by
randomness when this problem happens. They are not proud of it though :)
Original comment by nyblom...@gmail.com
on 9 Feb 2010 at 2:12
Sorry didn't notice this until now. Thought I would get an email or something
if a
bug was posted :).
I'll take a look. In constrained triangulation I know these errors can happen
if
there is duplicate points, eg two points with same coordinate.
Original comment by thahlen@gmail.com
on 9 Feb 2010 at 3:52
Yes I think I see the issue just by looking at the xml file.
Every polygon has the same start and end point defined. So you actually get two
points on the same coordinate and this will make my constrained implementation
confused. I can't easily detect the duplicate point issue in that code so I
would
have to add some verification code that checks the input for duplicates :). For
now
I assume the given input doesn't have duplicates.
If you look at the Polygon constuctor I have added this check to remove the
last
point from pointsets where the polygon is defined with a start and end point at
the
same position. Since I noticed several external polygon editors export polygons
with
duplicate points
if( points.get(0).equals( points.get(points.size()-1) ) )
{
points.remove( points.size()-1 );
}
So instead of perturbing your input points just do a simple check if first and
last
point on the polygon is the same and remove it.
Original comment by thahlen@gmail.com
on 9 Feb 2010 at 4:15
Oh, I see! Thanks!
Original comment by nyblom...@gmail.com
on 9 Feb 2010 at 6:58
Need to add some validation code to input data that can be run optionally to
detect
input errors when triangulation fails.
Original comment by thahlen@gmail.com
on 17 Feb 2010 at 8:23
Marked this as fixed since it wasn't an error from the beginning :)
Original comment by thahlen@gmail.com
on 27 Aug 2010 at 10:20
Original issue reported on code.google.com by
nyblom...@gmail.com
on 9 Feb 2010 at 12:16