Giter VIP home page Giter VIP logo

Comments (3)

MIND0S avatar MIND0S commented on June 18, 2024

http://imgur.com/08OWFmp

It gets better if hole removed.
http://imgur.com/w2M3L3c

from twgeojson.

MIND0S avatar MIND0S commented on June 18, 2024

Fixed at 73dc0b1

The THREE.Shape.Utils.triangulateShape() can't work on polygon with holes and some concave polygon, like the area of New Taipei City.

It's known issue ( Thanks to yllan )
mrdoob/three.js#907
mrdoob/three.js#3386

I found the commented code : THREE.Shape.Utils.triangulate2(), and injected it into THREE.Shape.Utils as a replacement for triangulateShape(). The reason for injection instead of change Three.js is, the work was done before, but not subject for merge.

Then, the triangulation is broken again at New Taipei City and Hualien, since poly2try doesn't accept repeated vertices. So, I fixed it by adding filter functions with tolerance value.

We may ask if Three.js accept customised triangulation function, or to provide alternative option when poly2tri is present.

from twgeojson.

yllan avatar yllan commented on June 18, 2024

為何會有 repeated vertex 呢?是不是我們應該從原始 json 檔裡把這些重複的點清乾淨?

from twgeojson.

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.