merge let blocks
This commit is contained in:
parent
01b81a101d
commit
5c0fbbcba6
2 changed files with 13 additions and 14 deletions
|
|
@ -12,6 +12,8 @@ import { Stack } from '../../kiri/stack.js';
|
||||||
import { Tool } from './tool.js';
|
import { Tool } from './tool.js';
|
||||||
import { CAM } from './driver-fe.js';
|
import { CAM } from './driver-fe.js';
|
||||||
|
|
||||||
|
// import { opFlip } from './cl-flip.js';
|
||||||
|
|
||||||
const { alerts, conf, noop, space } = api;
|
const { alerts, conf, noop, space } = api;
|
||||||
|
|
||||||
const DEG2RAD = Math.PI / 180;
|
const DEG2RAD = Math.PI / 180;
|
||||||
|
|
@ -38,15 +40,14 @@ let isAnimate,
|
||||||
WIDGETS = api.widgets,
|
WIDGETS = api.widgets,
|
||||||
UI = api.ui,
|
UI = api.ui,
|
||||||
UC = api.uc,
|
UC = api.uc,
|
||||||
MCAM = MODES.CAM;
|
MCAM = MODES.CAM,
|
||||||
|
zaxis = { x: 0, y: 0, z: 1 },
|
||||||
let zaxis = { x: 0, y: 0, z: 1 },
|
|
||||||
popOp = {},
|
popOp = {},
|
||||||
animVer = 0,
|
animVer = 0,
|
||||||
seed = Date.now(),
|
seed = Date.now(),
|
||||||
func = {
|
func = {
|
||||||
hover: noop,
|
hover: noop,
|
||||||
hoverUp: noop
|
hoverUp: noop,
|
||||||
};
|
};
|
||||||
|
|
||||||
function animFn() {
|
function animFn() {
|
||||||
|
|
@ -407,7 +408,6 @@ func.surfaceDone = () => {
|
||||||
|
|
||||||
// TRACE FUNCS
|
// TRACE FUNCS
|
||||||
let traceOn = false, lastTrace;
|
let traceOn = false, lastTrace;
|
||||||
|
|
||||||
func.traceAdd = (ev) => {
|
func.traceAdd = (ev) => {
|
||||||
if (traceOn) {
|
if (traceOn) {
|
||||||
return func.traceDone();
|
return func.traceDone();
|
||||||
|
|
@ -856,6 +856,14 @@ func.opFlip = () => {
|
||||||
|
|
||||||
export function init() {
|
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 = () => {
|
api.event.on("cam.trace.clear", func.traceClear = () => {
|
||||||
func.traceDone();
|
func.traceDone();
|
||||||
api.widgets.all().forEach(widget => {
|
api.widgets.all().forEach(widget => {
|
||||||
|
|
@ -1870,14 +1878,6 @@ export function init() {
|
||||||
api.event.emit('tool.mesh.face-up');
|
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', {
|
createPopOp('index', {
|
||||||
degrees: 'camIndexAxis',
|
degrees: 'camIndexAxis',
|
||||||
absolute: 'camIndexAbs'
|
absolute: 'camIndexAbs'
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
import { api } from './api.js';
|
import { api } from './api.js';
|
||||||
import { noop } from './utils.js';
|
import { noop } from './utils.js';
|
||||||
import { version } from '../moto/license.js';
|
|
||||||
|
|
||||||
// this code runs in kiri's main loop
|
// this code runs in kiri's main loop
|
||||||
let debug = self.debug === true,
|
let debug = self.debug === true,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue