Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-05-21 13:42:59 +00:00
parent e136dbc9c2
commit fea528f59f
+26
View File
@@ -493,6 +493,32 @@ export const useModelStore = create<ModelStore>((set, get) => ({
}
return { measurements: state.measurements.slice(0, -1) };
}),
registerHoverMeasurement: (info) => set((state) => {
let measurement: Measurement;
if (info.type === 'hole') {
const c: MeasurePoint = { x: info.position[0], y: info.position[1], z: info.position[2] };
measurement = {
id: `m_${Date.now()}`,
pointA: c,
pointB: c,
distanceMM: info.value,
kind: 'hole',
label: `Ø ${info.value.toFixed(1)}`,
};
} else {
const a = info.endpoints?.a ?? { x: info.position[0], y: info.position[1], z: info.position[2] };
const b = info.endpoints?.b ?? a;
measurement = {
id: `m_${Date.now()}`,
pointA: a,
pointB: b,
distanceMM: info.value,
kind: 'edge',
label: `${info.value.toFixed(1)} mm`,
};
}
return { measurements: [...state.measurements, measurement], hoverInfo: null };
}),
compareMode: false,