Attach machine preview path to rotary cradle
This commit is contained in:
@@ -131,8 +131,11 @@ export function XyzacMachineView({ visual, toolpath, view = "p", zoom = 1, rotat
|
||||
},
|
||||
};
|
||||
|
||||
const pathGroup = new THREE.Group(); pathGroup.name = "xyzac-toolpath"; scene.add(pathGroup);
|
||||
const liveGroup = new THREE.Group(); liveGroup.name = "xyzac-live-toolpath"; scene.add(liveGroup);
|
||||
// The programmed path represents the part fixed on the rotary cradle.
|
||||
// Keep it in the table's local frame so A/B tilt and C rotation carry the
|
||||
// workpiece path together with the physical table.
|
||||
const pathGroup = new THREE.Group(); pathGroup.name = "xyzac-toolpath"; assembly.joints.rotate.add(pathGroup);
|
||||
const liveGroup = new THREE.Group(); liveGroup.name = "xyzac-live-toolpath"; assembly.joints.rotate.add(liveGroup);
|
||||
const pathMaterials = [0xdce7e8, 0xff9a55, 0x5c9d9a].map((color) => new THREE.LineBasicMaterial({ color }));
|
||||
const clearLines = (group: THREE.Group) => { group.children.forEach((child) => (child as THREE.Line).geometry.dispose()); group.clear(); };
|
||||
const limits = new THREE.Box3Helper(new THREE.Box3(), 0xdd7566); scene.add(limits);
|
||||
@@ -166,6 +169,8 @@ export function XyzacMachineView({ visual, toolpath, view = "p", zoom = 1, rotat
|
||||
if (preset !== lastPreset) { presetCamera(); lastPreset = preset; }
|
||||
controls.update(); renderer.render(scene, camera);
|
||||
element.dataset.xyzacRenderedTick = String(state.tick);
|
||||
element.dataset.xyzacToolpathFrame = assembly.joints.rotate.name;
|
||||
element.dataset.xyzacToolpathAttached = String(pathGroup.parent === assembly.joints.rotate && liveGroup.parent === assembly.joints.rotate);
|
||||
element.dataset.xyzacToolTip = JSON.stringify(assembly.toolTip.getWorldPosition(new THREE.Vector3()).toArray());
|
||||
frame = requestAnimationFrame(render);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user