Torus
The torus() function creates a ring-shaped torus. Control the main radius and tube radius
to shape the ring.
torus(60, 20).color("goldenrod").shaded();
Returns the Torus object:
Torus
Example usage:
torus.radius(1.5).tubeRadius(0.4).color("goldenrod");
field
mesh: THREE.Mesh<THREE.TorusGeometry>
The THREE.Mesh instance representing this object.
Example
torus.mesh.rotation.y = Math.PI / 8;
method
pos(position: Vec3): Torus
Set the position of the object.
param position
A vector-like object representing the position.Example
torus.pos([0, 1, 0]);
method
color(color: THREE.ColorRepresentation): Torus
Set the color of the object.
param color
A color input for this object.Example
torus.color("seagreen");
method
material(material: THREE.Material): Torus
Set the material of the object.
param material
A THREE.Material instance.Example
torus.material(new THREE.MeshStandardMaterial());
method
shaded(): Torus
Configures the object to use a shaded material.
Example
torus.shaded();
method
radius(radius: number): Torus
Sets the radius of the torus.
param radius
The new radius of the torus.Example
torus.radius(2);
method
tubeRadius(tubeRadius: number): Torus
Sets the tube radius of the torus.
param tubeRadius
The new tube radius of the torus.Example
torus.tubeRadius(0.5);
method
radialSegments(radialSegments: number): Torus
Sets the number of radial segments of the torus.
param radialSegments
The new number of radial segments.Example
torus.radialSegments(24);
method
tubularSegments(tubularSegments: number): Torus
Sets the number of tubular segments of the torus.
param tubularSegments
The new number of tubular segments.Example
torus.tubularSegments(64);