File Structure - Voxel Cutaway World Generator
Version: 0.2.0
Date: 2026-03-08
Author: Rens Roosloot / Codex collaboration
1. Purpose
This document proposes the file and folder structure for the standalone Voxel Cutaway World Generator page.
The goal is to keep implementation isolated, static-first, and easy to evolve without mixing project-specific logic into unrelated site files.
2. Proposed Project Folder
Recommended runtime boundary:
site/voxel-cutaway-world/
Recommended initial structure:
site/voxel-cutaway-world/index.htmlsite/voxel-cutaway-world/css/voxel-cutaway-world.csssite/voxel-cutaway-world/js/main.jssite/voxel-cutaway-world/js/config.jssite/voxel-cutaway-world/js/seed.jssite/voxel-cutaway-world/js/world-generator.jssite/voxel-cutaway-world/js/world-rules.jssite/voxel-cutaway-world/js/mesh-builder.jssite/voxel-cutaway-world/js/materials.jssite/voxel-cutaway-world/js/scene.jssite/voxel-cutaway-world/js/camera.jssite/voxel-cutaway-world/js/ui.jssite/voxel-cutaway-world/js/theme.jssite/voxel-cutaway-world/assets/site/voxel-cutaway-world/docs/
3. Module Responsibilities
index.html
- page shell
- SEO metadata
- viewport container
- controls markup
- short explanatory copy
css/voxel-cutaway-world.css
- page-specific layout
- viewport sizing
- control panel styling
- theme-specific UI treatment
- responsive adjustments
js/main.js
- bootstraps page
- wires modules together
- handles initial render and regenerate flow
js/config.js
- chunk dimensions
- default seed behavior
- camera limits
- world generation constants
- theme defaults
js/seed.js
- seed normalization
- deterministic random helpers
js/world-generator.js
- creates block-grid world data
- runs ordered generation passes
js/world-rules.js
- terrain thresholds
- block placement rules
- tree rules
- ore rules
- cave and lava constraints
js/mesh-builder.js
- converts voxel grid to visible geometry
- omits hidden internal faces
js/materials.js
- defines materials/colors for block categories
- handles theme-dependent material adjustments if needed
js/scene.js
- renderer setup
- scene root
- lights
- chunk mount/update flow
js/camera.js
- orbit control setup
- zoom bounds
- camera reset framing
- mobile gesture support
js/ui.js
- regenerate button
- theme toggle
- seed display/input handling
- user feedback state
js/theme.js
- day/night lighting presets
- background changes
- reduced-motion-safe presentation toggles where needed
4. Optional Future Files
Only add when needed:
js/debug.jsjs/presets.jsassets/images/assets/data/sample-seeds.json
5. Structure Rules
- keep runtime-required files within
site/voxel-cutaway-world/ - keep project-specific styles out of global
site/styles.cssunless a shared pattern is genuinely reusable - keep generator logic separate from rendering logic
- keep UI state separate from world state
- avoid one oversized script file
6. Suggested Build Philosophy
- no build step required for MVP if avoidable
- plain modules preferred
- static hosting compatibility preserved at all times