a little tidying

This commit is contained in:
Stewart Allen 2025-12-06 18:08:09 -05:00
commit 6ad3f7c94b
3 changed files with 9 additions and 14 deletions

View file

@ -3,10 +3,10 @@
import { api } from '../../core/api.js'; import { api } from '../../core/api.js';
import { env, clearPops } from './client.js'; import { env, clearPops } from './client.js';
import { CAM } from './driver-fe.js'; import { CAM } from './driver-fe.js';
import { lastTrace, setLastTrace } from './cl-trace.js';
export let holeSelOn = false; export let holeSelOn = false;
export let lastSelHoles; export let lastSelHoles;
let holeGeo = new THREE.CylinderGeometry(1,1,1,20); let holeGeo = new THREE.CylinderGeometry(1,1,1,20);
let holeMaterial = new THREE.MeshPhongMaterial( ); let holeMaterial = new THREE.MeshPhongMaterial( );
let alert; let alert;

View file

@ -82,12 +82,7 @@ function holes(indiv, rec, onProgress, onDone) {
}) })
}; };
function cylinderShow(onProgress,onDone){ function cylinderToggle(widget, face, onDone) {
kiri.client.sync();
const settings = api.conf.get();
}
function cylinderToggle(widget, face, onDone){
let cyls = widget._cylinders = widget._cylinders || {}; let cyls = widget._cylinders = widget._cylinders || {};
for (let [root, faces] of Object.entries(cyls)) { for (let [root, faces] of Object.entries(cyls)) {
if (faces.contains(face)) { // if a face group contains the selected face if (faces.contains(face)) { // if a face group contains the selected face
@ -99,16 +94,16 @@ function cylinderShow(onProgress,onDone){
} }
} }
//send //send
api.client.send("cam_cylinder_find", { id: widget.id, face }, ({faces,error}) => { api.client.send("cam_cylinder_find", { id: widget.id, face }, ({ faces, error }) => {
if (faces?.length) { if (faces?.length) {
cyls[face] = faces; cyls[face] = faces;
CAM.cylinder_show(widget); CAM.cylinder_show(widget);
} }
onDone({faces:Object.keys(cyls).map(v => parseInt(v)),error}); onDone({ faces: Object.keys(cyls).map(v => parseInt(v)), error });
}); });
} }
function cylinderClear(widget){ function cylinderClear(widget) {
widget.selectFaces([]); widget.selectFaces([]);
widget._cylinders = {}; widget._cylinders = {};
} }

View file

@ -1,15 +1,15 @@
/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */ /** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
import { util } from '../../../geo/base.js'; import { CAM } from './driver-be.js';
import { newLine } from '../../../geo/line.js'; import { newLine } from '../../../geo/line.js';
import { newPoint } from '../../../geo/point.js'; import { newPoint } from '../../../geo/point.js';
import { newPolygon } from '../../../geo/polygon.js'; import { newPolygon } from '../../../geo/polygon.js';
import { ops as OPS } from './ops.js';
import { polygons as POLY } from '../../../geo/polygons.js'; import { polygons as POLY } from '../../../geo/polygons.js';
import { setSliceTracker } from '../../core/slice.js'; import { setSliceTracker } from '../../core/slice.js';
import { ops as OPS } from './ops.js';
import { Tool } from './tool.js';
import { Slicer as cam_slicer } from './slicer_cam.js'; import { Slicer as cam_slicer } from './slicer_cam.js';
import { CAM } from './driver-be.js'; import { Tool } from './tool.js';
import { util } from '../../../geo/base.js';
/** /**
* DRIVER SLICE CONTRACT * DRIVER SLICE CONTRACT