Code Monkey home page Code Monkey logo

Comments (10)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 3, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 3, 2024
duplicate sorry. There was an error in the first publishing.

Original comment by [email protected] on 20 Apr 2015 at 11:01

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 3, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 3, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 3, 2024
yes

Original comment by [email protected] on 20 Apr 2015 at 12:41

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 3, 2024
Can I replace == by .equals or there is a reason ?

Original comment by [email protected] on 20 Apr 2015 at 12:46

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 3, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 3, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 3, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 3, 2024
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)

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.