Equana

Back to 3D Visualization (VTK)

vtk.sphere

Create sphere geometry

Syntax

vtk.sphere()
vtk.sphere(radius)
vtk.sphere(radius, center)
vtk.sphere(radius, center, resolution)

Description

Creates a VTK sphere source with specified radius, center, and resolution. Useful for quick testing and demonstrations.

Parameters

NameDescription
radius(optional)Sphere radius (default: 1)
center(optional)3-element vector [x, y, z] for center (default: [0,0,0])
resolution(optional)Number of phi/theta divisions (default: 32)

Returns

null (renders sphere inline)

Examples

Try It
>> vtk.sphere()  % unit sphere at origin
Try It
>> vtk.sphere(2, [1 0 0], 64)  % radius 2, centered at (1,0,0), high resolution

See Also