Comments (10)
Note, this is a bug on java version of Poly2Tri. This version does not throw
errors.
Original comment by [email protected]
on 20 Apr 2015 at 9:21
from poly2tri.
duplicate sorry. There was an error in the first publishing.
Original comment by [email protected]
on 20 Apr 2015 at 11:01
from poly2tri.
The thing is that this isn't a strictly simple polygon since both outer ring
and the hole shares a vertex. So this is a weakly simple polygon.
As long as this shared vertex is a single object the triangulator should have
no problems triangulating. If your polygon contain multiple shared vertexes
such that all the internal triangles can't form a single edge connected graph
the cleanup of external triangles will fail.
So poly2tri assumes that vertexes shared by hole and outer ring isn't shared,
but can handle it if you make sure they are the same object. Poly2tri's simple
way of cleaning away outside triangles also assumes that all inner triangles
are connected by atleast one edge so that they form a single graph.
Original comment by [email protected]
on 20 Apr 2015 at 12:30
- Changed state: WontFix
from poly2tri.
Do you mean that equality check in done with == instead of Object.equals ?
Original comment by [email protected]
on 20 Apr 2015 at 12:39
from poly2tri.
yes
Original comment by [email protected]
on 20 Apr 2015 at 12:41
from poly2tri.
Can I replace == by .equals or there is a reason ?
Original comment by [email protected]
on 20 Apr 2015 at 12:46
from poly2tri.
Since the points will contain data to build a connected graph during the
triangulation. Any input case where two different objects can have the exact
same coordinate the result of the triangulation is somewhat undefined. poly2tri
was written to assume that polygon is strictly simple and that there aren't two
objects with exactly same coordinate supplied in the input.
Original comment by [email protected]
on 20 Apr 2015 at 12:48
from poly2tri.
If you aren't sure all input polygons is strictly simple the solution would be
to hash the points of the outer ring. Then check if the hole points .equals any
of the outer points and replace duplicate points them with the already existing
object.
Original comment by [email protected]
on 20 Apr 2015 at 12:54
from poly2tri.
Ok. Then this could be a preprocessing step. Its true that == test is way more
faster than Object.equals.
I will change the code to check for duplicates into the method
Triangulatable.prepareTriangulation . Does its seems to be clean for you ?
Thanks,
Original comment by [email protected]
on 20 Apr 2015 at 1:01
from poly2tri.
I think I would do these test in the "external code" before adding the holes to
the poly2tri lib instead of altering the code in poly2tri.
It is a redundant test in every case when you know your polygons are strictly
simple, thats why I think this test should be done before adding the input to
the Polygon class.
But in this case you are changing your fork of the poly2tri lib, just for your
own usage with orbisgis. So where you add this test is up to you.
My best suggestion in this case would probably be to use this hash in Polygon
class and do the test every time you add a hole/steiner point.
Original comment by [email protected]
on 20 Apr 2015 at 1:47
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
- [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.