Giter Site home page Giter Site logo

Comments (7)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 3, 2024
That file contains 3 different polygons and I have no problem triangulating 
them.

What is weird in your additional information is triangle t, it seems to contain 
2 points from the second triangle set and one point from the first. Maybe you 
are adding the point to a list without clearing it between triangulations?

Also the triangulation lib assumes all input polygons is simple non self 
intersecting. So it will fail if you have multiple points on the exact same 
coordinate or add holes that share points with the polygon.

Since validation of all input hits performance the only duplicate points that 
are removed is if first and last point is the same in a given polygon. Other 
validation will have to be done prior to triangulation. I also sorry that 
Poly2Tri does not include a polygon validation tool at this time.

Original comment by [email protected] on 13 Nov 2010 at 9:50

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 3, 2024
> Maybe you are adding the point to a list without clearing it between 
triangulations?
I don't unterstand what you mean. I create a new PolygonPoint for every point I 
have and add them to a list. Then I pass the list as argument to the polygon 
constructor.

> Also the triangulation lib assumes all input polygons is simple non self 
intersecting.
>So it will fail if you have multiple points on the exact same coordinate or 
add holes that share points with the polygon.
Yes that is exactly what I do. Is there a possibility to enhance your library 
to handle holes that have one point in common with the polygon? Because I think 
that are also valid polygons, that are quite common and in some simple test 
cases your library already triangulates this polygons fine.

Original comment by [email protected] on 15 Nov 2010 at 8:37

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 3, 2024
[deleted comment]

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 3, 2024
In the polygon.txt file you sent there are 3 separate polygons. 

Neighter one of the polygons contains the three points in your debug info.
t = [[1.6474112E8,6.10009088E8], [1.6474112E8,6.09992704E8], 
[1.64839424E8,6.0997632E8]]

Point 1.6474112E8,6.10009088E8 is in the second polygon and so is 
1.6474112E8,6.09992704E8. Tho 1.64839424E8,6.0997632E8 is part of the first 
polygon in polygon.txt

In some way you send in the points for multiple polygons as one polygon to the 
triangulator, atleast if you use the data in the polygon.txt file?



Original comment by [email protected] on 15 Nov 2010 at 8:53

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 3, 2024
In the polygon.txt is only defined one polygon. The first polygon is the shell 
and the other two polygons are holes of the first polygon.

Original comment by [email protected] on 15 Nov 2010 at 11:32

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 3, 2024
I was translating and scaling the input coordinates and then triangulating, 
just so I could display the result on the screen. Then I had no issues. 
I did just something simple like this:
list.add(new PolygonPoint(1647 - data[i]/1e5, 6099 - data[i+1]/1e5));

Now I tried plugging in the large values and then I get the same error as you.

I'm no expert on floating point operations so I'm not really sure why this 
difference.


Original comment by [email protected] on 15 Nov 2010 at 1:43

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 3, 2024
Did you try to normalize your coordinate range around 0 before triangulation 
for better precision?

I'm closing this issue since I have found no bugs in the lib.

Original comment by [email protected] on 21 Nov 2010 at 3:14

  • Changed state: WontFix

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.