Cylinder
The Cylinder is a 3D primitive with configurable top and bottom radii — set different values to create a truncated cone. Segment count controls the smoothness of the circular cross-section. Like all 3D shapes, it supports positioning, rotation, and automatic flat shading.
NOTE
For the full API, see the 3D API Reference.
Demo
Usage
ts
import {
createCylinder,
} from '@ripl/3d';
const cylinder = createCylinder({
radiusTop: 1,
radiusBottom: 1,
height: 2,
segments: 16,
fill: '#cc8844',
});Properties
radiusTop— Radius of the top capradiusBottom— Radius of the bottom capheight— Height of the cylindersegments— Number of radial segments (default16)x/y/z— Position in world space (default0)rotationX/rotationY/rotationZ— Rotation around each axis in radians (default0)