Skip to main content

Module alignment

Module alignment 

Source
Expand description

Each print’s first-layer alignment verdict and its camera view: whether the camera calibration’s projection lands on that print’s printed first layer, and the correction every later drawing of the print goes through.

A projection can be wrong with the camera unmoved, and a camera that has shifted a little is ordinary on a real printer, so each print judges its own. Once the print’s first object layer is down, every scheduled check’s own stored frame is judged (Alignments::judge), at most once a check and with no camera fetch of its own, until one passes: the layer clearly found, on a frame the toolhead does not cover (printobserver_panels::judge_first_layer). A covered or unclear frame is inconclusive and the next check’s is judged again. A check taken while the printer reports the print paused is not judged: its bed is lowered off the plan’s height. Only a frame of another size or stream fails, and that holds for the rest of the print.

A pass puts the print’s correction in force, a translation every later drawing goes through, kept with the landmarks found agreeing on that frame as its reference. Its translation is the pass’s found shift when the frame stood within one layer of the first layer (printobserver_panels::alignment::correction_shift), and none from a taller frame, where the search scores the part’s body. Every later frame’s view is judged against that reference (printobserver_panels::judge_found); one showing the camera moved again sets the alignment back to pending, to take a fresh correction from a later check. Nothing is kept across prints: a sheet sits a few millimetres apart from one print to the next.

Every judgement is written into the print’s history, naming the stored frame it was made on (crate::judgements).

The verdict is written to <state_dir>/alignment/<print id>.json and the correction, the last inconclusive reason and the last check’s image to <state_dir>/camera-view/<print id>.json, so they stand through a restart while the print is open, and are deleted once the print closes. A verdict file an earlier release left failed on its offset is read as pending and judged again.

Which check draws the toolpath on its image reads the verdict through Alignments::print_alignment and draws only for a print that Passed.

Beside each verdict is kept the frame the print’s last check was given, which the next check’s image shows as the previous one (Alignments::previous_check): written under <state_dir>/previous-check/<print id>.json, standing through a restart while the print is open, and swept with the verdict once it closes.

And beside that, the frames of the print’s recent checks with the height the plan had reached at each (Alignments::checked_frames): written under <state_dir>/checked-frames/<print id>.json, kept and swept the same way, so that a check can measure whether the parts grew since one far enough below it (Alignments::growth_reference).

Structs§

Alignments
The alignment verdicts of every print, what decides them, the frame each print’s last check was given, and its recent checks’ frames and heights.
CheckedFrame
One check’s frame and the height the plan had reached as it was captured.
Judged
What one judgement of a frame decided, and the records it owes.
Judging
One frame to judge.
LastCheckImage
The image a print’s last check was shown, and when its frame was captured.
PreviousCheck
The frame one print’s last check was given, and when it was captured.

Enums§

AlignmentFailure
Why a print’s alignment failed.
AlignmentJudging
Whether a judgement of a frame judges the print’s first-layer alignment.
PrintAlignment
One print’s first-layer alignment verdict, as it is kept under the state directory — which the real-print suite’s record reads.

Functions§

camera_view_dir
The directory each print’s correction, last inconclusive reason and last check’s image are kept in, under a state directory.
checked_frames_dir
The directory each print’s recent checks’ frames and heights are kept in, under a state directory.
failure_sentence
A failure in the sentence its record and its fallback give it in.
previous_check_dir
The directory each print’s last check’s frame is named in, under a state directory.
verdict_dir
The directory verdicts are kept in, under a state directory.