Learn R Programming

MeshesOperations (version 0.1.0)

toRGL: Conversion to 'rgl' mesh

Description

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

Usage

toRGL(mesh, ...)

Value

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

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

Examples

Run this code
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")

Run the code above in your browser using DataLab