toRGL: Conversion to 'rgl' mesh

View source: R/meshes.R

toRGLR Documentation

Conversion to 'rgl' mesh

Description

Converts a CGAL mesh (e.g. an output of the Mesh function) to a rgl mesh.

Usage

toRGL(mesh, ...)

Arguments

mesh

a CGAL mesh, that is to say a list of class "cgalMesh" (e.g. an output of the Mesh function); in order to be convertible to a rgl mesh, its faces must have at most four sides

...

arguments passed to mesh3d

Value

A rgl mesh, that is to say a list of class "mesh3d".

Examples

library(MeshesOperations)
library(rgl)
mesh <- Mesh(
  truncatedIcosahedron[["vertices"]], truncatedIcosahedron[["faces"]],
  triangulate = TRUE, numbersType = "lazyExact"
)
rglmesh <- toRGL(mesh, segments = t(mesh[["edges"]]))
open3d(windowRect = c(50, 50, 562, 562), zoom = 0.9)
shade3d(rglmesh, color = "darkred")

stla/MeshesOperations documentation built on Oct. 23, 2022, 8:23 a.m.