experimental async threaded cam topo

This commit is contained in:
Stewart Allen 2023-01-08 14:04:02 -05:00
commit db13a61d3b
9 changed files with 158 additions and 35 deletions

View file

@ -26,7 +26,7 @@ const POLY = polygons;
* @param {Widget} widget
* @param {Function} output
*/
CAM.slice = function(settings, widget, onupdate, ondone) {
CAM.slice = async function(settings, widget, onupdate, ondone) {
let mesh = widget.mesh,
proc = settings.process,
stock = settings.stock || {},
@ -238,7 +238,7 @@ CAM.slice = function(settings, widget, onupdate, ondone) {
setAxisIndex();
for (let op of opList) {
let weight = op.weight();
op.slice((progress, message) => {
await op.slice((progress, message) => {
onupdate((opSum + (progress * weight)) / opTot, message || op.type());
});
tracker.rotation = isIndexed ? axisRotation : 0;