Understand the Mapgen4 codebase structure
mainThe project is written in TypeScript and uses esbuild for building (note: esbuild does not perform type checking; use an IDE for type safety). The core logic is distributed across the following files:
mapgen4.ts: The main entry point.map.ts: Contains the map generation algorithms.dual-mesh/: Contains the main data structures.painting.ts: Handles input painting logic.render.ts: Handles output rendering.worker.ts: Contains calculation logic for workers.geometry.ts: Contains calculations shared between the worker and the renderer.