Skip to main content

CylinderShape

From v4.2

A capped cylinder centered at the origin along the local Y axis.

Usageโ€‹

import {CylinderShape} from '@math.gl/geometry/culling';

const shape = new CylinderShape({height: 2, radiusBottom: 1, radiusTop: 0.5});

Constructorโ€‹

new CylinderShape(options?)โ€‹

OptionDefaultDescription
height2Full height between the caps; finite and positive.
radiusBottom0.5Radius at -height / 2; finite and nonnegative.
radiusTop0.5Radius at height / 2; finite and nonnegative.
matrixidentityOptional invertible affine local-to-world matrix.

Unequal radii produce a truncated cone. A zero radius produces a cone tip; at least one radius must be positive.

Queriesโ€‹

Implements the Shape interface, including containment, distance, ray and plane intersection, transforms, cloning, and enclosing bounds.

Dimensions and defaults align with the glTF 2.1 draft shape specification.