[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-114547":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":8,"language":10,"languages":8,"totalLinesOfCode":8,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":15,"stars30d":15,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":16,"rankGlobal":8,"rankLanguage":8,"license":17,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":20,"topics":21,"createdAt":8,"pushedAt":22,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":14,"starSnapshotCount":14,"syncStatus":13,"lastSyncTime":26,"discoverSource":27},114547,"3d-city","yourplace3d\u002F3d-city","yourplace3d",null,"https:\u002F\u002Fyourplace3d.github.io\u002F3d-city\u002F","TypeScript",52,14,2,0,1,41.13,"MIT License",false,"main",true,[],"2026-11-11 19:37:05","2026-11-21 12:02:07","# Your Place\n\n**Type any address and get the area around it as a 3D architect’s model: the real terrain underneath,\nevery building standing on top. Save a poster or a watertight STL to 3D print it. Free, no account,\nworks on your phone.**\n\n**[Open Your Place →](https:\u002F\u002Fyourplace3d.github.io\u002F3d-city\u002F)** · [How it works](https:\u002F\u002Fyourplace3d.github.io\u002F3d-city\u002Fabout\u002F) · [Changelog](CHANGELOG.md)\n\n\u003Cp>\n  \u003Cimg src=\"public\u002Fscreenshot.jpg\" alt=\"Your Place showing Stuttgart as a 3D model on its valley terrain, with the settings panel open\" width=\"73%\" \u002F>\n  \u003Cimg src=\"public\u002Fscreenshot-phone.jpg\" alt=\"Your Place on a phone, showing Lisbon’s hills and the river Tagus\" width=\"24%\" \u002F>\n\u003C\u002Fp>\n\n## What you can do\n\n- **Search anything:** an address, a street, a village, a postcode or `lat, lon`, or use your location.\n  Postcode and county results land on their village, not in a field.\n- **See it in 3D:** any square from 300 m to 4 km around it, in 100 m steps, with terrain you can exaggerate (1×–5×) and contour lines.\n  Buildings stand at their mapped height; where none is mapped the app estimates it and says how many.\n  Show them in white, grey, sand or dark, or coloured by height (yellow through magenta to indigo, never\n  green or light blue, so they don't look like parks or water).\n- **Find a house:** slide the plate, tap a building to pin it, and “Centre here” to rebuild the square around it,\n  or double-tap \u002F double-click a spot to load the area there in one go.\n- **In your language:** English, Spanish, Portuguese (Brazil) or German, from the browser's language or the picker in\n  the settings. Share links carry no language, so each visitor sees their own.\n- **Share it:** the link opens the same view with the same house pinned. It holds coordinates only, never the address you typed.\n- **Keep it:** download a poster image with the place name and coordinates (both can be replaced), or an STL file to 3D print\n  (10, 15 or 20 cm wide; 2 km on 15 cm is 1:13,300), in one piece or in up to 8 × 8 tiles that fit your\n  print bed. For painting, water sits 1 mm below the land, parks and woods (0.6 mm) can stand above it,\n  and roads can stand 0.4 mm above it or be cut 0.6 mm into it. Every exported shell is checked to be\n  watertight. For multi-material printers, save it in colour instead: a 3MF already painted, by default\n  1 ground, 2 buildings and title, 3 roads, 4 water; parks and woods are a part of their own, and each\n  part's filament can be changed (1 to 5). Level roads are painted flush.\n- **Go bigger, square by square:** \"Make a bigger map from several squares\" fixes the area, print\n  size and terrain, and an arrow pad loads the square next door. Every square's print measures from\n  one shared base, so the pieces meet exactly at the edges; \"Download the whole map\" saves 2 × 2 or\n  3 × 3 squares in one ZIP, as STL or in colour.\n\n## Controls\n\n| | Touch | Mouse | Keyboard (model focused) |\n| --- | --- | --- | --- |\n| Turn and tilt | one finger | drag | arrow keys |\n| Slide | two fingers | right-drag or Shift-drag | Shift + arrow keys |\n| Zoom | pinch | wheel | + \u002F − |\n| Move the pin | tap a building or the ground | click | — |\n| Load the area there | double-tap | double-click | — |\n| North up \u002F reset | compass \u002F reset buttons | | N \u002F 0 |\n\n## Run it yourself\n\n```bash\nnpm install\nnpm run dev        # http:\u002F\u002Flocalhost:5173\nnpm run build      # static site in dist\u002F — host it anywhere (relative paths)\nnpm test           # unit tests (vitest)\nnpm run e2e        # build + headless-browser test (needs Playwright), screenshots in e2e\u002Fout\u002F\n```\n\nIt is a static TypeScript app on three.js with no server and no API keys: the browser fetches map\ntiles, terrain and address search straight from free public services.\n\n**Deploys.** `.github\u002Fworkflows\u002Fpages.yml` runs the unit tests, builds, and publishes `dist\u002F` to\nGitHub Pages on every push to `main`. One-time setup: **Settings → Pages → Build and deployment →\nSource: GitHub Actions**. To publish a release, add its section to [CHANGELOG.md](CHANGELOG.md),\nthen run the **Release** workflow from the Actions tab with the version number (or push a tag such\nas `v1.0.1`). It creates the tag and a GitHub release with that version’s notes.\n\n**Own domain.** Point a DNS `CNAME` record (e.g. `3d.example.com`) at `yourplace3d.github.io`, enter the\ndomain under **Settings → Pages → Custom domain**, and change `SITE_URL` in `vite.config.ts` (or set\nthe `SITE_URL` environment variable in the build) so canonical links, preview images and the sitemap\nuse it.\n\n## How it works\n\n```\nsearch ─▶ geocode (Photon \u002F Nominatim)\n            │\n            ▼\n   ┌── terrain tiles (Terrarium PNG, AWS) ──▶ N×N height grid ──▶ terrain mesh + plinth     ─┐\n   ├── vector tiles (OpenFreeMap): buildings with heights ──▶ one merged extruded mesh      ├─▶ three.js scene\n   └── vector tiles: roads\u002Fwater\u002Fgreen\u002Fsea ──▶ canvas texture draped on the terrain         ─┘\n                                           └▶ sea polygons → flatten to 0 m\n       (Overpass API only when the tiles fail: raw OSM, height rule, coastline flood fill)\n```\n\n- `src\u002Fgeo\u002F` — data: projection, polygon utilities, terrain tiles, Overpass queries and parsing,\n  the height rule, coastline sea fill, geocoding, an IndexedDB cache for Overpass responses.\n- `src\u002Fscene\u002F` — rendering: terrain + plinth, merged building mesh, the draped map-layer texture,\n  shader patches (contour lines, contact darkening), the viewer (camera, lights, controls, export).\n- `src\u002Fui\u002F` — search combobox, loading status, poster composition. `src\u002Fmain.ts` wires it together.\n\nDesign notes:\n\n- **Exaggeration applies to terrain only.** Each building vertex keeps its ground elevation and its\n  height above ground, so moving the slider re-evaluates `y = (ground − ref) × ex + height` without\n  rebuilding geometry; contour lines are computed per fragment from the real elevation.\n- **Map layers are a texture, not geometry.** Rasterising roads\u002Fwater\u002Fgreen into one canvas keeps\n  them glued to the terrain at any exaggeration and costs no triangles; toggling a layer is a redraw.\n- **The sea comes from coastlines, not elevation.** Terrain tiles report harbour water as ~0 m while\n  polders sit below sea level, so elevation can't tell them apart. OSM coastlines (land on the left)\n  are rasterised and the sea side flood-filled, then checked against the terrain before use.\n- **Rural searches land on the village, not in a field.** Geocoders place a postcode or\n  administrative area at the middle of its area — for rural postcodes that is open country between\n  villages. Such results are resolved to the settlement the geocoder names for them, and a square\n  with fewer than 10 buildings offers the nearest village or town outside it (\"Kleinfelde is 2.0 km\n  north-east — Go to Kleinfelde\").\n- **The print is a union of closed shells.** The STL holds a terrain block (height grid on top,\n  side walls, flat base) and one closed prism per building that starts inside the block. Slicers\n  union overlapping shells, so a building on a slope is exactly \"the part above ground\" without any\n  boolean geometry in the browser. Scale is the print width over the square (15 cm for 2 km is\n  1:13,300); buildings keep their real height at that scale, the terrain uses the on-screen\n  exaggeration, and the base is 3 mm under the lowest point.\n- **Every shell is closed, and no two shells touch.** Map data is messy, so each footprint is\n  cleaned (repeated points, points on straight walls, hairline spikes), checked (simple rings,\n  courtyards clear of the outer wall, a roof triangulation whose boundary is exactly the walls'\n  top edges) and repaired with a polygon union when needed. Buildings cut by tile edges are joined\n  again, and every building is inset by about 0.01 mm so terraced houses and stacked building\n  parts never share a point (slicers close gaps that small). An outline that cannot be repaired is\n  left out, and the dialog says so. Checked with trimesh on live data for Stuttgart 2 and 4 km,\n  Barcelona's Eixample, Berlin courtyards, Hong Kong and a village: 38,692 shells, all watertight\n  and outward-facing; one Barcelona building was left out.\n- **Raised roads are their own pieces, not carved into the terrain.** The height grid's points are\n  4–10 m apart, coarser than most roads, so a road in the grid would be a soft groove. Instead each\n  road is cut into short pieces wherever the ground under it bends; each piece is a closed shell whose\n  top follows the printed terrain (the same two triangles per grid cell) 0.4 mm up and whose floor is\n  buried in the block. Corners up to 90° are mitred, sharper ones get an octagon, and pieces overlap\n  slightly instead of sharing faces. Roads thinner than 0.3 mm at true scale are left out, the rest\n  are at least 0.5 mm wide, and bridges keep a level deck between their ends.\n- **Sunken roads are cut into the terrain block itself.** Slicers only add shells, so a groove can't\n  be a piece of its own. Where the roads are comes from a field of \"distance to the nearest road\n  edge\" sampled about every 0.2 mm of the print; its zero line, traced cell by cell (marching\n  squares), is the road edge, so overlapping roads merge and ends come out round without any\n  polygon union. Each crossing of that edge with a grid line is computed once and shared by both\n  cells, so the block stays one closed shell: cells the edge crosses are split into land and road\n  faces (earcut), 0.6 mm apart, with vertical walls between; the rest keep the terrain's two\n  triangles. Bridges stay raised. About 0.3–0.5 s for a dense 2 km square.\n- **The colour file paints, it doesn't split.** Water and parks are only moved grid points of the\n  terrain block, so they can't be pieces of their own, and parts that overlap get resolved\n  differently by each slicer. So the 3MF holds the same closed shells as the STL, as one object,\n  and each triangle carries its filament the way the slicers store their own multi-material painting\n  (`paint_color` for Bambu Studio and OrcaSlicer, `slic3rpe:mmu_segmentation` for PrusaSlicer, one\n  code for both). Triangles record which part they belong to, and each part's filament is applied\n  only when the file is written. The ground's top triangles are water where two of their three\n  corners are, else parks and woods where two are; buried undersides stay unpainted. Level roads are cut into the ground's top as sunken\n  roads are, at no depth: their edges split the triangles, so the paint follows the road exactly. Sliced in PrusaSlicer 2.7 as a four-filament printer,\n  every point of a test town well inside one colour came out on top in that filament.\n- **Renders on demand.** Frames are drawn only while the camera moves or something changes.\n\n## Technical choices\n\n- **Renderer:** three.js, not MapLibre — the physical-model look (plinth walls, contact shadow,\n  poster renders, STL export) needs full control of the geometry.\n- **No server:** the browser fetches public services directly, behind small interfaces\n  (`loadHeightGrid`, the tile loader, `overpass`, `suggest`) that an own tile server or geocoder could\n  replace if traffic outgrows the free services.\n- **Elevation:** Mapzen\u002FAWS Terrarium tiles (worldwide, CORS, no key; ~10–30 m sources incl.\n  SRTM, EU-DEM, 3DEP) instead of Copernicus GLO-30 GeoTIFFs, which need server-side processing.\n- **Search engines:** the app page and a static “How it works” page (`about\u002F`) carry titles,\n  descriptions, canonical links, Open Graph images and structured data; the build writes\n  `sitemap.xml` and `robots.txt` from `SITE_URL`.\n\n## Data and licences\n\n- Map data © OpenStreetMap contributors, ODbL. Attribution is shown in the app, on posters, in\n  the STL file header and in the 3MF's metadata; please keep “© OpenStreetMap contributors” next to anything you share.\n- Vector tiles: [OpenFreeMap](https:\u002F\u002Fopenfreemap.org), schema © [OpenMapTiles](https:\u002F\u002Fopenmaptiles.org).\n  Fallback map data: the [Overpass API](https:\u002F\u002Foverpass-api.de).\n- Terrain: Mapzen terrain tiles on AWS Open Data — see the\n  [attribution list](https:\u002F\u002Fgithub.com\u002Ftilezen\u002Fjoerd\u002Fblob\u002Fmaster\u002Fdocs\u002Fattribution.md).\n- Address search: [Photon](https:\u002F\u002Fphoton.komoot.io) by komoot (suggestions, place names for shared\n  links) and [Nominatim](https:\u002F\u002Fnominatim.org) (only when you press Enter before suggestions arrive,\n  per its usage policy).\n- Photon, Nominatim and Overpass are shared community services with fair-use limits. If the app gets\n  very popular, the address search should move to an own or paid geocoder.\n\n## Privacy\n\nNo account, no cookies, no analytics, no server of its own. What you type in the search box goes from\nyour browser to Photon or Nominatim; share links hold only coordinates and the view; map data you\nloaded is cached on your device.\n\n## Known limitations\n\n- No LiDAR surface model yet, so many heights are estimates (the app says how many).\n- Building parts follow Simple 3D Buildings only partly: roofs are flat, outlines hosting\n  `building:part`s are dropped.\n- Terrain sea-floor values are clamped at −30 m until coastlines arrive; places far below sea level\n  (Dead Sea, Death Valley) are flattened by that clamp.\n- No level of detail yet; the 4 km area at full density can be heavy on older phones.\n\n## Ideas for later\n\n- **Colour the blocks.** The OpenMapTiles building layer has a `colour` field (from OSM\n  `building:colour` \u002F `building:material`) where mappers recorded one, so a \"real colours\" style is\n  cheap. Letting people paint their own house builds on the pin, which already marks one building.\n- **Photos on the buildings.** Aerial imagery on roofs and ground is the realistic first step —\n  the hard part is an imagery licence that allows it. Street-level photos on façades are a much\n  bigger job (coverage, licensing, matching photos to walls).\n- **A name engraved in the base**, and **poster styles** (title layouts, colours).\n\n## Testing\n\n`npm test` covers projection, terrain decoding\u002Fresampling, polygon clipping and ring assembly,\nOSM parsing (multipolygons, courtyards, building parts, clipping), the height rule, the sea fill,\nbuilding-mesh winding and exaggeration, URL state, and the STL export (every shell closed and\noutward-facing, volumes, binary format) and the colour 3MF (paint codes read back the way the\nslicers read them, closed by vertex index, which parts get which filament).\n\n`npm run e2e` serves the build, answers Overpass and geocoding from a deterministic synthetic city\n(`e2e\u002Ffixtures\u002Fsynthetic-city.mjs`), uses real terrain tiles, and drives search, every control,\nkeyboard camera, pinning a building (click, drag, share-link round-trip, \"Centre here\"),\nShift-arrow and two-finger sliding, share link round-trip, poster download, STL download (size and\nbase checked; raised and sunken roads closed), the colour 3MF (painted, closed), a bigger map (two neighbouring squares meet at the seam, the link reopens the square, the whole map as STL and in colour), an Overpass outage with retry, a phone\nviewport, and dark mode with reduced motion. It fails on any console error.\n\n## Licence\n\nThe code is released under the [MIT Licence](LICENSE). Map data and terrain shown by the app keep\ntheir own licences (see “Data and licences” above).\n","Your Place 3D 是一个基于 Web 的轻量级地理空间可视化工具，可将任意地址或坐标实时生成带真实地形与建筑高度的三维城市模型。核心功能包括：支持地址\u002F经纬度搜索、自定义区域范围（300m–4km）与地形夸张倍率（1×–5×）、建筑按实测或估算高度渲染、多语言界面、生成高精度海报图及可用于3D打印的watertight STL\u002F3MF文件（支持分块、多材质、地形与道路\u002F水体\u002F绿地分层建模）。适用于城市规划教学、地理科普、纪念品定制、建筑环境分析等无需专业GIS软件的轻量化三维地理表达场景。","2026-11-24 04:48:58","CREATED_QUERY"]