Coder Social home page Coder Social logo

Comments (3)

epipping avatar epipping commented on September 22, 2024

I was puzzled by the fact that more than one hole wasn't properly triangulated at some point as well. Then I noticed that transposing H fixed the issue for me. If I continue to work with such a transposed H, I now get an error (albeit fortunately a rather helpful one). So even though the previous solution maybe shouldn't have worked, this is actually a bit of a breaking change...

The issue even goes a bit further: The case of no holes now needs to be special cased. I'm generating my list of holes through rgeos::gPointOnSurface(...)@coords inside sapply. To address the aforementioned issue, I now need to transpose the result. But if sapply is applied to an empty list, I'll get an empty list in return (previously an acceptable H), which is unchanged by t(), yet the pslg() constructor will always make sure the number of columns is equal to 2 now while the empty list has no columns.

Maybe it would be a good idea to carry out the number-of-columns check only after H is found to contain anything at all so that I don't need to pass a matrix(ncol=2,nrow=0)? I thought I'd at least suggest it...

from rtriangle.

davidcsterratt avatar davidcsterratt commented on September 22, 2024

Oh dear, I'd not realised this would break some things. However, the fix does now mean that pslg() is doing what it's documented to do. I'm a little anxious about adding sanitisation of empty lists, as I then feel I might need to document it. Also, perhaps then it would make sense to supply options for giving lists of hole coordinates... However, I'd be open to suggestions for patches.

from rtriangle.

mdsumner avatar mdsumner commented on September 22, 2024

Fwiw I post-process holes by testing if any triangle centroid falls in a hole, it's pretty efficient. This is in r-gris/trimesh in the tri_mesh function. It's not ready for general use yet but getting close.

from rtriangle.

Related Issues (15)

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.