Git Product home page Git Product logo

Comments (3)

DanielVandH avatar DanielVandH commented on May 29, 2024

What ended up being the problem @empet? If there's anything that was maybe unclear in the documentation for example that could be good for me to fix up.

from delaunaytriangulation.jl.

empet avatar empet commented on May 29, 2024

The docs are very good, but in an attempt to reproduce a surface triangulation I worked on a few years ago, with Delaunay.jl I made the following mistake:
The surface (x,y) ->f(x,y) was defined on the planar disk, D(0,2). Hence I started with:

r = collect(0.0:0.1:2)
θ = collect(0:π/30:2π)
x = vec(r * cos.(θ)')
y = vec(r * sin.(θ)')
z = f.(x, y)
pts=[[xe, ye] for (xe, ye) in zip(x,y)]
tri=triangulate(pts)

but got:

AssertionError: Duplicate points are not allowed.

Delaunay.jl as well as scipy.spatial.Delaunay work very well with non-unique points.
I replaced pts by unique(pts) and continued to transcribe the triangulation code for the former package, in terms of DelaunayTraingulation. But I plotted the triangulated surface using tri.triangles, and the points onto the surface corresponding to initial, non-unique pts, and obviuosly I got an ugly, non-smooth surface. When I clicked to send the formulated issue, I realized what was wrong.
So I started with r=collect(0.05:0.1, 2), that led to unique pts and the triangulated surface was perfect. :)
Final conclusion: DelaunayTrisngulation.jl is great!

from delaunaytriangulation.jl.

DanielVandH avatar DanielVandH commented on May 29, 2024

I see - yes duplicate points can be a bit of a hassle to handle, so I don't try and resolve it internally as is done in scipy.spatial.Delaunay (and hence Delaunay.jl). unique! might've saved you some trouble here too since it would just update pts inplace.

I had initially implemented it so that if duplicated points were detected, triangulate was re-called with skip_points set to be the points that were detected as duplicates, but I ended up deciding to leave it to the user to resolve these degeneracies rather than handling it within the package. Proceeding with them in the algorithm is also not good since it can cause some infinite loops.

Thanks for letting me know about the solution! Appreciate the feedback too :).

from delaunaytriangulation.jl.

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.