| layer3D.mesh {ivue} | R Documentation |
A Triangular Surface Layer
Description
Draw supplied triangular faces using the plotting coordinates. This layer does not construct a triangulation or change a graph used for analysis.
Usage
layer3D.mesh(
triangles,
col = "gray75",
alpha = 0.2,
edges = TRUE,
edge.col = "gray45",
edge.alpha = 0.35,
edge.width = 1,
lit = FALSE
)
Arguments
triangles |
Numeric matrix with three columns of one-based vertex indices, one face per row. Indices refer to the plot's X, after vertex-ID alignment for graph plots. Empty matrices are allowed. Repeated vertices within a face and duplicate faces (including reversed faces) are rejected. |
col |
Face colors, length one or one per triangle. Colors are constant within each face; they do not inherit the point color scale. |
alpha |
Face opacity multiplier, length one or one per triangle, in
|
edges |
Draw mesh edges. Each undirected edge is drawn once, even when shared by two faces. |
edge.col |
Single mesh-edge color. |
edge.alpha |
Mesh-edge opacity multiplier in |
edge.width |
Positive mesh-edge width in screen units. |
lit |
Apply rgl lighting to faces. FALSE keeps face colors independent of orientation. Both sides are drawn; consistent face winding is advisable when enabling lighting. |
Details
The same layer can be reused with different coordinates as long as vertex identities and row order are preserved. Connectivity is never recomputed after embedding. Geometrically collapsed or collinear triangles are retained: the layer does not repair folds, degeneracies, intersections, or inconsistent orientation. It does not require a manifold mesh.
Faces are planar interpolations between vertices, not an exact smooth surface or a new shortest-path graph. Rendering requires rgl; constructing the layer does not. A polygon offset reduces interference between faces and their edge overlay. Transparency is handled by the renderer and can have ordering artifacts for intersecting surfaces.
Value
An ivue_layer specification for the layers argument.
See Also
layer3D.surface(), layer3D.edges(), layer3D.axes(), plot3D.cont()
Examples
triangles <- rbind(c(1, 2, 3), c(1, 3, 4))
surface <- layer3D.mesh(triangles, alpha = 0.2)
if (nzchar(system.file(package = "rgl"))) {
X <- rbind(c(-1, -1, 0), c(1, -1, 0), c(1, 1, 1), c(-1, 1, 0))
w <- plot3D.plain(X, layers = list(surface, layer3D.axes()),
camera = camera.zup())
}