Skip to main content

Module sinks

Module sinks 

Source
Expand description

Default output hooks: receive events and produce the file output of cumulus3d stream.

HookEvents receivedOutput
TimelineSinkevents that have text (table below)timeline.txt (epoch seconds.nanoseconds text)
RunLogSinkevents that have text, Log, Finishedrun.log (+ standard output), DONE
ZonePlySinkZonePreview, ZoneRefined (dense true)full/preview/preview_KK_posLO-HI.ply, full/refined/refined_KK_posLO-HI.ply
ModelSinkZoneArrived, ZonePreview, ZoneAdjusted, ZoneRefinedPose, AllRefinedDonework/models/{snap,preview,ba,refined}_K/, work/models/chain/
SnapshotSinkzone events, AllRefinedDonealigned/, snapshots/event_NN_TTTT.Ts_KIND_K.ply, snapshots/manifest.json, snapshots/timeline.txt, final_frame/, live/, run.log summary

Event -> timeline text conversion table (Event::timeline_text, TIMELINE_TABLE):

EventText
Started { positions: Some(N) }start NPOS=N
ModelInitialized { registered: N }init_model Registered images: N
BaseAdopted { zone: K }adopt refined K as base
PositionDone { position: P, registered: R, expected: E }pos P registered R/E
ZoneArrived { range: K [LO,HI) }region K arrived pos[LO,HI)
ZonePreview { range: K }preview K ready
RefineStarted { zone: K }refined K ba_start
ZoneRefinedPose { range: K, registered: N, mean_reproj_px: X }refined K pose_ready Registered images: N Mean reprojection error: X(6 decimal places)px (including the trailing space)
ZoneRefined { range: K }refined K ready
AllPositionsDoneall positions done
AllRefinedDoneall refined done

Ordering: the hooks of one output folder must be bundled in a single DefaultSinks and handled in event order. In an asynchronous pipeline the order between per-kind lanes is not guaranteed, so use attach (a single on_any). default_sinks (a per-kind list) is for synchronous mode (Pipeline::sync(true)) or direct calls.

Structs§

DefaultSinks
The default hook bundle of one output folder (handled in the order timeline -> run.log -> full PLY -> models -> snapshots).
ModelSink
--save-models: per-zone sparse models under work/models/. ZoneArrived → snap_K, ZonePreview → preview_K, ZoneAdjusted → ba_K, ZoneRefinedPose → refined_K, AllRefinedDone → chain.
RunLog
Shared handle to run.log. Several hooks (such as SnapshotSink, which writes a summary) write to the same file.
RunLogSink
run.log: timeline text is [HH:MM:SS] text, Log as is (with the time prefix if stamped), Finished is followed by the DONE file after the per-stage times (including the hook-measured post) and the final chain model summary. Warning/Error come together with a Log of the same content, so they are not written separately.
SinkOptions
Default hook settings.
SinkSet
Which default hooks to enable (DefaultSinks::with_set).
SnapshotSink
Hook for alignment, masking, per-event snapshots, manifest and re-anchoring (final_frame). It collects zone results and builds them all at once with post::run_zones at AllRefinedDone. Times are seconds relative to Started (or the first received event if absent).
TimelineSink
timeline.txt: for every event that has text, one line epoch seconds.nanoseconds text (time = meta.at).
ZonePlySink
full/preview/preview_KK_posLO-HI.ply, full/refined/refined_KK_posLO-HI.ply (x y z nx ny nz red green blue). Events whose dense is false (no densification or failed) are not written.

Constants§

TIMELINE_TABLE
Event kinds that produce timeline text (conversion rules in Event::timeline_text).

Traits§

Sink
A hook that receives events and produces output.

Functions§

any_hook
One hook as an all-event hook (on_any). It filters and handles only the kinds it accepts.
attach
Attach the default hooks to a pipeline (a single on_any, so the order is preserved even in asynchronous mode).
default_sinks
The default hooks as a per-kind list (sharing state). For a synchronous pipeline (sync(true)) or direct calls.
hooks
One hook as a per-kind hook list (sharing the same state). Use it only in synchronous mode if ordering between kinds is needed.

Type Aliases§

Hook
One hook (the shape passed to the pipeline’s .on/.on_any).