Comments (7)
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.
> 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.
[deleted comment]
from poly2tri.
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.
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.
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.
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)
- Java source unbuildable in 1.7+
- Build failed when compliling with -we4715
- Java findbugs - nullcheck of value previously dereferenced HOT 1
- [java] Tessellation with hole error HOT 4
- Polygon with hole HOT 10
- [java] Missing triangle in non-constrained delaunay HOT 3
- Problem building library
- the EPSILON value is not exported in the python/cython version HOT 1
- Compilation fails with MSVC
- CMake build script
- Inconsistent behavior with holes that share a point HOT 17
- add typedef for "double"
- add typedef for std::vector<Point*>, std::vector<Triangle*> and other containers
- Triangulate crashes in sweep.cc:703 HOT 3
- java version compile error HOT 3
- Polygon.getHoles() missing HOT 5
- poly2tri crashes on a very simple geometry HOT 1
- crash with attached polygon HOT 2
- Crash when triangulating a polygon HOT 1
- crash with square polygon HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from poly2tri.