hypertidy / anglr

Mesh creation and topology for spatial data (and not just geographic)
https://hypertidy.github.io/anglr/
83 stars 10 forks source link

safety catch for sf triangles #134

Closed mdsumner closed 4 years ago

mdsumner commented 4 years ago

We need to avoid putting sf through the DEL0 mill if everything is already a triangle, this happens in as.mesh3d.sfc and as.mesh3d.sf, as might occur from sfdct or from a decido sf maker.

## check maybe it's all triangles
## is a GEOMETRYCOLLECTION and 
if (all(rapply(x$geometry, function(x) dim(x)[1], classes = "matrix", how = "unlist") == 4L)) {
## or is a TIN
go_directly_to_mesh3d(x$geometry)
} else {
as.mesh3d(DEL0(x, ))  
}

something like that.

mdsumner commented 4 years ago

done in silicate, anglr will use TRI0 for sf generally (because they are planar so using DEL is more of an opt-in than a sensible default)