dot3d: Draw a mesh as points in 3D

Description Usage Arguments Details See Also Examples

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## S3 method for class 'sf'
dot3d(x, ...)

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

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

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

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

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

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

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

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

Arguments

x

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

...

pass material3d properties to rgl

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
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()

dot3d(silicate::SC(cad_tas))


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

anglr documentation built on July 29, 2020, 9:06 a.m.