grid-apps-cmms/src/kiri/mode/cam/op-xray.js
Stewart Allen e0b1c4e31f CAM routing refactor, area operation, and taper ball tool implementation
Major routing improvements:
- Refactor depth-first routing algorithm for better path optimization
- Reimplemented outline, roughing, pocket, and trace as area operation wrappers
- Add pocket shadow travel routing with optimized descent using travel bounds
- Improve contour routing with arc detection and polyEmit arc strategy
- Add area smoothing and ease-down options
- Fix outline handling with thru holes and surface reversal on tip2tip
- Move widget shadow methods into widget class for faster hole detection
- Better camInnerFirst support and proper feed/plunge defaults

Tool system improvements:
- Implement taper ball tool type with full support
- Add renderTool2() for profile-based visualization
- Convert tool menu to init code with bound vars
- Fix auto tool and auto spindle for prep operations
- Update tool profile generation for taperball geometry
- Add calcTaperBallExtent() for proper ball tangency calculations

Code cleanup:
- Remove duplicated slicer code from specialized slicers
- Asyncify shadowAt operations
- Deprecate pocket engrave operation
- Simplify upNover implementation
- Fix animation with new tool+settings requirements
2025-12-06 00:09:17 -05:00

32 lines
1,018 B
JavaScript

/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
import { CamOp } from './op.js';
import { newSlice } from '../../core/slice.js';
import { Slicer } from './slicer_cam.js';
class OpXRay extends CamOp {
constructor(state, op) {
super(state, op);
}
async slice(progress) {
let { widget, addSlices } = this.state;
let slicer = new Slicer(widget);
let xrayind = Object.keys(slicer.zLine)
.map(v => parseFloat(v).round(5))
.sort((a,b) => a-b);
let xrayopt = { each: data => {
let slice = newSlice(data.z);
slice.addTops(data.tops);
// data.tops.forEach(top => slice.addTop(top));
slice.lines = data.lines;
slice.xray();
addSlices(slice);
}, over: false, flatoff: 0, edges: true, openok: true };
await slicer.slice(xrayind, xrayopt);
// xrayopt.over = true;
// slicer.slice(xrayind, xrayopt);
}
}
export { OpXRay };