Learn R Programming

cxhull (version 0.7.4)

hullMesh: Mesh of a 3d convex hull

Description

Extract the vertices and the faces from a 3d convex hull.

Usage

hullMesh(hull, simplify = TRUE, rgl = FALSE)

Value

A list giving the vertices and the faces, or a rgl mesh.

Arguments

hull

a 3d convex hull, output of cxhull

simplify

Boolean, whether to return the faces as a matrix instead of a list if possible, i.e. if all faces have the same number of edges; this argument is possibly ignored if rgl=TRUE, see below

rgl

Boolean, whether to return a rgl mesh (class mesh3d) if possible, i.e. if each face has three or four edges; if TRUE and the rgl mesh is possible, then the simplify argument has no effect

Examples

Run this code
library(cxhull)
hull <- cxhull(daVinciSphere)
septuaginta <- hullMesh(hull, rgl = TRUE)
library(rgl)
open3d(windowRect = c(50, 50, 562, 562))
shade3d(septuaginta, color = "darkred")
# some quad faces are misoriented:
open3d(windowRect = c(50, 50, 562, 562))
shade3d(septuaginta, color = "tomato", back = "culled")

Run the code above in your browser using DataLab