Module Sphere

Sphere shape factory function.

Functions

Sphere (radius, v_segments, h_segments) Creates a menori.Mesh with a sphere geometry.


Functions

Sphere (radius, v_segments, h_segments)
Creates a menori.Mesh with a sphere geometry.

Parameters:

  • radius number Sphere radius (default: 1)
  • v_segments number Number of vertical segments (default: 16)
  • h_segments number Number of horizontal segments (default: 32)

Returns:

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

Usage:

    -- Create a sphere with default parameters
    local sphere = menori.Sphere()
    
    -- Create a sphere with radius 2
    local sphere = menori.Sphere(2)
    
    -- Create a low-poly sphere with custom segment counts
    local sphere = menori.Sphere(1, 4, 8)
    
    -- Create a ModelNode with sphere
    local model_node = menori.ModelNode(sphere)
generated by LDoc 1.5.0 Last updated 2025-08-18 00:01:40