GithubHelp home page GithubHelp logo

Comments (8)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 17, 2024
Here is an XML-file for the example where the triangulation goes crazy.

Original comment by [email protected] on 9 Feb 2010 at 1:53

Attachments:

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 17, 2024
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 [email protected] on 9 Feb 2010 at 1:57

Attachments:

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 17, 2024
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 [email protected] on 9 Feb 2010 at 2:12

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 17, 2024
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 [email protected] on 9 Feb 2010 at 3:52

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 17, 2024
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 [email protected] on 9 Feb 2010 at 4:15

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 17, 2024
Oh, I see! Thanks!

Original comment by [email protected] on 9 Feb 2010 at 6:58

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 17, 2024
Need to add some validation code to input data that can be run optionally to 
detect 
input errors when triangulation fails.

Original comment by [email protected] on 17 Feb 2010 at 8:23

  • Changed state: Accepted
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 17, 2024
Marked this as fixed since it wasn't an error from the beginning :)

Original comment by [email protected] on 27 Aug 2010 at 10:20

  • Changed state: Fixed

from poly2tri.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.