Repository navigation
Description
Before you start
- I searched the existing issues and the roadmap and did not find a duplicate request.
(Edited 2026-11-23: the roadmap's 3D scenes section plans "3D objects and 3D Tiles" after Phase 2 of #726, so this overlaps a planned item. The planting pattern tool was withdrawn: one already exists. The built-in models are now a CC0 set rather than made in code. See the comments.)
Closest: #726 (full 3D scenes: heights in the data, 3D objects, point clouds). This asks for one narrow piece of it that needs no Z in the data: a point stands on the terrain the map already has, so it does not wait on the heights work (#2032).
What problem does this solve?
A reforestation plan, an orchard, a park or a campus is shown in 3D as trees standing on the relief: a point layer of planting positions, each drawn as a small tree model, over a DEM. Teachers and planners use this view to show what a project will look like on the slope.
RustGIS has most of the way there:
- Terrain on a tilted map, from a DEM or elevation tiles; point markers already stand on it, upright and facing the eye (
render::upright_markers, drawn as GPU instances ingpu_scene.rs). - Image markers (PNG/JPEG) on points.
- Block diagrams (
map.terrainwith"block") and their glTF export (map.exportBlock, Export a block diagram as a 3D model (glTF/GLB): ground with the map draped on it, walls and base #2319).
But a marker is a flat sprite in screen pixels. It turns with the camera, it doesn't shade with the sun, it has no size on the ground, and a thousand trees on a hillside read as a field of stickers. The planting positions themselves can already be laid out: Create Spatial Sampling Locations (geolibre:create_spatial_sampling_locations, method: "systematic") makes a square or staggered lattice inside polygons.
Proposed solution
1. A 3D model marker for point layers, in the symbol's marker list beside circle, font and image:
layer.symbology={"layer":"plantio","type":"single",
"marker":{"model":"conifer","height":12,"height_field":"altura","rotation":"random","scale_jitter":0.2,"color":"#3B6B2A"}}
model: one of a small set of CC0 models shipped with RustGIS (conifer,broadleaf,palm,shrub,post), or a path to a.glb/.gltffile.- Size in metres on the ground (
height, orheight_fieldper feature), so a tree is as tall as it is, nearer ones larger in perspective. The terrain's exaggeration applies to the ground, not to the tree. rotation: a field, a fixed angle, or"random"(seeded by the feature id, so it doesn't change between frames or exports).scale_jittervaries the size by up to ± that fraction, seeded the same way.colortints the built-in models; a file model keeps its own materials.- Drawn as GPU instances on the tilted map, standing on
Ground::heightat the point, lit by the map's light (and casting shadows where the scene has them). One mesh per model, one instance per point: the same path the upright markers use. - Fallbacks, all said: in a flat view, a layout without tilt, or the globe, the model draws as its top-down silhouette (a filled circle in the model's colour for the built-ins). A layer past the instance limit (as markers have their 50,000), a file that doesn't load, or a model without a usable mesh falls back to the plain marker, with a notice that names the layer and the count.
2. Exports keep them. map.exportBlock (#2319) and share.webScene write each model once and place it with one node per point (or EXT_mesh_gpu_instancing), so a GLB of a planted slope opens in Blender or a web viewer with the trees on it. PNG/PDF exports draw them as the view does.
Tests
- A point over a test DEM with a
conifermarker 10 m tall: its base vertex sits atGround::heightat the point (× exaggeration), and its top 10 m above, in the scene's units. rotation: "random"andscale_jittergive the same values for the same feature id across two renders and an export.- A
.glbmodel file loads; a broken one falls back to the plain marker with a notice naming the layer. - A flat view draws the silhouette; a layer over the limit draws plain markers and says so.
map.exportBlockof a block with such a layer writes the model mesh once and one placement per point inside the block, and the file passes the structural checks feat(view): export a block diagram as a glTF model (#2319, part 1) #2376 uses.
Choices in this proposal
- Built-in models: a small CC0 set, such as from Quaternius's Stylized Nature MegaKit or Kenney's Nature Kit, as GLB simplified to a few hundred triangles each, with each model's licence checked and its source recorded before it is bundled. Better looking than shapes made in code, with no licence conditions and nothing to download at run time. A file model covers everything else.
- Metres, not pixels. A tree's size belongs to the ground. Pixel-sized markers remain for symbols that should stay readable.
- No Z in the data needed. Points stand on the map's terrain, so this works today with any point layer and leaves [Feature]: Full 3D scenes: heights in the data, 3D objects and point clouds, a scene camera #726's heights work untouched. When layers carry Z, a model can stand at its own height instead.
- Parts: (1) built-in models drawn on the tilted map with size, rotation and jitter; (2) file models (
.glb); (3) exports. Each is a PR of its own, about 400 lines.
Estimated scope
Medium: a feature that touches several parts of the app (render, symbology, export), in three parts.
Activity
elpidioassinaturas commentedon Nov 22, 2026
Built-in models: ship CC0 models instead of generating them in code
Since opening this, I looked at what is shared openly. There are good public-domain (CC0) plant libraries, so the built-in set doesn't need to be made of cones and cylinders in code:
Other sources, named from memory and not checked, need a per-model licence check before anyone bundles them, but users can load them as their own
.glb(part 2): Poly Pizza and Sketchfab. A tree generator such as Blender's Sapling Tree Gen is a path for species the libraries may not have, such as Brazil's araucaria, ipê or babassu palm.Revised choice: part 1 bundles a small CC0 set, around 6 to 10 models (conifer, broadleaf, palm, shrub, dead tree, rock), converted to GLB and decimated to a few hundred triangles each. My estimate, not measured, is 1 to 2 MB in the binary, loaded only when a layer uses them. The licence and source of each go into
THIRD_PARTY/ the docs, even though CC0 doesn't require it. The models are drawn with the code's own tint, socolorstill works. Everything else in the proposal stands.Contributions welcome
This splits into three pieces, and I'd be glad to share them. If you'd like to take one, say so here so we don't overlap:
Ground::height, sized in metres, rotation and jitter seeded by feature id, lit by the map's light (gpu_scene.rs, next to the upright markers)..glb/.gltfmodels for the marker, with the fallbacks and notices.map.exportBlock(Export a block diagram as a 3D model (glTF/GLB): ground with the map draped on it, walls and base #2319) andshare.webScenewriting each model once with one placement per point.Part 1 comes first. Parts 2 and 3 build on part 1. Comments on the design are just as welcome, especially on the model set, the size defaults, and how this should meet the heights work in #726 / #2032 later.
(Edited 2026-11-23: part 4, the planting pattern tool, removed, since GeoLibre already has one; unchecked claims marked. See the correction below.)
elpidioassinaturas commentedon Nov 23, 2026
Corrections to the proposal and to my comment above
Part 4 (
gp.regularPoints) is not needed as a new tool. Please don't start it. I wrote that there is no tool for a regular pattern inside a polygon. That was wrong: I hadn't checked the GeoLibre tools. Create Spatial Sampling Locations (geolibre:create_spatial_sampling_locations, Vector › Sampling & Gridding) withmethod: "systematic"lays asquare,hexagonortrianglelattice atbin_sizeinside polygons. In 0.8.0, on a 100 × 100 m square at 10 m, it gives 100 points (square) and 108 (hexagon and triangle, the same staggered lattice):It has no parameter for a row bearing or a margin from the edge, and from its source it doesn't carry the polygon's attributes or number rows and columns. If planting layouts need those, they are options to propose for that tool in geolibre-rust, not a second tool here.
That leaves three parts: (1) the built-in models on the tilted map, (2) user
.glb/.gltfmodels, (3) exports. Part 1 comes first.Roadmap. I ticked "searched the roadmap" without having read it. Its 3D scenes section says "3D objects and 3D Tiles follow", after Phase 2 of #726 (free camera, elevation modes), so this overlaps a planned item. What I'm proposing is a smaller step that uses the terrain the tilted map already has. Whether it should come before #726's scene or wait for it is the maintainers' and #726's call.
Model sources. I have checked that Quaternius's Stylized Nature MegaKit and Kenney's Nature Kit are listed as CC0, and that Poly Haven's licence is CC0. I have not confirmed that Kenney's kit ships glTF. What I wrote about Poly Pizza, Sketchfab and Sapling Tree Gen's output is from memory. The "1 to 2 MB" for the bundled set is an estimate, not a measurement. Licences need a check per model before anything is bundled.