diff --git a/src2/kiri-mode/cam/client.js b/src2/kiri-mode/cam/client.js index 15679976..21b4f223 100644 --- a/src2/kiri-mode/cam/client.js +++ b/src2/kiri-mode/cam/client.js @@ -12,6 +12,8 @@ import { Stack } from '../../kiri/stack.js'; import { Tool } from './tool.js'; import { CAM } from './driver-fe.js'; +// import { opFlip } from './cl-flip.js'; + const { alerts, conf, noop, space } = api; const DEG2RAD = Math.PI / 180; @@ -38,15 +40,14 @@ let isAnimate, WIDGETS = api.widgets, UI = api.ui, UC = api.uc, - MCAM = MODES.CAM; - -let zaxis = { x: 0, y: 0, z: 1 }, + MCAM = MODES.CAM, + zaxis = { x: 0, y: 0, z: 1 }, popOp = {}, animVer = 0, seed = Date.now(), func = { hover: noop, - hoverUp: noop + hoverUp: noop, }; function animFn() { @@ -407,7 +408,6 @@ func.surfaceDone = () => { // TRACE FUNCS let traceOn = false, lastTrace; - func.traceAdd = (ev) => { if (traceOn) { return func.traceDone(); @@ -856,6 +856,14 @@ func.opFlip = () => { export function init() { + api.event.on('tool.mesh.face-normal', normal => { + // console.log({ poppedRec }); + poppedRec.degrees = (Math.atan2(normal.y, normal.z) * RAD2DEG).round(2); + poppedRec.absolute = true; + func.opRender(); + updateStock(); + }); + api.event.on("cam.trace.clear", func.traceClear = () => { func.traceDone(); api.widgets.all().forEach(widget => { @@ -1870,14 +1878,6 @@ export function init() { api.event.emit('tool.mesh.face-up'); } - api.event.on('tool.mesh.face-normal', normal => { - // console.log({ poppedRec }); - poppedRec.degrees = (Math.atan2(normal.y, normal.z) * RAD2DEG).round(2); - poppedRec.absolute = true; - func.opRender(); - updateStock(); - }); - createPopOp('index', { degrees: 'camIndexAxis', absolute: 'camIndexAbs' diff --git a/src2/kiri/client.js b/src2/kiri/client.js index 55c7a9de..c902a948 100644 --- a/src2/kiri/client.js +++ b/src2/kiri/client.js @@ -2,7 +2,6 @@ import { api } from './api.js'; import { noop } from './utils.js'; -import { version } from '../moto/license.js'; // this code runs in kiri's main loop let debug = self.debug === true,