Learn R Programming

anglr (version 0.7.0)

dot3d: Draw a mesh as points in 3D

Description

Draw points with rgl from any mesh-alike or shape3d classed object. Produces a 3D scatterplot like that of rgl::points3d(), but from a mesh-alike object.

Usage

# S3 method for sf
dot3d(x, ...)

# S3 method for sfc dot3d(x, ...)

# S3 method for Spatial dot3d(x, ...)

# S3 method for matrix dot3d(x, ...)

# S3 method for BasicRaster dot3d(x, ...)

# S3 method for sc dot3d(x, ...)

# S3 method for SC dot3d(x, ...)

# S3 method for SC0 dot3d(x, ...)

# S3 method for triangulation dot3d(x, ...)

Arguments

x

sc, sp, sf, raster, trip, or any other model understood by anglr/silicate

...

Details

The class mesh3d extends 'shape3d' and allows methods to plot non-surface properties. Note that dot3d() will always add to an existing scene.

It is not currently technically defined or clear how colour properties are mapped to dots by default ... there is a problem of what property to use from features that share the same vertex, and we have put that aside and erred on the side of inaccuracy in favour of getting a pretty plot (hopefully). (Properties that come later - lower rows - win, I think.

(For some reason size is not vectorized like col is, but this is not explored in detail from an anglr view).

See Also

as.mesh3d persp3d wire3d plot3d shade3d

Examples

Run this code
# NOT RUN {
dot3d(cad_tas)
dot3d(volcano, size = 10)
auto_3d()


rgl::open3d()
## from ?persp
y <- x <- seq(-10, 10, length= 80)
z <- outer(x, y,
     function(x, y) {
        r <- sqrt(x^2+y^2); 10 * sin(r)/r
        })
dot3d(z)
dot3d(raster::raster(volcano), size = 10)
auto_3d()
# }
# NOT RUN {
dot3d(silicate::SC(cad_tas))


rgl::open3d()
dot3d(as.mesh3d(copy_down(DEL(cad_tas, max_area = 1e3), "CID")))
auto_3d()
# }

Run the code above in your browser using DataLab