Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

getOuterViewpoints

Get viewpoints on a sphere around a 3D mesh


Description

Get viewpoints on a sphere around a 3D mesh to be used with virtualMeshScan

Usage

getOuterViewpoints(x, n, inflate = 1.5, radius = NULL,
  subdivision = 3, PCA = FALSE)

Arguments

x

triangular mesh of class 'mesh3d'

n

number of viewpoint to generate

inflate

factor for the size of the sphere: inflate=1 means that the sphere around the object just touches the point farthest away from the mesh's centroid.

radius

defines a fix radius for the sphere (overrides arg inflate).

subdivision

parameter passed to vcgSphere

PCA

logical: if TRUE, the sphere will be deformed to match the principle axes of the mesh. NOTE: this may result in the sphere not necessarily completely enclosing the mesh.

Value

a list containing

viewpoints

n x 3 matrix containing viewpoints.

sphere

sphere from which the points are sampled

radius

radius of the sphere

Examples

data(boneData)
vp <- getOuterViewpoints(skull_0144_ch_fe.mesh,n=100)
## Not run: 
require(rgl)
shade3d(skull_0144_ch_fe.mesh,col="white")
spheres3d(vp$viewpoints)
wire3d(vp$sphere)

## End(Not run)
### Fit to principal axes
vppca <- getOuterViewpoints(skull_0144_ch_fe.mesh,n=100,PCA=TRUE,inflate=1.5)
## Not run: 
require(rgl)
shade3d(skull_0144_ch_fe.mesh,col="white")
spheres3d(vppca$viewpoints)
wire3d(vppca$sphere)

## End(Not run)

Morpho

Calculations and Visualisations Related to Geometric Morphometrics

v2.8
GPL-2
Authors
Stefan Schlager [aut, cre, cph], Gregory Jefferis [ctb], Dryden Ian [cph]
Initial release
2020-02-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.