Cylinder
A 3D cylinder with configurable top and bottom radii (set different values for a truncated cone).
Usage
ts
import { createCylinder } from '@ripl/3d';
const cylinder = createCylinder({
radiusTop: 1,
radiusBottom: 1,
height: 2,
segments: 16,
fillStyle: '#cc8844',
});Properties
| Property | Type | Default | Description |
|---|---|---|---|
radiusTop | number | — | Radius of the top cap |
radiusBottom | number | — | Radius of the bottom cap |
height | number | — | Height of the cylinder |
segments | number | 16 | Number of radial segments |
x | number | 0 | X position |
y | number | 0 | Y position |
z | number | 0 | Z position |
rotationX | number | 0 | Rotation around X axis (radians) |
rotationY | number | 0 | Rotation around Y axis (radians) |
rotationZ | number | 0 | Rotation around Z axis (radians) |