🚀 Auto-deploy: melhoria no snap e medição AR em 28/05/2026 21:17:57
This commit is contained in:
@@ -391,7 +391,7 @@ function CutsTab() {
|
||||
return (
|
||||
<group key={axis} position={[0, yOffset, 0]}>
|
||||
{/* Eixo label */}
|
||||
<Text position={[-0.24, 0, 0]} fontSize={0.014} color={AXIS_COLOR[axis]} anchorX="left" anchorY="middle" fontStyle="bold">
|
||||
<Text position={[-0.24, 0, 0]} fontSize={0.014} color={AXIS_COLOR[axis]} anchorX="left" anchorY="middle">
|
||||
{AXIS_LABEL[axis]}
|
||||
</Text>
|
||||
|
||||
@@ -941,7 +941,7 @@ function CalibrationTab() {
|
||||
return (
|
||||
<group>
|
||||
{/* Coluna da esquerda: Informações e Fluxo */}
|
||||
<Text position={[-0.24, 0.11, 0]} fontSize={0.012} color="#3b82f6" anchorX="left" anchorY="middle" fontStyle="bold">
|
||||
<Text position={[-0.24, 0.11, 0]} fontSize={0.012} color="#3b82f6" anchorX="left" anchorY="middle">
|
||||
Calibração 3D da Peça
|
||||
</Text>
|
||||
|
||||
|
||||
@@ -37,11 +37,7 @@ export const xrCalibration: XRCalState = {
|
||||
};
|
||||
|
||||
function notify() {
|
||||
xrCalibration.listeners.forEach((fn) => {
|
||||
try {
|
||||
fn();
|
||||
} catch {}
|
||||
});
|
||||
xrCalibration.listeners.forEach((fn) => fn());
|
||||
}
|
||||
|
||||
export function subscribeXRCalibration(fn: () => void): () => void {
|
||||
@@ -137,14 +133,14 @@ export function computeXRCalibrationQuaternion(pairs: XRPair[]): THREE.Quaternio
|
||||
if (pairs.length < 2) return null;
|
||||
const n1 = pairs[0].model.clone().normalize();
|
||||
const n2raw = pairs[1].model.clone();
|
||||
let n2 = n2raw.sub(n1.clone().multiplyScalar(n2raw.dot(n1)));
|
||||
const n2 = n2raw.sub(n1.clone().multiplyScalar(n2raw.dot(n1)));
|
||||
if (n2.lengthSq() < 1e-6) return null;
|
||||
n2.normalize();
|
||||
const n3 = new THREE.Vector3().crossVectors(n1, n2);
|
||||
|
||||
const c1 = pairs[0].cube.clone().normalize();
|
||||
const c2raw = pairs[1].cube.clone();
|
||||
let c2 = c2raw.sub(c1.clone().multiplyScalar(c2raw.dot(c1)));
|
||||
const c2 = c2raw.sub(c1.clone().multiplyScalar(c2raw.dot(c1)));
|
||||
if (c2.lengthSq() < 1e-6) return null;
|
||||
c2.normalize();
|
||||
const c3 = new THREE.Vector3().crossVectors(c1, c2);
|
||||
|
||||
@@ -53,7 +53,9 @@ function loadXRFeatures() {
|
||||
try {
|
||||
const raw = localStorage.getItem('xrFeatures');
|
||||
if (raw) return { ...defaults, ...JSON.parse(raw) };
|
||||
} catch {}
|
||||
} catch (err) {
|
||||
console.warn('[XR] Falha ao ler xrFeatures do localStorage:', err);
|
||||
}
|
||||
return defaults;
|
||||
}
|
||||
const _xrf = loadXRFeatures();
|
||||
|
||||
Reference in New Issue
Block a user