enable wasm acceleration for layer diffs
This commit is contained in:
parent
97979dcefa
commit
a9e22e802f
3 changed files with 11 additions and 5 deletions
|
|
@ -314,7 +314,7 @@
|
||||||
opt.prof.call = (opt.prof.call || 0) + 1;
|
opt.prof.call = (opt.prof.call || 0) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (false && opt.wasm) {
|
if (opt.wasm && geo.wasm) {
|
||||||
let oA = outA ? [] : undefined;
|
let oA = outA ? [] : undefined;
|
||||||
let oB = outB ? [] : undefined;
|
let oB = outB ? [] : undefined;
|
||||||
geo.wasm.js.diff(setA, setB, z, oA, oB);
|
geo.wasm.js.diff(setA, setB, z, oA, oB);
|
||||||
|
|
|
||||||
|
|
@ -448,7 +448,7 @@
|
||||||
if (solidLayers && !vaseMode && !isSynth) {
|
if (solidLayers && !vaseMode && !isSynth) {
|
||||||
profileStart("delta");
|
profileStart("delta");
|
||||||
forSlices(0.2, 0.34, slice => {
|
forSlices(0.2, 0.34, slice => {
|
||||||
if (slice.index > 0) doDiff(slice, solidMinArea);
|
if (slice.index > 0) doDiff(slice, solidMinArea, { wasm: useAssembly });
|
||||||
}, "layer deltas");
|
}, "layer deltas");
|
||||||
profileEnd();
|
profileEnd();
|
||||||
profileStart("delta-project");
|
profileStart("delta-project");
|
||||||
|
|
@ -1038,10 +1038,11 @@
|
||||||
* Used to calculate bridges, flats and then solid projections.
|
* Used to calculate bridges, flats and then solid projections.
|
||||||
* 'expand' is used for top offsets in SLA mode
|
* 'expand' is used for top offsets in SLA mode
|
||||||
*/
|
*/
|
||||||
function doDiff(slice, minArea, sla, fakedown) {
|
function doDiff(slice, minArea, options = {}) {
|
||||||
if (slice.index === 0 && !fakedown) {
|
if (slice.index === 0 && !fakedown) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const { sla, fakedown } = options;
|
||||||
const top = slice,
|
const top = slice,
|
||||||
down = slice.down || (fakedown ? newSlice(-1) : null),
|
down = slice.down || (fakedown ? newSlice(-1) : null),
|
||||||
topInner = sla ? top.topPolys() : top.topInners(),
|
topInner = sla ? top.topPolys() : top.topInners(),
|
||||||
|
|
@ -1056,7 +1057,9 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
POLY.subtract(topInner, downInner, bridges, flats, slice.z, minArea);
|
POLY.subtract(topInner, downInner, bridges, flats, slice.z, minArea, {
|
||||||
|
wasm: options.wasm
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,10 @@
|
||||||
}, "shells");
|
}, "shells");
|
||||||
forSlices(slices, 10, (slice) => {
|
forSlices(slices, 10, (slice) => {
|
||||||
if (slice.synth) return;
|
if (slice.synth) return;
|
||||||
FDM.doDiff(slice, 0.000001, true, !process.slaOpenBase);
|
FDM.doDiff(slice, 0.000001, {
|
||||||
|
sla: true,
|
||||||
|
fakedown: !process.slaOpenBase
|
||||||
|
});
|
||||||
}, "delta");
|
}, "delta");
|
||||||
if (solidLayers) {
|
if (solidLayers) {
|
||||||
forSlices(slices, 10, (slice) => {
|
forSlices(slices, 10, (slice) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue