Skip to content

Latest commit

ย 

History

70 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒž Shade Sail Simulator

Browser-based 3D planner for shade sails (Sonnensegel)
Visualizes shadow casting, sail orientation, and furniture shading at any time of day and year.

Banner

Live Demo No Install Three.js 0.160 Version


๐Ÿ“ธ Screenshots

Full Application 3D View
Fullscreen 3D View
Control Panel โ€” Garden & Time Posts & Sails
Panel Sails Panel
Furniture Settings Shadow & Daily Analysis
Furniture Shadow

Screenshots: Shade sail over garden furniture, summer morning, Freudenstadt


โœจ Features at a Glance

๐Ÿก 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

๐Ÿš€ Quick Start

# 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:8080

No build tool, no npm, no installation.
Only requirement: internet connection on first open (CDN libraries).

๐ŸŒ Use Online

โ†’ nomiknomik.github.io/shade-sail-simulator


๐Ÿ—บ๏ธ How It Works

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                 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)       โ”‚       โ”‚
โ”‚                         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŽฎ 3D View Controls

Action Input
๐Ÿ”„ Rotate camera Left mouse button + drag
๐Ÿ” Zoom Mouse wheel
โ†”๏ธ Pan camera 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

๐Ÿชต Post Input

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.


๐Ÿ—๏ธ Technical Stack

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.


๐Ÿ“ Project Structure

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)

๐Ÿ—“๏ธ Default Configuration (real garden measurements)

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)

๐Ÿ”ฎ Planned Features

  • 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)

โš ๏ธ Known Limitations

  • 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)

๐Ÿ“‹ Changelog

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

๐Ÿ“„ License

Private project. No public release.


Made with โ˜€๏ธ in Freudenstadt, Germany

About

๐ŸŒž 3D shade sail planner โ€” simulate sun & shadow in your garden, optimize sail positions, analyze daily shade coverage (mยฒยทh), furniture shading. DE / EN / RU ยท Three.js + SunCalc ยท No install

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages