Skip to main content

raygeo.trace

Binary trace-file reader and shared move-type classification.

MoveKind — standard move-type classification shared by all operations. TraceFile — read a .bin trace file with span/event access. Span — one span record from a trace file. Event — one event record from a trace file. ToolSnapshot — tool position and heading snapshot. ProgressSnapshot — step progress snapshot.

Event

One trace event (init / move / resume / exit).

kind

kind: str

meta

meta: Any

move_kind

move_kind: Optional[str]

progress

progress: Optional[ProgressSnapshot]

seq

seq: int

source

source: str

span

span: int

tool

tool: Optional[ToolSnapshot]

MoveKind

Standard move-type classification shared by all operations.

Every toolpath point is tagged with one of these so that renderers can colour and categorise moves generically.

name

name: str

value

value: int

ProgressSnapshot

Snapshot of step progress during trace execution.

ops_len

ops_len: int

status

status: int

step_idx

step_idx: int

Span

One span record from a trace file.

attrs

attrs: Any

children

children: list[Span]

events

events: list[Event]

id

id: int

label

label: str

parent

parent: int

source

source: str

ToolSnapshot

Snapshot of tool position and heading at a trace event.

heading

heading: float

pos_x

pos_x: float

pos_y

pos_y: float

pos_z

pos_z: float

prev_x

prev_x: float

prev_y

prev_y: float

prev_z

prev_z: float

TraceFile

Binary trace file with span/event access.

Usage::

>>> from raygeo.trace import TraceFile
>>> t = TraceFile("path/to/trace.bin")
>>> t.ver
3
>>> t.root
Span(id=1, parent=0, source='workplan', label='Workplan')
>>> len(t.events)
42

events

events: list[Event]

root

root: Optional[Span]

The root span (first span with parent == 0), or None.

sources

sources: Any

Distinct source strings across all spans and events.

spans

spans: list[Span]

ver

ver: int

toolpath()

toolpath(span: Optional[Any] = None) -> list[tuple[float, float, str]]

Toolpath points from Move events.

Returns a list of (x, y, move_kind_name) tuples. If span is given (an int span id or a Span object), restrict to events belonging to that span.

ParameterTypeDescription
spanOptional[Any] = None
Returnslist[tuple[float, float, str]]

Functions

get_route_detail_name()

get_route_detail_name(detail: int) -> str

Return a human-readable label for a route-strategy detail code.

ParameterTypeDescription
detailint
Returnsstr