Skip to content

Block diagram: a round block, or one cut to a polygon (a basin, a municipality) #2318

Done

Description

@elpidioassinaturas

Today: a block diagram (map.terrain with "block", #1914) is cut to a north-up box: the DEM's extent or "extent": [xmin, ymin, xmax, ymax]. Teaching figures often use a round block (it doesn't favour a direction and reads well at any bearing in an orbit, #1916), and study-area figures want the ground cut to the area itself: a river basin, a municipality, a park.

Proposal

"shape" in "block":

map.terrain={"layer": "MDE", "block": {"shape": "circle"}}
map.terrain={"layer": "MDE", "block": {"shape": {"layer": "Bacia", "where": "nome = 'Rio Doce'"}}}
  • "box" (default): today's block.
  • "circle": the largest circle inside the box (the DEM's extent or "extent"), centred in it. "radius" in map units makes it smaller.
  • {"layer": …, "where"?: …}: the polygon (or the union of the polygons) the expression selects, cut to the box. A polygon with holes keeps them as wells with their own walls.
  • Walls: the ground's profile along the outline, down to the base, for the parts of the outline facing the eye. A curved or concave outline has walls that face away and walls that face the eye along the same side, so walls are drawn back to front (by their distance from the eye) after the ground, and a wall can be hidden by ground in front of it (a concave outline): the ground is drawn with depth testing as today and walls take part in it.
  • Everything the walls have now applies along the outline: colour, the polygon layer's classes, hatches ([Feature]: Block diagrams: terrain cut to a box, with side walls down to a base, optionally coloured by a polygon layer #1914 parts 2 and 3), and the base over water (fix(terrain): a block's base over elevation tiles follows the water level (#1914) #2150).
  • Sampling: the outline is followed at the mesh's own spacing (as the box's sides are), so a circle is smooth at any zoom: at least 256 points round it.

Tests

  • "circle" over a DEM: the ground outside the circle isn't drawn; the wall's top meets the surface along the circle; the wall faces the eye only on the near half.
  • A concave polygon (an L): the inner corner's walls are hidden where the near ground covers them.
  • A polygon with a hole: the hole's walls show on its far side.
  • "box" and no "shape": unchanged pixel for pixel.
  • A "where" that selects nothing is refused with a message naming the layer.

Choices in this proposal

Activity

  1. elpidioassinaturas commented on Nov 27, 2026

    @elpidioassinaturas
    ContributorAuthor

    Closing: all three parts are merged — the round block (#2379), the block cut to a polygon with depth-ordered walls (#2486), and its holes as wells with their own walls and floor (#2714). A glTF model cut to the circle or polygon (it exports the box today) can get its own issue if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions