Palace on Sylir: 3D architectural study

A standalone Three.js application for developing the garden hall's architecture. The interface contains camera controls and a screenshot button; proportions are defined in the source code. This is an editable structural model with schematic materials, not a finished palace asset. Offices are enclosed, unfurnished rooms. The conservatory has beds, shaped soil and paths; ground-floor planting, further decoration, gallery stairs and office furnishings are future layers.

Run locally

Requires Node.js 20.19+ or 22.12+. From this folder:

npm install
npm start

Open the local URL printed by Vite. Use npm run build for a production build, npm run preview to view that build, and npm test for the geometric invariants.

Explore

Paint the garden layout

Edit src/layout/garden-map.png in an image editor and save it as PNG. The current map is 960 × 1200 pixels, covering 48 × 60 metres at 20 pixels per metre. Top is the throne end; bottom is the entrance. Keep its 4:5 aspect ratio and the same framing.

Colour Meaning
Brown, #65513d A planting bed with a stone edge and shaped soil.
Sand, #c9c0aa Garden paving. Paint this through a bed to split it, or inside one to create an enclosed paved opening.
Light grey, #e0e2d9 Existing plain floor.
Teal, #5b9b9e Reference for the existing water. This colour does not remodel the basin.

Use solid colours and broad strokes. The importer tolerates modest edge antialiasing, simplifies pixel stair-steps and ignores regions smaller than 0.35 m². Give beds enough width for their 18 cm stone edging. Transparency is treated as unpainted floor. This is a plan mask, not a photograph or shaded paintover.

While npm start is running, saving the PNG or its configuration recompiles the layout and reloads the scene. No additional buttons are needed. npm run layout compiles it manually; tests and production builds compile it automatically. Invalid images report an error and leave the previous generated layout intact.

The pool, island foundation and bridge structures remain reusable geometry components. The importer clips bed shapes to their dry surfaces and preserves full-width bridge routes and gallery circulation. Teal is a painting guide for these fixed structures; repainting it alone does not move water or bridges. Soil crests are separately editable in src/layout/garden-map.json, so changing a bed outline does not pull its high point toward the centre.

The compiler is scripts/compile-garden-map.mjs; bitmap contour tracing is in scripts/map-contours.mjs. The generated src/layout/garden-layout.json is a reproducible mesh input, not the editing source. The application uses polygon-clipping for intersections and pngjs to read the PNG during development and builds.

Model proportions

Edit DEFAULTS and HALL in src/model.js to change the building. There are no building controls in the interface.

The central floor is 48 × 60 m, doubled from the original 24 m width. Both lower galleries move outward; the 5.5 m upper balconies retain their depth and the glass roof spans 59 m. There are still two occupied storeys at 5 m intervals. These are working dimensions, not setting canon or a certified structural design.

Files

Repeated architecture should come from components in src/components/, not separately edited copies. Edit the component source, and the dev server rebuilds all instances. Office copies share their geometry and materials; their row placement is handled by the hall model. The 7.5 m office module divides the unchanged 60 m hall into eight rooms per row. Pilasters and roof-support posts meet module boundaries so they do not cut through the wider windows.

Keep the interface simple and limited to camera positioning. Add buttons only when they have a concrete testing benefit. Do not restore the lower/upper gallery legend.

This folder has its own package and lockfile, and is excluded from the parent Eleventy site. It does not modify the main site's JavaScript dependencies.

Visual references and image studies are in ../output/imagegen/palace-visual-language-2026-09-18/; the design record is ../docs/manual/The Palace on Sylir - Visual Language.md. Rejected stepped ground-floor versions are not geometry references.

Technical references: Three.js documentation and Vite.