2026-06-08 22:11:03 +02:00
|
|
|
|
export type Vec2 = [number, number];
|
|
|
|
|
|
|
|
|
|
|
|
/** Row-major 3×3 matrix. */
|
|
|
|
|
|
export type Mat3 = [number, number, number, number, number, number, number, number, number];
|
|
|
|
|
|
|
|
|
|
|
|
export type MoveKind = 'cut' | 'rapid';
|
|
|
|
|
|
|
|
|
|
|
|
/** A polyline in millimetres (machine coordinates before per-job alignment). */
|
|
|
|
|
|
export interface Segment {
|
|
|
|
|
|
kind: MoveKind;
|
|
|
|
|
|
points: Vec2[];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** Per-job placement: rotate the work coordinates by `rot`, then translate by (tx,ty). mm / radians. */
|
|
|
|
|
|
export interface Alignment {
|
|
|
|
|
|
tx: number;
|
|
|
|
|
|
ty: number;
|
|
|
|
|
|
rot: number;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface Calibration {
|
2026-06-08 22:45:29 +02:00
|
|
|
|
/** Calibration points in normalized [0,1] camera-frame coordinates. */
|
2026-06-08 22:11:03 +02:00
|
|
|
|
imagePoints: Vec2[];
|
|
|
|
|
|
/** Corresponding machine coordinates, mm. */
|
|
|
|
|
|
machinePoints: Vec2[];
|
2026-06-08 22:45:29 +02:00
|
|
|
|
/** machine-mm → normalized [0,1] image coords. */
|
2026-06-08 22:11:03 +02:00
|
|
|
|
homography: Mat3;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface RenderStyle {
|
|
|
|
|
|
cutColor: string;
|
|
|
|
|
|
rapidColor: string;
|
|
|
|
|
|
lineWidth: number;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface AppConfig {
|
|
|
|
|
|
streamUrl: string;
|
|
|
|
|
|
calibration: Calibration | null;
|
|
|
|
|
|
renderDefaults: RenderStyle;
|
|
|
|
|
|
}
|