dkborder: dkborder

View source: R/utility.R

dkborderR Documentation

dkborder

Description

Selects the border of a 3d triangle mesh.

Usage

dkborder(mesh)

Arguments

mesh

object of class mesh3d

Value

A vector of indices corresponding to the triangles with at least one vertex on the border of the mesh.

Examples

border <- dkborder(dkmodel$cusp)

# Map the border in orange:
is_border <- rep(1, Rvcg::nfaces(dkmodel$cusp))
is_border[border] <- 2
dkmap(dkmodel$cusp, is_border, col = c("white", "#E69F00"), col.levels = 2, legend = FALSE,
scalebar = FALSE, smooth = FALSE)

# Compare with vcgBorder from the R package Rvcg, in blue:
vcgborder <- which(Rvcg::vcgBorder(dkmodel$cusp)$borderit == TRUE)
is_border[vcgborder] <- 3
dkmap(dkmodel$cusp, is_border, col = c("white", "#E69F00", "#56B4E9"), col.levels = 3,
legend = FALSE, scalebar = FALSE, smooth = FALSE)
#As you can see, it all depends on what you want to select!


doolkit documentation built on Feb. 16, 2023, 11 p.m.