outsideBBox: get vertex indices of vertices outside a bounding box

View source: R/insideBBox.r

outsideBBoxR Documentation

get vertex indices of vertices outside a bounding box

Description

get vertex indices of vertices outside a bounding box

Usage

outsideBBox(x, corners, outside = TRUE)

Arguments

x

a k x 3 matrix or a triangular mesh of class "mesh3d"

corners

a 8 x 3 matrix defining the corners of a bounding box, or a triangular mesh of class "mesh3d" representing the meshBox

outside

logical: if TRUE the indices outside the box are returned, those inside

Value

returns the indices of coordinates inside/outside the bounding box.

Examples

require(Rvcg)
require(Morpho)

data(humface)
bbox <- getMeshBox(humface,extend=-0.2)
bboxmesh <-  getMeshBox(humface,extend=-0.2,tri=TRUE)
## Not run: 
require(rgl)
spheres3d(bbox)

## End(Not run)
outside <- outsideBBox(humface,bbox)
humshrink <- rmVertex(humface,outside)
## Not run: 
wire3d(humshrink,col=3)#inside
wire3d(humface,col=2)#outside
shade3d(bboxmesh,alpha=0.4)

## End(Not run)

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