torusMesh: Torus mesh

View source: R/someMeshes.R

torusMeshR Documentation

Torus mesh

Description

Triangle mesh of a torus.

Usage

torusMesh(R, r, nu = 50, nv = 30, rgl = TRUE)

Arguments

R, r

major and minor radii, positive numbers

nu, nv

numbers of subdivisions, integers (at least 3)

rgl

Boolean, whether to return a rgl mesh

Value

A triangle rgl mesh (class mesh3d) if rgl=TRUE, otherwise a cgalMesh list (vertices, faces, and normals).

Examples

library(MeshesOperations)
library(rgl)
mesh <- torusMesh(R = 3, r = 1)
open3d(windowRect = c(50, 50, 562, 562))
view3d(0, 0, zoom = 0.75)
shade3d(mesh, color = "green")
wire3d(mesh)

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