Export a block diagram as a 3D model (glTF/GLB): ground with the map draped on it, walls and base

Aperta
#2,319 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Start by reading the existing block implementation in #1914, the mesh work in #2017 and #2084, and the glTF writer used by share.webScene; compare these with imagery.mesh. Define how the command reuses those paths to export the settled block view, then implement and validate geometry, textures, and the no-block error. Done means the four listed tests pass and the result reports the file size and omitted view elements.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Today: a block diagram (map.terrain with "block", #1914) can only be exported as a picture (PNG, PDF) or an orbit (#1916). imagery.mesh writes a DEM as an uncoloured OBJ, and share.webScene writes extruded polygons as glTF, but neither gives the block as it's drawn. A 3D file of the block would open in Blender, PowerPoint, a web viewer or a 3D printer's slicer, and could be turned in class.

Proposal

A new command, map.exportBlock, for a map whose terrain has a block:

map.exportBlock={"path": "pedra_azul.glb", "texture": 4096}
  • Geometry: the ground as the settled view draws it (the same mesh, #2017/#2084, cut to the block), the walls along the block's sides with their top meeting the ground, and the base as a flat quad. The terrain's exaggeration applies; units are metres from the block's south-west corner, with y up as glTF defines.
  • Ground colour: the map drawn top-down over the block's box, at "texture" pixels on the long side (default 4096, at most 8192), as the ground's texture: the same layers, symbology, water (#1915) and labels the map shows, without the relief's light (the 3D viewer lights it).
  • Walls: vertex colours for plain walls; a texture strip per wall when the walls carry a polygon layer's classes and hatches (#1914), drawn as the wall draws them in the map.
  • Format: .glb (binary glTF, one file); .gltf writes the JSON with the buffers and textures embedded. Reuse the glTF writer of share.webScene.
  • Size: the ground's triangles are those of the mesh, at most what the export mesh has; the file's size is given in the result.
  • Notices: what isn't in the model: fog and sky, the relief's shading, labels standing up in screen space (they're in the texture flat instead), the legend and other layout elements.
Tests
  • A block over a small DEM exports a .glb that a glTF validator accepts, with three meshes (ground, walls, base) and a texture.
  • The ground's vertex heights at the corners match the DEM's heights × exaggeration.
  • The walls' top vertices are the ground's edge vertices (no gap).
  • A map with no block is refused with a message.
Choices in this proposal
  • glTF/GLB, not OBJ: one file with textures, read by Blender, PowerPoint, Windows' 3D Viewer and web viewers. OBJ needs a material file and a texture beside it.
  • The map as a texture, unlit: the viewer lights the model, so baking the hillshade in would light it twice.
  • A command of its own: the block is a view setting, not a layer, so it doesn't fit share.webScene's per-layer extrusions; the writer is shared.
  • Related: #1914, #1916, #2017, #2084, imagery.mesh, share.webScene.
Lingua principale
Rust
Stelle
1.9k
Fork
268
Merge medio
11h 1m
PR unite (30g)
942

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di opengeos/RustGIS

Tutte le issue di opengeos/RustGIS

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.