hypertidy / anglr

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

de-normalization of DEL vertices for Z #43

Open mdsumner opened 7 years ago

mdsumner commented 7 years ago

Everything is filtered out as being a hole, why? What about sc?

library(sf)
f <- "maps.nyc.gov/download/3dmodel/DA_WISE_Multipatch/DA_WISE_Multipatch/DA10_3D_Buildings_Multipatch.gdb"
d <- read_sf(f)

r <- rangl(d[1:10, ])
mdsumner commented 6 years ago

I see

library(sf)

f <- "/rdsi/PRIVATE/raad/data_staging/maps.nyc.gov/download/3dmodel/DA_WISE_Multipatch/DA_WISE_Multipatch/DA10_3D_Buildings_Multipatch.gdb"
d <- read_sf(f)

r <- anglr(d[1:10, ])

Error in RTriangle::pslg(P = as.matrix(x[["vertex"]][c("x_", "y_")]),  : 
                           Duplicated vertices in P. 

I think we have to dump distinct/group_indices again?

Alternatively, maybe Triangle internally would agree with the definition of unique, since this is stopped at the R level?

mdsumner commented 6 years ago

The problem is simply that the polygons are duplicated in XY, there's a different value of Z for copy of a path in each layer.

SC and TRI both work fine with this already: http://rpubs.com/cyclemumner/367010

So, this is a fix for the DEL model - it will have to split on layer, or otherwise just point to TRI - we only need poor quality triangles anyway.

mdsumner commented 4 years ago

Also look at the NotEqual argument to rgl::as.mesh3d() - that might be a neater way to break the mesh.