hullMesh {cxhull} | R Documentation |
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)
Arguments
hull |
a 3d convex hull, output of |
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 |
Boolean, whether to return a rgl mesh (class
|
Value
A list giving the vertices and the faces, or a rgl mesh.
Note
Unless all faces are triangular, the output does not define a mesh with coherently oriented faces.
Examples
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")
[Package cxhull version 0.7.4 Index]