How it’s made
How Sunpatch is made
Sunpatch shows where the sun lands in a garden, hour by hour, on any day of the year.
Draw the house, the neighbours, the trees and the fences, and it tells you which parts of the garden get the sun and when, how warm the rooms get, and what would grow where.
What’s hard about it
Where the sun is at any moment is a formula. A garden is harder: there’s a house in it, the house next door, a fence, and a tree that’s bare in March and full in July. These are the parts that took the work.
-
Every ten minutes, on the graphics card
The sun’s position comes from Jean Meeus’s astronomical formulas, checked in the tests against NOAA’s sunrise and sunset times. For the map, the graphics card draws the garden as the sun sees it every ten minutes from sunrise to sunset, and each patch of ground about 25 cm across counts the moments it can see the sun.
A single spot takes another route: a ray traced from that point towards the sun, on the processor. The tests fail if the two answers drift apart. On the summer-evening map they agree to within about a minute.
-
Houses that behave like houses
The buildings round a garden come from OpenStreetMap. Houses that share a wall become a terrace or a semi, with one ridge along the row, and a party wall never gets the sun, whatever the angle. When the house in front would hide your garden, it fades away in a soft patch around what you’re looking at.
Or stand in the garden in first person, lying on the grass, sitting on a bench or standing, and the sun is counted on five points of you.
-
Trees that grow with the local weather
There are 537 trees and shrubs to choose from, shown by what’s hardy where you are. Each one grows month by month from the warmth above 6 °C, the rain against what evaporates, and the sun on its spot, from Open-Meteo’s weather record for the site: the same cherry grows more slowly in a cold garden than a warm one. Move the years bar and the garden is drawn ten or twenty years on, with the shade its trees will cast by then. Bare in winter, they let most of the sun through.
-
How warm the room gets
For a conservatory, a garden room or the room behind any window, Sunpatch traces the sun through each pane and works out the room’s temperature through the day, with a two-part model of the air and the walls and floor (the simple hourly method of ISO 13790, cut down). It also says which tree keeps a room cooler in summer, and by how much.
-
Plants, with the reasons in numbers
263 garden plants, each with the light it wants and when it wants it. Every suggestion says why, with the figures: “Tomatoes want 6 h or more of sun a day, June to September; less and the fruit won’t ripen.” Pick a plant and the map becomes a map of where it would do well.
-
An assistant can build the garden
Sunpatch has a way in for AI assistants: an MCP server with around thirty tools, to find an address, draw the house from the map, set the boundary, add the trees and ask about the sun. The garden comes back as a link that opens in the app for a person to carry on.
In a trial, fresh assistants were given an address, a few photos and a floorplan from a house listing, and nothing else. All five built the garden and sent back its link and a full sun report on their own. Two of them picked the wrong house on the street at first, so Sunpatch now says how closely an address matched, and asks which house when it isn’t sure.
-
No framework, and nothing to upload
Plain JavaScript modules and three.js for the 3D, bundled and compressed at build time; the guide, the assistant interface, the plant and tree lists, the panel’s pages and anything else the first screen doesn’t need load only when they’re wanted. The first screen, 3D engine and sun maths included, is about 490 KB of compressed JavaScript. The whole garden travels in its share link, so sharing it uploads nothing.
Made by Robin with Claude
Sunpatch was started on 23 September 2026 by Robin Metcalfe, working with Claude, Anthropic’s AI model. Robin decided what it should do and how it should look and feel, and tested it; Claude wrote much of the code and the tests to his notes. The notes run to hundreds of small decisions, from “shade is green, not blue” to how a fence post sinks into the ground when the panels either side of it are taken out.
Where the data comes from
- Buildings and maps
- Map data © OpenStreetMap contributors, available under the Open Database Licence; buildings through the Overpass API, map tiles from openstreetmap.org, addresses for assistants from Nominatim.
- Weather and ground height
- Weather data by Open-Meteo.com, under CC BY 4.0: the site’s temperature, rain and cloud record, and its height above the sea.
- Postcodes
- Looked up with postcodes.io. Contains Ordnance Survey data © Crown copyright and database right 2025. Contains Royal Mail data © Royal Mail copyright and database right 2025. Contains National Statistics data © Crown copyright and database right 2025. Contains NRS data © Crown copyright and database right 2025.
- The sun
- Jean Meeus, Astronomical Algorithms; checked against NOAA’s solar calculator.
- 3D and type
- three.js (MIT licence). Fraunces and Bricolage Grotesque, under the SIL Open Font Licence.