Changes
Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user