getMeshBox: compute the bounding box of a triangular mesh

View source: R/insideBBox.r

getMeshBoxR Documentation

compute the bounding box of a triangular mesh

Description

compute the bounding box of a triangular mesh

Usage

getMeshBox(mesh, tri = FALSE, extend = 0, pca = TRUE)

Arguments

mesh

triangular mesh of class "mesh3d"

tri

logical: if TRUE, triangular mesh representing the bounding box is returned

extend

numeric: offset extending the bbox (or shrinking if negative)

pca

if TRUE, the box will be aligned by the principal axes.

Value

returns a matrix with the corners of the box or a triangular mesh if tri=TRUE.

Examples

require(Rvcg)
data(humface)
bbox <- getMeshBox(humface)
## Not run: 
require(rgl)
spheres3d(bbox)

## End(Not run)
bbmesh <- getMeshBox(humface,tri=TRUE)
## Not run: 
shade3d(bbmesh,alpha=0.4)
wire3d(humface)

## End(Not run)

zarquon42b/mesheR documentation built on Jan. 28, 2024, 2:17 p.m.