Merge branch 'rel-4.2' into dev-4.2-refactor-module
This commit is contained in:
commit
d8db4dd4fd
5 changed files with 58 additions and 20 deletions
16
readme.md
16
readme.md
|
|
@ -92,6 +92,22 @@ npm run setup
|
|||
npm run dev
|
||||
```
|
||||
|
||||
## TrueNAS Via YAML
|
||||
|
||||
`Apps > Discover Apps > Install via YAML`
|
||||
|
||||
```
|
||||
services:
|
||||
kirimoto:
|
||||
build:
|
||||
context: https://github.com/GridSpace/grid-apps.git#refs/tags/latest
|
||||
dockerfile: ./src/dock/Dockerfile
|
||||
ports:
|
||||
- "8080:8080"
|
||||
```
|
||||
|
||||
## For any default install...
|
||||
|
||||
Then open a browser to [localhost:8080/kiri](http://localhost:8080/kiri)
|
||||
|
||||
# Windows Developers
|
||||
|
|
|
|||
|
|
@ -92,13 +92,13 @@ kiri.load(api => {
|
|||
//if a progress message,
|
||||
onProgress(out.progress,out.msg)
|
||||
}else{
|
||||
api.hide.alert(alert)
|
||||
onDone(out)
|
||||
res(out)
|
||||
api.hide.alert(alert);
|
||||
onDone(out);
|
||||
res(out);
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if (kiri.worker) {
|
||||
|
|
@ -166,7 +166,7 @@ kiri.load(api => {
|
|||
const { settings, indiv, rec } = data;
|
||||
const widgets = Object.values(kiri.worker.cache);
|
||||
const fresh = [];
|
||||
|
||||
|
||||
for (let [i,widget] of widgets.entries() ) {
|
||||
if (await CAM.holes(settings, widget, indiv, rec,
|
||||
( prog, msg )=>{ send.data({progress: (i/widgets.length)+(prog/widgets.length),msg})}
|
||||
|
|
|
|||
|
|
@ -995,6 +995,8 @@ class OpTrace extends CamOp {
|
|||
let traceOffset = camTool.traceOffset()
|
||||
let cutdir = ov_conv;
|
||||
let polys = [];
|
||||
let reContour = false;
|
||||
let canRecontour = offset !== 'none' && down === 0;
|
||||
let stockRect = stock.center && stock.x && stock.y ?
|
||||
newPolygon().centerRectangle({x:0,y:0}, stock.x, stock.y) : undefined;
|
||||
updateToolDiams(toolDiam);
|
||||
|
|
@ -1008,6 +1010,12 @@ class OpTrace extends CamOp {
|
|||
let poly = newPolygon().fromArray(arr);
|
||||
POLY.setWinding([ poly ], cutdir, false);
|
||||
polys.push(poly);
|
||||
let zs = poly.points.map(p => p.z);
|
||||
let min = Math.min(...zs);
|
||||
let max = Math.max(...zs);
|
||||
if (max - min > 0.0001 && canRecontour) {
|
||||
reContour = true;
|
||||
}
|
||||
}
|
||||
if (false) newSliceOut(0).output()
|
||||
.setLayer("polys", {line: 0xaaaa00}, false)
|
||||
|
|
@ -1036,6 +1044,9 @@ class OpTrace extends CamOp {
|
|||
if (camStockClipTo && stockRect) {
|
||||
slice.camLines = cutPolys([stockRect], slice.camLines, z, true);
|
||||
}
|
||||
if (reContour) {
|
||||
state.contourPolys(widget, slice.camLines);
|
||||
}
|
||||
slice.output()
|
||||
.setLayer("trace follow", {line: color}, false)
|
||||
.addPolys(slice.camLines)
|
||||
|
|
|
|||
|
|
@ -165,6 +165,7 @@ CAM.slice = async function(settings, widget, onupdate, ondone) {
|
|||
tabs,
|
||||
cutTabs,
|
||||
cutPolys,
|
||||
contourPolys,
|
||||
healPolys,
|
||||
shadowAt,
|
||||
slicer,
|
||||
|
|
@ -365,8 +366,6 @@ CAM.slice = async function(settings, widget, onupdate, ondone) {
|
|||
ondone();
|
||||
};
|
||||
|
||||
|
||||
|
||||
CAM.addDogbones = function(poly, dist, reverse) {
|
||||
if (Array.isArray(poly)) {
|
||||
return poly.forEach(p => CAM.addDogbones(p, dist));
|
||||
|
|
@ -413,7 +412,7 @@ CAM.traces = async function(settings, widget, single) {
|
|||
}
|
||||
|
||||
// --- points → line segments ---
|
||||
let edges = new THREE.EdgesGeometry(widget.mesh.geometry, 20);
|
||||
let edges = new THREE.EdgesGeometry(widget.mesh.geometry, settings.controller.edgeangle ?? 20);
|
||||
let array = edges.attributes.position.array;
|
||||
let pcache = {};
|
||||
let points = new Array(2);
|
||||
|
|
@ -512,16 +511,16 @@ CAM.traces = async function(settings, widget, single) {
|
|||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* Generate a list of holes in the model based on the given diameter.
|
||||
*
|
||||
* @param {Object} settings - settings object
|
||||
* @param {Object} widget - widget object
|
||||
* @param {boolean} individual - if true, drill holes individually
|
||||
* @param {Object} rec - DrillOp record
|
||||
* @param {Function} onProgress - callback function to report progress
|
||||
* @returns {Array} list of hole centers as objects with `x`, `y`, `z`, `depth`, and `selected` properties.
|
||||
*/
|
||||
/**
|
||||
* Generate a list of holes in the model based on the given diameter.
|
||||
*
|
||||
* @param {Object} settings - settings object
|
||||
* @param {Object} widget - widget object
|
||||
* @param {boolean} individual - if true, drill holes individually
|
||||
* @param {Object} rec - DrillOp record
|
||||
* @param {Function} onProgress - callback function to report progress
|
||||
* @returns {Array} list of hole centers as objects with `x`, `y`, `z`, `depth`, and `selected` properties.
|
||||
*/
|
||||
CAM.holes = async function(settings, widget, individual, rec,onProgress) {
|
||||
|
||||
let {tool,mark,precision} = rec //TODO: display some visual difference if mark is selected
|
||||
|
|
@ -603,7 +602,6 @@ CAM.holes = async function(settings, widget, individual, rec,onProgress) {
|
|||
|
||||
// //if on the same xy point,
|
||||
if (dist <= centerDiff ) {
|
||||
|
||||
// console.log("overlap",center,circle);
|
||||
circle.overlapping.push(center);
|
||||
// if overlapping, don't add and continue
|
||||
|
|
@ -669,6 +667,19 @@ function cutPolys(polys, offset, z, inter) {
|
|||
return healPolys(noff);
|
||||
}
|
||||
|
||||
function contourPolys(widget, polys) {
|
||||
const raycaster = new THREE.Raycaster();
|
||||
raycaster.ray.direction.set(0, 0, -1); // ray pointing down Z
|
||||
for (let poly of polys) {
|
||||
for (let point of poly.points) {
|
||||
raycaster.ray.origin.set(point.x, point.y, 10000);
|
||||
const intersects = raycaster.intersectObject(widget.mesh, false);
|
||||
const firstHit = intersects[0] || null;
|
||||
point.z = firstHit.point.z;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function healPolys(noff) {
|
||||
if (noff.length > 1) {
|
||||
let heal = 0;
|
||||
|
|
|
|||
|
|
@ -493,7 +493,7 @@ const conf = exports({
|
|||
camTracePlunge: 200,
|
||||
camTraceOffOver: 0,
|
||||
camTraceDogbone: false,
|
||||
camTraceMerge: true,
|
||||
camTraceMerge: false,
|
||||
camTraceLines: false,
|
||||
camTraceZTop: 0,
|
||||
camTraceZBottom: 0,
|
||||
|
|
|
|||
Loading…
Reference in a new issue