Comments (8)
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.
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.
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.
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.
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.
Oh, I see! Thanks!
Original comment by [email protected]
on 9 Feb 2010 at 6:58
from poly2tri.
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.
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)
- 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
- 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
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.