Skip to main content

Module geometry

Module geometry 

Source
Expand description

Turn a processed elevation grid into drawable ridge lines.

Upstream plot_map draws row i at y = row - 6*i with a background-colored fill from the baseline up to the line (the occlusion trick that makes front ridges hide back ridges). RidgeScene captures that geometry, plus the matplotlib figure layout (figure size, axes rect, data limits) so the SVG exporter and the web canvas render identically.

Structs§

FigureLayout
Where the axes rect sits and how data maps into it.
RidgeRow
One ridge line: its baseline and y-values (NaN = gap, no line drawn).
RidgeScene

Enums§

ColorKind
What drives per-line color.
Fit
How the rotated grid fits the canvas.

Constants§

AXES_MARGIN
matplotlib default axes margins (5% padding each side of the data).
DEFAULT_SIZE_SCALE
matplotlib default figure.figsize used by upstream (size_scale=20).
FIG_DPI
matplotlib default dpi used for px math (figsize is in inches).
LINE_SPACING
Upstream: y_base = -6 * idx * np.ones_like(row).
SUBPLOT_BOTTOM
SUBPLOT_LEFT
matplotlib default subplot_params (fractions of the figure).
SUBPLOT_RIGHT
SUBPLOT_TOP

Functions§

build_scene
Run the full pipeline: sample -> (optional rotate) -> preprocess -> scene.
build_scene_fit
As build_scene, with an explicit Fit. Fit::Plane also skips the upstream axis swap (the client rotates a fixed-resolution plane), so the scene the browser recomputes locally matches the exported SVG exactly.