BBoxSlices: get slices from the bouding box

View source: R/insideBBox.r

BBoxSlicesR Documentation

get slices from the bouding box

Description

get slices from the bouding box (as triangular meshes).

Usage

BBoxSlices(box, axis = c(1, 2, 3), percent = 0.5)

Arguments

box

matrix, containing the 8 corners of a 3D-bounding box (e.g. generated by getMeshBox)

axis

integer: select the plane to place the slice. 1=y-z plane, 2 = x-z plane, 3 = x-y plane.

percent

offset from border. From lower to higher values of the orthogonal axis.

Value

mesh3d

Examples

require(Morpho);require(rgl)
data(boneData)
box <- getMeshBox(skull_0144_ch_fe.mesh,pca=FALSE)
shade3d(skull_0144_ch_fe.mesh,col="white")
for(i in 1:3) shade3d(BBoxSlices(box,axis = i,percent = 0.7),col=i+1)

## use BBoxSlices to cut a mesh
slice1 <- BBoxSlices(box,axis = 1,percent = 0.7)
sliceverts <- vert2points(slice1)
cutmesh <- cutMeshPlane(skull_0144_ch_fe.mesh,v1=sliceverts[1,],sliceverts[2,],sliceverts[3,])

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