Small World Engine API Reference - v0.78.00
    Preparing search index...

    Class HollowCylinder

    A hollow cylinder geometry (Hohlzylinder / cylindrical shell / pipe).

    Implements exact geometry generation for hollow cylinders with distinct surface normals for the outer wall, inner wall, top annular cap, bottom annular cap, and optional cut-plane end caps for partial sectors (thetaLength < 2π).

    Mathematical formulas:

    • Outer radius $r_1$, Inner radius $r_2$, Wall thickness $b = r_1 - r_2$, Height $h$
    • Volume: $V = \pi \cdot (r_1^2 - r_2^2) \cdot h$
    • Lateral area: $M = 2\pi \cdot (r_1 + r_2) \cdot h$
    • Total surface area: $A = 2\pi \cdot (r_1 + r_2) \cdot (r_1 - r_2 + h)$

    Hierarchy (View Summary)

    Index
    _cachedBoundingVolume: BoundingVolume | undefined = undefined

    Cached bounding volume to prevent re-allocation

    _indices:
        | Uint16Array<ArrayBufferLike>
        | Uint32Array<ArrayBufferLike>
        | undefined = undefined

    The indices of the geometry for indexed rendering.

    _isLineGeometry: boolean = false

    Whether the geometry is purely line-based.

    _joints?: Float32Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> = undefined

    Optional skinning joints (4 IDs per vertex).

    _normals: Float32Array = ...

    The normals of the geometry (nx, ny, nz).

    _tangents: Float32Array = ...

    The tangents of the geometry (tx, ty, tz).

    _uvs: Float32Array = ...

    The UV coordinates of the geometry (u, v).

    _vertices: Float32Array = ...

    The vertices of the geometry (x, y, z).

    _weights?: Float32Array<ArrayBufferLike> = undefined

    Optional skinning weights (4 weights per vertex).

    _wireframeIndices:
        | Uint16Array<ArrayBufferLike>
        | Uint32Array<ArrayBufferLike>
        | undefined = undefined

    The indices for wireframe rendering.

    height: number

    The total height (h).

    heightSegments: number

    The number of height subdivisions.

    openEnded: boolean

    Whether the cylinder ends are open (no caps).

    radialSegments: number

    The number of radial subdivisions.

    radiusInner: number

    The inner radius (r2).

    radiusOuter: number

    The outer radius (r1).

    thetaLength: number

    The central angle in radians.

    thetaStart: number

    The start angle in radians.

    • Helper method to create an appropriately sized index array. Automatically chooses between 16-bit and 32-bit indices based on vertex count.

      Parameters

      • indexCount: number

        The number of indices needed.

      Returns Uint16Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>

      A Uint16Array or Uint32Array.

    • Calculates the lateral / mantle surface area $M = \frac{\theta_{\text{len}}}{2\pi} \cdot 2\pi (r_1 + r_2) h$.

      Returns number

    • Calculates the volume $V = \frac{\theta_{\text{len}}}{2\pi} \cdot \pi (r_1^2 - r_2^2) h$.

      Returns number