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

    Class OpenFrame

    An OpenFrame (Offener Rahmen / U-Profile) geometry.

    A U-shaped polygonal profile formed by an outer rectangular boundary of width $a$ and height $h$ with wall thickness $c$, leaving an open rectangular inner notch of inner width $b = a - 2c$ and inner height $i = h - c$.

    Can be rendered as a 2D planar polygon in the X-Z plane (when depth = 0) with normal (0, 1, 0), or as a solid 3D extruded U-beam prism (when depth > 0).

    Mathematical formulas:

    • Inner width: $b = a - 2c$
    • Inner height: $i = h - c$
    • Perimeter: $u = 2a + 4h - 4c = a + b + 2c + 2h + 2i$
    • Cross-sectional area: $A = c(2h + b) = c(2h + a - 2c) = 2ch + cb$
    • Volume (3D): $V = A \cdot t$
    • Total surface area (3D): $A_{\text{total}} = 2A + u \cdot t$

    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.

    depth: number

    Extrusion depth (t).

    height: number

    Outer height (h).

    thickness: number

    Wall thickness (c).

    width: number

    Outer width (a).

    • 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 2D cross-sectional area $A = c(2h + a - 2c)$.

      Returns number

    • Calculates the total surface area (2D area if depth = 0, or $2A + u \cdot t$ if depth > 0).

      Returns number