Learn R Programming

fsbrain (version 1.0.0)

spheres.mesh: Compute the mesh of a set of spheres.

Description

Merges one slightly refined icosphere per sphere into a single mesh, i.e., the result is a single surface with one connected component per input sphere. This is much cheaper to render (and to convert for the scimesh backend) than a list of hundreds of separate sphere meshes.

Usage

spheres.mesh(centers, radii = 1, subdivisions = 2L)

Value

an fs.surface instance (a mesh) with one component per sphere.

Arguments

centers

n x 3 numeric matrix, the sphere centers.

radii

numeric vector of length n or a single number, the sphere radii.

subdivisions

non-negative integer, the number of subdivisions of the unit icosphere, see unit.icosphere. Defaults to 2L.

Examples

Run this code
  m = fsbrain:::spheres.mesh(rbind(c(0, 0, 0), c(10, 0, 0)), c(1, 2));
  nrow(m$vertices);

Run the code above in your browser using DataLab