pycsamt.format.borehole.render#

Viewer-neutral render models for PCBH boreholes.

Functions

build_render_model(document, *[, family, ...])

Build a render model with a short-lived builder.

deterministic_color(value)

Return a process-independent, readable color for a vocabulary key.

Classes

BoreholeRenderBuilder()

Build reusable render primitives while caching scientific paths.

BoreholeRenderModel(borehole_id, collar, ...)

Complete viewer-neutral primitives for one borehole.

CollarPrimitive(borehole_id, position, ...)

Collar marker, label, selection state, and hover metadata.

ContactPrimitive(contact_id, borehole_id, ...)

Contact-ring input located at an exact shared interval boundary.

DisplayRadiusPolicy([mode, fixed_radius, ...])

View-only borehole radius policy in document coordinate units.

IntervalSegmentPrimitive(segment_id, ...)

Colored portion of a centerline for one logged interval.

MaterialBatch(family, color, segment_ids)

Stable grouping of segments sharing one family and material color.

PCBHRenderModel(document_id, crs_horizontal, ...)

Complete render contract for one PCBH document.

PolylinePrimitive(borehole_id, points, ...)

One borehole centerline in document coordinates.

StructureGlyphPrimitive(glyph_id, ...)

Position and orientation inputs for one structural glyph.

class pycsamt.format.borehole.render.DisplayRadiusPolicy(mode='auto', fixed_radius=None, exaggeration=1.0, extent_fraction=0.001, minimum_radius=0.05)[source]

Bases: PyCSAMTObject

View-only borehole radius policy in document coordinate units.

Parameters:
mode: str = 'auto'
fixed_radius: float | None = None
exaggeration: float = 1.0
extent_fraction: float = 0.001
minimum_radius: float = 0.05
resolve(diameter, model_extent)[source]

Resolve display radius without modifying physical diameter.

Parameters:
Return type:

float

class pycsamt.format.borehole.render.CollarPrimitive(borehole_id, position, label, selected, metadata)[source]

Bases: PyCSAMTObject

Collar marker, label, selection state, and hover metadata.

Parameters:
borehole_id: str
position: tuple[float, float, float]
label: str
selected: bool
metadata: dict[str, Any]
class pycsamt.format.borehole.render.PolylinePrimitive(borehole_id, points, color, selected, metadata)[source]

Bases: PyCSAMTObject

One borehole centerline in document coordinates.

Parameters:
borehole_id: str
points: tuple[TrajectoryPoint, ...]
color: str
selected: bool
metadata: dict[str, Any]
class pycsamt.format.borehole.render.IntervalSegmentPrimitive(segment_id, borehole_id, family, from_md, to_md, points, color, display_radius, selected, metadata)[source]

Bases: PyCSAMTObject

Colored portion of a centerline for one logged interval.

Parameters:
segment_id: str
borehole_id: str
family: str
from_md: float
to_md: float
points: tuple[TrajectoryPoint, ...]
color: str
display_radius: float
selected: bool
metadata: dict[str, Any]
class pycsamt.format.borehole.render.ContactPrimitive(contact_id, borehole_id, family, md, position, tangent, display_radius, left_code, right_code, selected, metadata)[source]

Bases: PyCSAMTObject

Contact-ring input located at an exact shared interval boundary.

Parameters:
contact_id: str
borehole_id: str
family: str
md: float
position: tuple[float, float, float]
tangent: tuple[float, float, float]
display_radius: float
left_code: str | None
right_code: str | None
selected: bool
metadata: dict[str, Any]
class pycsamt.format.borehole.render.StructureGlyphPrimitive(glyph_id, borehole_id, kind, md, position, borehole_tangent, representation, orientation, display_radius, selected, metadata)[source]

Bases: PyCSAMTObject

Position and orientation inputs for one structural glyph.

Parameters:
glyph_id: str
borehole_id: str
kind: str
md: float
position: tuple[float, float, float]
borehole_tangent: tuple[float, float, float]
representation: str
orientation: dict[str, float]
display_radius: float
selected: bool
metadata: dict[str, Any]
class pycsamt.format.borehole.render.MaterialBatch(family, color, segment_ids)[source]

Bases: PyCSAMTObject

Stable grouping of segments sharing one family and material color.

Parameters:
family: str
color: str
segment_ids: tuple[str, ...]
class pycsamt.format.borehole.render.BoreholeRenderModel(borehole_id, collar, centerline, interval_segments, contacts, structure_glyphs, source_checksum, display_radius)[source]

Bases: PyCSAMTObject

Complete viewer-neutral primitives for one borehole.

Parameters:
  • borehole_id (str)

  • collar (CollarPrimitive)

  • centerline (PolylinePrimitive)

  • interval_segments (tuple[IntervalSegmentPrimitive, ...])

  • contacts (tuple[ContactPrimitive, ...])

  • structure_glyphs (tuple[StructureGlyphPrimitive, ...])

  • source_checksum (str)

  • display_radius (float)

borehole_id: str
collar: CollarPrimitive
centerline: PolylinePrimitive
interval_segments: tuple[IntervalSegmentPrimitive, ...]
contacts: tuple[ContactPrimitive, ...]
structure_glyphs: tuple[StructureGlyphPrimitive, ...]
source_checksum: str
display_radius: float
class pycsamt.format.borehole.render.PCBHRenderModel(document_id, crs_horizontal, coordinate_unit, boreholes, batches, bounds, lod_tolerance, sampling_step_md, max_points_per_hole, radius_policy)[source]

Bases: PyCSAMTObject

Complete render contract for one PCBH document.

Parameters:
document_id: str
crs_horizontal: str
coordinate_unit: str
boreholes: tuple[BoreholeRenderModel, ...]
batches: tuple[MaterialBatch, ...]
bounds: tuple[float, float, float, float, float, float]
lod_tolerance: float
sampling_step_md: float
max_points_per_hole: int
radius_policy: DisplayRadiusPolicy
class pycsamt.format.borehole.render.BoreholeRenderBuilder[source]

Bases: PyCSAMTObject

Build reusable render primitives while caching scientific paths.

property cache_size: int[source]

Number of geometry checksums currently cached.

clear_cache()[source]

Discard cached desurveyed centerlines.

Return type:

None

build(document, *, family='lithology', selected_ids=None, radius_policy=None, lod_tolerance=0.0, sampling_step_md=10.0, max_points_per_hole=10000)[source]

Build a backend-independent render model for one PCBH document.

Parameters:
  • document (PCBHDocument)

  • family (str)

  • selected_ids (set[str] | None)

  • radius_policy (DisplayRadiusPolicy | None)

  • lod_tolerance (float)

  • sampling_step_md (float)

  • max_points_per_hole (int)

Return type:

PCBHRenderModel

pycsamt.format.borehole.render.build_render_model(document, *, family='lithology', selected_ids=None, radius_policy=None, lod_tolerance=0.0, sampling_step_md=10.0, max_points_per_hole=10000)[source]

Build a render model with a short-lived builder.

Parameters mirror BoreholeRenderBuilder.build(). Distances are in the document coordinate/depth unit and no CRS transformation is applied.

Parameters:
  • document (PCBHDocument)

  • family (str)

  • selected_ids (set[str] | None)

  • radius_policy (DisplayRadiusPolicy | None)

  • lod_tolerance (float)

  • sampling_step_md (float)

  • max_points_per_hole (int)

Return type:

PCBHRenderModel

pycsamt.format.borehole.render.deterministic_color(value)[source]

Return a process-independent, readable color for a vocabulary key.

Parameters:

value (str)

Return type:

str