40 lines
1 KiB
TypeScript
40 lines
1 KiB
TypeScript
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 {
|
||
/** Calibration points in normalized [0,1] camera-frame coordinates. */
|
||
imagePoints: Vec2[];
|
||
/** Corresponding machine coordinates, mm. */
|
||
machinePoints: Vec2[];
|
||
/** machine-mm → normalized [0,1] image coords. */
|
||
homography: Mat3;
|
||
}
|
||
|
||
export interface RenderStyle {
|
||
cutColor: string;
|
||
rapidColor: string;
|
||
lineWidth: number;
|
||
}
|
||
|
||
export interface AppConfig {
|
||
streamUrl: string;
|
||
calibration: Calibration | null;
|
||
renderDefaults: RenderStyle;
|
||
}
|