Giter VIP home page Giter VIP logo

Comments (14)

doc-E-brown avatar doc-E-brown commented on June 11, 2024 2

If it is helpful I'm preparing a delaunay triangulation trait in https://github.com/franklin-ai/geo/blob/8bae5523f7f7aeba0e8b8d11d9159a6a3c6bf0c3/geo/src/algorithm/triangulate_delaunay.rs which I'll be preparing for an upstream PR soon. We've had an internal need for this trait.

from geo.

urschrei avatar urschrei commented on June 11, 2024 1

Yeah: earcut is faster / offers higher-quality triangles on average (i.e. less chance of degenerate triangles), but some algorithms rely on a Delaunay triangulation, and it gives you a Voronoi tesselation "for free".

from geo.

RobWalt avatar RobWalt commented on June 11, 2024 1

@doc-E-brown looks cool! I'll give it a look. Note that we just integrated spade into master which also offers that functionality as well as constrained delaunay triangulations. Nevertheless your code looks promising as it seemingly doesn't need external dependencies and is also rather concise. Do you plan on working on more in that direction? If not I might take over the work of extending this at some point as I think it's quiet interesting and important! I'm looking forward to the PR! ❤️

from geo.

doc-E-brown avatar doc-E-brown commented on June 11, 2024 1

@doc-E-brown looks cool! I'll give it a look. Note that we just integrated spade into master which also offers that functionality as well as constrained delaunay triangulations. Nevertheless your code looks promising as it seemingly doesn't need external dependencies and is also rather concise. Do you plan on working on more in that direction? If not I might take over the work of extending this at some point as I think it's quiet interesting and important! I'm looking forward to the PR! ❤️

Hey @RobWalt sorry for the delay, but I've made the PR. It is located here #1144 and I've also added some perf comparisons.

Thanks!

from geo.

urschrei avatar urschrei commented on June 11, 2024

earcutr probably isn't viable as it doesn't provide Delaunay triangulation: this means we'd have to do more work if / when we wanted to implement Voronoi tesselation, as the Delaunay triangulation is the dual graph of the Voronoi diagram.

from geo.

frewsxcv avatar frewsxcv commented on June 11, 2024

Maybe we could offer both? DelauneyTriangulate and EarcutTriangulate? I use the latter for rending in rgis, and I assume it's faster? But I'm not so familiar with this area

from geo.

frewsxcv avatar frewsxcv commented on June 11, 2024

Also considering this will likely add another dependency (or more), we should consider putting this behind a Cargo feature flag.

from geo.

urschrei avatar urschrei commented on June 11, 2024

Also consider this will likely add another dependency (or more), we should consider putting this behind a Cargo feature flag.

Worth noting that Delaunator-rs wouldn't add any new deps (it only requires robust), and Spade would add two (optional and smallvec).

Earcutr only adds itertools.

We can make a call, but we aren't exactly blowing up our dependency graph with any two of these.

from geo.

frewsxcv avatar frewsxcv commented on June 11, 2024

I opened a draft PR for earcut triangulation: #1007

from geo.

RobWalt avatar RobWalt commented on June 11, 2024

I'm working on integrating spade now in #1083

from geo.

frewsxcv avatar frewsxcv commented on June 11, 2024

Both are implementations of Delauney triangulation right? I think it's worth doing a perf comparison of the implementations

from geo.

doc-E-brown avatar doc-E-brown commented on June 11, 2024

@RobWalt yes I just come across this thread with the integration of spade as usual after I finished my work, lol 😄. The Delaunay triangulation was a means of computing Voronoi diagrams which I'm in the middle of testing and you can find here https://github.com/franklin-ai/geo/blob/8bae5523f7f7aeba0e8b8d11d9159a6a3c6bf0c3/geo/src/algorithm/voronoi_diagram.rs, similarly I'm aiming to submit this as a PR.

@frewsxcv a perf comparison would be interesting, I definitely didn't go for all out performance on my implementation but rather simplicity and ideally low maintenance.

from geo.

urschrei avatar urschrei commented on June 11, 2024

Spade has a perf comparison which should be a good guide. It's also worth noting that triangulations that don't use robust predicates will be unreliable for many edge cases (no pun intended) – the robust crate (which you're already pulling in if you use geo) will take care of that.

from geo.

frewsxcv avatar frewsxcv commented on June 11, 2024

Spade and Earcutr are now integrated

from geo.

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.