MCPcopy Create free account
hub / github.com/ModelRift/terrain-to-3d

github.com/ModelRift/terrain-to-3d @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
154 symbols 342 edges 37 files 0 documented · 0% updated 6mo ago★ 624 open issues

Browse by type

Functions 136 Types & classes 18
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Terrain To STL

This is a simple browser-based editor which creates printable 3D terrain models (.stl) from just latitude and longitude input.

Demo: https://terrain.modelrift.com

Built by ModelRift team. ModelRift is an AI-enhanced browser-based IDE for OpenSCAD.

Uses awesome OpenSCAD WASM build by @DSchroer so all the magic happens right in your browser.

UI is built using React and Shadcn. Three.js is used as a model viewer.

How it works

  • Step 1 downloads elevation tiles and builds a grayscale heightmap of the chosen lat/long. Terrain data is downloaded from this public dataset. Interesting read on how the terrain tiles are encoded

  • Step 2 generates OpenSCAD code and compiles an STL in the browser (WASM worker).

  • Three.js renders the produced .stl model in a browser, with a beautiful lightning applied.

What you can control

  • Center point: latitude and longitude
  • Area size in km
  • Heightmap resolution
  • Tile zoom level
  • Model size in mm
  • Z exaggeration
  • Base thickness

How To Run

Docker Compose

docker compose up --build -d

Open http://localhost:8083.

Development (Docker Compose)

Big map rendering is slow in dev mode!

docker compose -f docker-compose.dev.yml up --build

Open http://localhost:5176.

Development (Local pnpm)

pnpm install
pnpm dev

Then open the Vite URL from terminal output and: 1. Click Download Terrain 2. Click Generate STL 3. Download terrain.stl (or terrain.scad)

Notes

  • Terrain data is fetched from Terrarium elevation tiles.
  • Internet access is required while fetching terrain data.

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 136
Interface 18

Languages

TypeScript100%

Modules by API surface

src/components/ui/combobox.tsx16 symbols
src/components/ui/dropdown-menu.tsx15 symbols
src/components/ui/alert-dialog.tsx12 symbols
src/components/ui/select.tsx10 symbols
src/components/ui/field.tsx10 symbols
src/components/terrain-viewer.tsx9 symbols
src/lib/terrain.ts8 symbols
src/lib/geotiff-heightmap.ts7 symbols
src/components/ui/card.tsx7 symbols
src/lib/url-state.ts6 symbols
src/components/ui/input-group.tsx6 symbols
src/components/terrain-controls.tsx6 symbols

For agents

$ claude mcp add terrain-to-3d \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page