Giter Club home page Giter Club logo

polytri's People

Contributors

bjorkegeek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

polytri's Issues

A case which does not triangulate properly

(As reported in an email from Charles Bradshaw)


I have been using your python polygon triangulate algorithm successfully for some time.

Mostly it works well, but if I present this polygon:

[ 1.0000, -0.5000,  1.0000]
[ 0.7500, -0.4330,  1.0000]
[ 0.5670, -0.2500,  1.0000]
[ 0.5000,  0.0000,  1.0000]
[ 0.5670,  0.2500,  1.0000]
[ 0.7500,  0.4330,  1.0000]
[ 1.0000,  0.5000,  1.0000]
[ 1.0000,  1.0000,  1.0000]
[-1.0000,  1.0000,  1.0000]
[-1.0000, -1.0000,  1.0000]
[ 1.0000, -1.0000,  1.0000]

I see the ValueError("Triangulation dot < 1E-20") , as the value of dot is zero. (I changed the value to 1E-20 to get a previous example to work)

I can make triangulate work by rotating the vertices so as to present some other point first. For example this:

[ 0.5000,  0.0000,  1.0000]
[ 0.5670,  0.2500,  1.0000]
[ 0.7500,  0.4330,  1.0000]
[ 1.0000,  0.5000,  1.0000]
[ 1.0000,  1.0000,  1.0000]
[-1.0000,  1.0000,  1.0000]
[-1.0000, -1.0000,  1.0000]
[ 1.0000, -1.0000,  1.0000]
[ 1.0000, -0.5000,  1.0000]
[ 0.7500, -0.4330,  1.0000]
[ 0.5670, -0.2500,  1.0000]

Produces a result. However it is wrong. Please see the attached showing the result of the latter data set. In the image the yellow lines and green points is the above polygon. The blue arrows show the winding order. The white lines are the triangles returned for your code. Some falling outside the original polygon!

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.