generate_sphere: Generate a sphere mesh

View source: R/mesh_utils.R

generate_sphereR Documentation

Generate a sphere mesh

Description

Creates a UV sphere centred at center with the given radius. The sphere is subdivided into segments rings and segments per ring.

Usage

generate_sphere(center, radius = 1, segments = 32, color = c(1, 1, 1, 1))

Arguments

center

Length-3 vector: sphere centre.

radius

Sphere radius.

segments

Subdivision count (default 32).

color

Length-4 RGBA colour.

Value

A mesh descriptor list.

Examples

mesh <- generate_sphere(c(0, 0, 0), radius = 1.5, segments = 32)
nrow(mesh$vertices)


scimesh documentation built on Aug. 9, 2026, 9:07 a.m.