MeshesUnion | R Documentation |
Computes the union of the given meshes.
MeshesUnion(meshes, clean = TRUE, normals = FALSE)
meshes |
a list of meshes, each being either a
rgl mesh, or as a list with (at least) two fields:
|
clean |
Boolean, whether to clean the meshes (merging
duplicated vertices, duplicated faces, removing isolated vertices);
set to |
normals |
Boolean, whether to return the per-vertex normals of the output mesh |
A triangle mesh given as a list with fields vertices
,
faces
, edges
, exteriorEdges
, gmpvertices
if using gmp meshes, and normals
if normals=TRUE
.
library(Boov) library(rgl) # mesh one: a cube mesh1 <- cube3d() # (from the rgl package) # mesh two: another cube mesh2 <- translate3d( # (from the rgl package) cube3d(), 1, 1, 1 ) # compute the union umesh <- MeshesUnion(list(mesh1, mesh2)) # plot rglumesh <- toRGL(umesh) open3d(windowRect = c(50, 50, 562, 562)) shade3d(rglumesh, color = "red") plotEdges( vertices = umesh[["vertices"]], edges = umesh[["exteriorEdges"]], edgesAsTubes = TRUE, verticesAsSpheres = TRUE )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.