Module Box

Box shape factory function.

Functions

Box (width, height, depth, w_segments, h_segments, d_segments) Creates a menori.Mesh with a box geometry.


Functions

Box (width, height, depth, w_segments, h_segments, d_segments)
Creates a menori.Mesh with a box geometry. A box is a rectangular cuboid with configurable dimensions and subdivision segments.

Parameters:

  • width number Box width along the X-axis (default: 1)
  • height number Box height along the Y-axis (default: 1)
  • depth number Box depth along the Z-axis (default: 1)
  • w_segments number Number of segments along the width (default: 1)
  • h_segments number Number of segments along the height (default: 1)
  • d_segments number Number of segments along the depth (default: 1)

Returns:

    menori.Mesh A new menori.Mesh object containing the box geometry

Usage:

    -- Create a unit cube with default parameters
    local box = menori.Box()
    
    -- Create a box with custom dimensions
    local box = menori.Box(2, 3, 1)
    
    -- Create a subdivided box
    local box = menori.Box(1, 1, 1, 4, 4, 4)
    
    -- Create a ModelNode with box
    local model_node = menori.ModelNode(box)
generated by LDoc 1.5.0 Last updated 2025-08-18 00:01:40