Browser-based 3D planner for shade sails (Sonnensegel)
Visualizes shadow casting, sail orientation, and furniture shading at any time of day and year.
| Full Application | 3D View |
|---|---|
![]() |
![]() |
| Control Panel โ Garden & Time | Posts & Sails |
|---|---|
![]() |
![]() |
| Furniture Settings | Shadow & Daily Analysis |
|---|---|
![]() |
![]() |
Screenshots: Shade sail over garden furniture, summer morning, Freudenstadt
| ๐ก Real garden | Width, depth, 4 individually adjustable wall heights, north offset |
| โ๏ธ Accurate sun | Astronomically correct via SunCalc โ location, date, time |
| ๐ชต 6 anchor posts | Direct X/Y/H input, color-coded, toggleable 3D labels |
| โต Up to 2 sails | Triangle or rectangle, any size and color |
| ๐ต Auto-orientation | Horn quaternion best-fit: sail hangs correctly between posts automatically |
| ๐ Shadow area | Live calculation in mยฒ per sail, clipped to garden boundary |
| ๐ Daily analysis | Integrated shadow area 10โ18h in mยฒยทh per sail |
| ๐ช Furniture shading | Table, chairs, pergola: shows whether each piece is in shade or sun |
| ๐ง Person figure | Draggable human figure with adjustable height (default 1.9 m) for scale reference |
| ๐ฑ๏ธ Click-to-scroll | Click any 3D element to scroll the settings panel to its controls |
| ๐ข Comma decimals | All numeric inputs accept German-style comma decimal separator |
| ๐ฌ Time animation | Play shadow movement across 24 hours |
| ๐ Multilingual | DE / EN / RU โ switchable at runtime |
| ๐พ Auto-save | localStorage + JSON export/import |
| ๐ฏ Sail optimizer | Auto-places sails for maximum shadow on seating area (sun-tilt, raster + hill-climb, two-phase) |
| ๐ Evaluation rectangle | Draw a custom seating zone; optimizer and analysis target it |
| ๐ Union shadow analysis | Overlapping sail areas counted only once; overlap waste shown as warning |
| ๐ Diversification optimizer | Top-K best Sail-1 positions ร best Sail-2 per Sail-1 for true joint coverage |
| โฉ๏ธ Undo / Redo | 40-step history ring buffer |
# Option A: open directly (Chrome recommended)
open index.html
# Option B: local server (if file:// issues in Safari)
python3 -m http.server 8080
# โ Browser: http://localhost:8080No build tool, no npm, no installation.
Only requirement: internet connection on first open (CDN libraries).
โ nomiknomik.github.io/shade-sail-simulator
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ index.html (everything in one file) โ
โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Control โ โ Three.js 3D Scene โ โ
โ โ Panel โโโโโถโ Garden ยท Posts ยท Sails โ โ
โ โ (left โ โ Furniture ยท Shadows โ โ
โ โ side) โ โ โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโผโโโโโโโโโโ โ
โ โ SunCalc Library โ โ
โ โ Azimuth+Elevation โ โ
โ โ (real-time) โ โ
โ โโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
| Action | Input |
|---|---|
| ๐ Rotate camera | Left mouse button + drag |
| ๐ Zoom | Mouse wheel |
Right mouse button + drag |
|
| โ Move sail | Left mouse button on sail + drag |
| โฒ โณ Rotate corner assignment | Buttons in post panel |
| ๐ Double-click slider | Reset to default value |
| ๐ฑ๏ธ Move furniture | Left mouse button on furniture + drag |
| ๐ง Move person | Left mouse button on person + drag |
| ๐ฏ Click โ settings | Click any 3D element to scroll panel to its settings |
Each post is positioned relative to the reference point (fixed at garden corner 3, +X/+Y). Enter X offset, Y offset, and absolute height H in meters.
Post input:
X (m) โ horizontal offset from reference point
Y (m) โ depth offset from reference point
H (m) โ absolute height above ground
Rope lengths are calculated outputs, not inputs โ they update live as you adjust posts.
| Library | Version | Purpose |
|---|---|---|
| Three.js | 0.160 | 3D rendering, PCFSoft Shadow Maps |
| SunCalc | 1.9 | Astronomical sun position |
| Vanilla JS | ES2022 | No framework, no build tool |
Sail algorithm: Horn quaternion best-fit registration.
Minimizes residuals between post positions and sail corners while keeping sail dimensions fixed.
The root coordinate system is relative to the user-defined reference point โ matching how laser distance meter measurements are naturally taken.
shade-sail-simulator/
โโโ index.html โ complete app (~1716 lines)
โโโ README.md โ this file
โโโ DEVELOPER.md โ technical reference for contributors
โโโ CLAUDE.md โ AI context for Claude Code
โโโ ToDo.md โ change-request queue
โโโ JSON/ โ saved garden setups (JSON export/import)
โโโ screenshots/ โ app screenshots (see SCREENSHOTS.md)
Garden: 9.5 ร 9.5 m ยท all 4 walls 3 m ยท North 229ยฐ
Location: Freudenstadt, DE (48.4636ยฐ N / 8.4111ยฐ E)
Post 1 ๐ด X= 0.0 Y= 0.0 H=2.9 m
Post 2 ๐ X= โ7.0 Y= 0.0 H=3.0 m
Post 3 ๐ก X= โ9.5 Y= 0.0 H=3.0 m
Post 4 ๐ข X= โ6.2 Y= โ9.5 H=2.5 m
Post 5 ๐ต X= 0.0 Y= โ9.5 H=2.5 m
Post 6 ๐ฃ X= 2.5 Y= 7.5 H=3.0 m
Sail 1: Triangle 6.4 / 8.0 / 4.0 m ยท Posts 4โ5โ1
Sail 2: (disabled)
- Draggable posts โ move posts with mouse (like sail drag)
- Triangle validation โ warning for invalid side lengths (a+b < c)
- Rope slack warning โ when sail is significantly smaller than post spacing
- Additional furniture / objects (parasol, plant pots)
- Obstacles (house wall, tree)
- Sail is a flat rigid panel โ no sag/catenary (by design)
- Shadow area is clipped to garden boundary via Sutherland-Hodgman algorithm
- Furniture shade test uses one measurement point per object (not entire surface)
- Sail drag is horizontal only (no height change via mouse)
| Version | Changes |
|---|---|
| 5.8 | Diversification optimizer: Top-K best Sail-1 positions ร best Sail-2 per Sail-1, maximises joint coverage; free-posts mode (optimizer doesn't force posts to garden wall) |
| 5.3 | Union-based shadow analysis โ overlapping areas counted only once; overlap waste (mยฒยทh) highlighted as warning |
| 5.2 | Coarse-to-fine KPI refinement (polishKPI) after optimizer: 0.30 โ 0.15 โ 0.05 m hill-climb on real KPI for sub-grid precision |
| 5.1 | Two-phase sail optimizer โ Phase 1: free raster search + sun-tilt + hill-climb; Phase 2: auto-place posts on garden walls; regression guard |
| 5.0 | Post-assignment optimizer (brute-force best corner mapping); undo/redo (41-step ring buffer); configurable evaluation rectangle (draw seating area) |
| 4.x | Sail tilt toward sun direction; dimension/position arrows; post-label toggle |
| 3.9 | Person figure (draggable, adjustable height); click-to-scroll (click 3D element โ panel scrolls to settings); comma decimal separator for all numeric inputs; highlight animation on scrolled card |
| 3.8 | Multilingual UI: DE / EN / RU; enlarged 3D labels (13px / 96px); shadow area clipped to garden boundary (Sutherland-Hodgman); persistent daily analysis HUD overlay |
| 3.6 | 4 individually adjustable wall heights; pivot-corner rotation for furniture; location selector (6 cities); daily shade analysis (10โ18h, mยฒยทh) |
| 3.5 | Initial GitHub publish; README.md + DEVELOPER.md added |
| 3.4 | Removed laser/polar input; fixed reference point at corner 3; label toggle; sail dimensions as number inputs; Pergola furniture; furniture drag; sail physics fix |
| 3.3 | Initial version: garden, 6 posts, 2 sails, furniture, Horn quaternion best-fit, drag, localStorage |
Private project. No public release.
Made with โ๏ธ in Freudenstadt, Germany






