Make the models yourself
Every model on this site is made by open-source scripts from open elevation data. Here is how to run them on your computer.
The scripts are on GitHub: github.com/fabiovenni/isole-di-pietra. For each of the 374 models they make:
- a standard model: one solid, 150 mm on its longest side, on a flat 3 mm base, 150 000 triangles
- an HD model: the same with 300 000 triangles, when the data has that much detail
- the rest of a tile: the land around the model and the water, each closed and printable in its own material. The standard or HD model is the tile's third piece: they slot together with a 0.22 mm gap
Every file is a closed, watertight STL that prints flat with no supports. The water is never part of the model, and the sea is perfectly flat.
Install
Python 3.12 or newer.
git clone https://github.com/fabiovenni/isole-di-pietra.git
cd isole-di-pietra
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -r requirements.txt
Make one model, step by step
Monviso, on the French border:
python3 isole.py fetch monviso
Downloads the four TINITALY tiles under Monviso (about 230 MB) into data/tinitaly/, and the Copernicus tile for the French side (40 MB) into data/copernicus/. They are kept, so this happens once. The elevation window is saved to data/dem/monviso.npy.
python3 isole.py build monviso
python3 isole.py build monviso --hd
python3 isole.py tiles monviso
Writes out/standard/monviso.stl, out/hd/monviso.stl and out/tiles/monviso-land.stl. Monviso has no water piece because it has no sea or lake. Each step takes a few seconds and adds its numbers to out/report.json: scale, size, triangles, and whether every piece is closed.
python3 isole.py all monviso does all four steps. Use --all instead of a name to make every model. That downloads about 150 TINITALY tiles, roughly 13 GB, once.
If you already have TINITALY tiles, put the zip files as they are (w49030_s10.zip) in data/tinitaly/.
LiDAR: build from HR-DTM-5m
HR-DTM-5m Italy, by CNR-IRPI, joins the regional LiDAR surveys to TINITALY in one 5 m grid of the whole country. It is not public yet, so the scripts do not download it. If you have the file, put it at data/hrdm/HRDM5m.tif and add --source hrdm to any step:
python3 isole.py all pania --source hrdm
The window is cut out of HR-DTM with 5 m cells (10 m when the window would get too big), the outline stays the TINITALY one, so both versions have the same shape. The files go to out/hrdm/. Where a region has no LiDAR, HR-DTM is TINITALY resampled to 5 m: it adds no detail there.
Add a model
-
Fetch a window around it, big enough to hold the whole mountain or island:
python3 isole.py fetch monte_nuovo --lat 40.8435 --lon 14.0868 --radius-km 2Use
--kind islandor--kind headlandfor coastal models. -
Find its outline. The script looks for the lowest contour that closes around the summit on its own, and picks a vertical exaggeration from the relief:
python3 isole.py outline monte_nuovo --previewLook at
out/monte_nuovo-outline.png. If the shape is wrong, set the cut yourself (--cut 120), make it climb away from the summit (--flat-radius 1500 --slope 0.5), or edit itsshapeinconfig/params.json. Build it:
python3 isole.py all monte_nuovo.
Where the outlines come from
The models already on the site were first cut out with outlines tuned by hand, one at a time. Those outlines are kept as black and white pictures in reference/outlines/, and the shape settings in config/params.json were found from them by:
python3 isole.py fit --all
For each model it looks for the settings that make the outline code draw the reference again from the elevation data. After that the pictures are not needed: every build cuts its outline from the settings.
How a model is made
- Window. TINITALY has one height every 10 m. Windows wider than about 21 km are averaged to 20 m cells, so the full mesh stays manageable. On the border, the cells abroad are filled from Copernicus GLO-30 and shifted to meet TINITALY without a step.
- Outline. Everything above a cut level that is connected to the summit. For mountains the cut climbs with distance from the summit, so the shape closes where the peak joins its range. Islands and headlands are cut at sea level.
- Coast. Headlands are printed as islands: the land between the outline and the sea joins the model, so no other land is left in front of it. On the land side, hand-drawn lines say where a headland ends.
- Mesh. One vertex per cell inside the outline, two triangles per square of cells, a flat bottom and vertical walls along the edge. It is closed by construction.
- Size. The longest side is 150 mm, so the scale is 1 : (width in metres × 1000 / 150). Heights are raised by the model's vertical exaggeration and sit on a 3 mm base.
- Triangles. The full mesh is simplified with quadric edge collapse, keeping the outline sharp.
- Tiles. The model's bounding box plus 4 mm. Every square of the box goes to the model, the land or the water. Bits too small or thin to print go to the piece around them. Then the walls between pieces move in by 0.11 mm each. The model piece is the standard and HD model, so the model prints on its own and slots into the tile.
- Detail limit. A 10 m cell is 10 000 / scale mm on the print. On small islands that is a millimetre or more: no number of triangles can add detail the data does not have.
Licences
- Code: MIT.
- Settings, outlines and the models the scripts make: CC BY 4.0.
- Data: whoever shares a print or a file credits INGV and the TINITALY authors:
Border models also carry the Copernicus notice, in the repository's LICENSE-models.
Models made with --source hrdm also credit HR-DTM-5m Italy:
Crea i modelli da te
Tutti i modelli di questo sito sono fatti da script open source a partire da dati di elevazione aperti. Ecco come farli girare sul tuo computer.
Gli script sono su GitHub: github.com/fabiovenni/isole-di-pietra. Per ognuno dei 374 modelli creano:
- un modello standard: un solido unico, 150 mm sul lato lungo, su una base piatta di 3 mm, 150 000 triangoli
- un modello HD: lo stesso con 300 000 triangoli, quando i dati hanno tanto dettaglio
- il resto di una tile: il terreno intorno al modello e l'acqua, ognuno chiuso e stampabile nel suo materiale. Il modello standard o HD è il terzo pezzo della tile: si incastrano con 0,22 mm di gioco
Ogni file è un STL chiuso e a tenuta che si stampa in piano senza supporti. L'acqua non fa mai parte del modello, e il mare è perfettamente piatto.
Installazione
Python 3.12 o più recente.
git clone https://github.com/fabiovenni/isole-di-pietra.git
cd isole-di-pietra
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -r requirements.txt
Un modello, passo per passo
Il Monviso, sul confine francese:
python3 isole.py fetch monviso
Scarica le quattro tessere TINITALY sotto il Monviso (circa 230 MB) in data/tinitaly/, e la tessera Copernicus per il versante francese (40 MB) in data/copernicus/. Restano lì, quindi succede una volta sola. La finestra di quote viene salvata in data/dem/monviso.npy.
python3 isole.py build monviso
python3 isole.py build monviso --hd
python3 isole.py tiles monviso
Scrive out/standard/monviso.stl, out/hd/monviso.stl e out/tiles/monviso-land.stl. Il Monviso non ha il pezzo d'acqua perché non ha mare né lago. Ogni passaggio richiede pochi secondi e aggiunge i suoi numeri a out/report.json: scala, dimensioni, triangoli, e se ogni pezzo è chiuso.
python3 isole.py all monviso fa tutti e quattro i passaggi. Con --all al posto del nome li fa per tutti i modelli: scarica circa 150 tessere TINITALY, circa 13 GB, una volta sola.
Se hai già le tessere TINITALY, metti i file zip così come sono (w49030_s10.zip) in data/tinitaly/.
LiDAR: modelli da HR-DTM-5m
HR-DTM-5m Italy, del CNR-IRPI, unisce i rilievi LiDAR regionali a TINITALY in un'unica griglia di 5 m per tutta Italia. Non è ancora pubblico, quindi gli script non lo scaricano. Se hai il file, mettilo in data/hrdm/HRDM5m.tif e aggiungi --source hrdm a qualsiasi passaggio:
python3 isole.py all pania --source hrdm
La finestra viene ritagliata da HR-DTM con celle di 5 m (10 m quando la finestra diventerebbe troppo grande), il contorno resta quello di TINITALY, quindi le due versioni hanno la stessa forma. I file vanno in out/hrdm/. Dove una regione non ha LiDAR, HR-DTM è TINITALY ricampionato a 5 m: lì non aggiunge dettaglio.
Aggiungere un modello
-
Scarica una finestra intorno, abbastanza grande da contenere tutta la montagna o l'isola:
python3 isole.py fetch monte_nuovo --lat 40.8435 --lon 14.0868 --radius-km 2Usa
--kind islando--kind headlandper i modelli sulla costa. -
Trova il contorno. Lo script cerca la curva di livello più bassa che si chiude da sola intorno alla cima, e sceglie un'esagerazione verticale in base al rilievo:
python3 isole.py outline monte_nuovo --previewGuarda
out/monte_nuovo-outline.png. Se la forma non va, imposta tu il taglio (--cut 120), fallo salire allontanandosi dalla cima (--flat-radius 1500 --slope 0.5), oppure modifica la suashapeinconfig/params.json. Costruiscilo:
python3 isole.py all monte_nuovo.
Da dove vengono i contorni
I modelli già sul sito sono stati ritagliati la prima volta con contorni regolati a mano, uno per uno. Quei contorni sono conservati come immagini in bianco e nero in reference/outlines/, e le impostazioni shape in config/params.json sono state ricavate da lì con:
python3 isole.py fit --all
Per ogni modello cerca le impostazioni con cui il codice ridisegna il contorno di riferimento a partire dai dati di quota. Dopo, le immagini non servono più: ogni costruzione ritaglia il contorno dalle impostazioni.
Come si fa un modello
- Finestra. TINITALY ha una quota ogni 10 m. Le finestre più larghe di circa 21 km vengono mediate a celle di 20 m, perché la mesh completa resti gestibile. Sul confine, le celle all'estero vengono riempite con Copernicus GLO-30 e spostate per raccordarsi a TINITALY senza gradino.
- Contorno. Tutto ciò che sta sopra un livello di taglio ed è collegato alla cima. Per le montagne il taglio sale allontanandosi dalla cima, così la forma si chiude dove il picco si unisce alla sua catena. Isole e promontori sono tagliati al livello del mare.
- Costa. I promontori si stampano come isole: la terra tra il contorno e il mare entra nel modello, così davanti non resta altra terra. Dal lato di terra, linee disegnate a mano dicono dove finisce il promontorio.
- Mesh. Un vertice per ogni cella dentro il contorno, due triangoli per ogni quadrato di celle, un fondo piatto e pareti verticali lungo il bordo. È chiusa per costruzione.
- Dimensioni. Il lato lungo misura 150 mm, quindi la scala è 1 : (larghezza in metri × 1000 / 150). Le quote sono alzate dell'esagerazione verticale del modello e poggiano su una base di 3 mm.
- Triangoli. La mesh completa viene semplificata con il collasso degli spigoli a quadriche, mantenendo netto il contorno.
- Tessere. Il riquadro del modello più 4 mm. Ogni quadrato del riquadro va al modello, alla terra o all'acqua. I pezzetti troppo piccoli o sottili per la stampa vanno al pezzo che li circonda. Poi le pareti tra i pezzi rientrano di 0,11 mm ciascuna. Il pezzo del modello è il modello standard e HD, quindi il modello si stampa da solo e si incastra nella tile.
- Limite di dettaglio. Una cella di 10 m è 10 000 / scala mm sulla stampa. Sulle isole piccole è un millimetro o più: nessun numero di triangoli può aggiungere dettagli che i dati non hanno.
Licenze
- Codice: MIT.
- Impostazioni, contorni e i modelli creati dagli script: CC BY 4.0.
- Dati: chi condivide una stampa o un file cita INGV e gli autori di TINITALY:
I modelli di confine riportano anche la nota Copernicus, nel file LICENSE-models del repository.
I modelli fatti con --source hrdm citano anche HR-DTM-5m Italy: