Files
metabuilder/gameengine/python/generate_cube_stl.py
johndoe6345789 6fbc47a2db feat: Add SDL3CPlusPlus game engine to gameengine/
Import SDL3CPlusPlus C++ game engine with:
- SDL3 + bgfx rendering backend
- Vulkan/Metal/DirectX shader support
- MaterialX material system
- Scene framework with ECS architecture
- Comprehensive test suite (TDD approach)
- Conan package management
- CMake build system

This provides the native C++ foundation for the Universal Platform's
Game and 3D capability modules.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 16:29:20 +00:00

46 lines
1.1 KiB
Python

#!/usr/bin/env python3
"""Produce a cube STL with CadQuery for the Lua scene to load."""
from __future__ import annotations
import argparse
from pathlib import Path
import cadquery as cq
from cadquery import exporters
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(description="Generate a simple cube STL.")
parser.add_argument(
"--size",
type=float,
default=2.0,
help="Edge length of the cube in model units (default: 2.0 to match Lua cube bounds).",
)
parser.add_argument(
"-o",
"--output",
type=Path,
default=Path(__file__).parent / "models" / "cube.stl",
help="Path to write the ASCII STL file.",
)
return parser.parse_args()
def main() -> None:
args = parse_args()
args.output.parent.mkdir(parents=True, exist_ok=True)
cube = cq.Workplane("XY").box(args.size, args.size, args.size)
exporters.export(
cube,
str(args.output),
exportType=exporters.ExportTypes.STL,
opt={"ascii": True},
)
print(f"Wrote cube STL to {args.output}")
if __name__ == "__main__":
main()