Learn R Programming

MeshesTools (version 1.0.0)

torusMesh: Torus mesh

Description

Triangle mesh of a torus.

Usage

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

Value

A triangle rgl mesh (class mesh3d).

Arguments

R, r

major and minor radii, positive numbers

nu, nv

numbers of subdivisions, integers (at least 3)

Examples

Run this code
library(MeshesTools)
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)

Run the code above in your browser using DataLab