From 52f6f40034a146202315424f829c6816efb7a393 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Thu, 12 Jan 2023 00:15:33 -0500 Subject: [PATCH 1/2] back out mem ref clear (causes support issues). bump rev 3.8.D9 --- package.json | 2 +- src/geo/slicer.js | 2 +- src/kiri-mode/fdm/slice.js | 1 + src/main/kiri.js | 2 +- src/moto/license.js | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 49d12420..cad51233 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grid-apps", - "version": "3.8.8D", + "version": "3.8.9D", "description": "grid.space 3d slice & modeling tools", "author": "Stewart Allen ", "license": "MIT", diff --git a/src/geo/slicer.js b/src/geo/slicer.js index 16a38ec9..ac509546 100644 --- a/src/geo/slicer.js +++ b/src/geo/slicer.js @@ -405,7 +405,7 @@ async function sliceZ(z, points, options = {}) { } // free objects to be re-claimed and reduce memory pressure - if (true) { + if (false) { delete rval.groups delete rval.lines delete rval.clip.m_AllPolys diff --git a/src/kiri-mode/fdm/slice.js b/src/kiri-mode/fdm/slice.js index a50b2326..54f1c256 100644 --- a/src/kiri-mode/fdm/slice.js +++ b/src/kiri-mode/fdm/slice.js @@ -349,6 +349,7 @@ FDM.slice = function(settings, widget, onupdate, ondone) { widget.shadow = root.shadow; return; } + console.log({ doShadow: widget, slices }); // create shadow for clipping supports let alltops = widget.group .filter(w => !w.track.synth) // no supports in shadow diff --git a/src/main/kiri.js b/src/main/kiri.js index 91765bc9..5cbce0b9 100644 --- a/src/main/kiri.js +++ b/src/main/kiri.js @@ -15,7 +15,7 @@ gapp.main("main.kiri", [], (root) => { const modfns = root.kirimod = ( root.kirimod || [] ); const kiri = root.kiri = { - beta: 3808, + beta: 3809, driver: {}, // driver modules load(fn) { modfns.push(fn); diff --git a/src/moto/license.js b/src/moto/license.js index a24eb707..a4fc30a6 100644 --- a/src/moto/license.js +++ b/src/moto/license.js @@ -5,7 +5,7 @@ let terms = { COPYRIGHT: "Copyright (C) Stewart Allen - All Rights Reserved", LICENSE: "See the license.md file included with the source distribution", - VERSION: (is_self ? self : this).debug_version || "3.8.D8" + VERSION: (is_self ? self : this).debug_version || "3.8.D9" }; if (typeof(module) === 'object') { From 03bf0eae77a419170128fd9975b171757f345b07 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Thu, 12 Jan 2023 00:28:21 -0500 Subject: [PATCH 2/2] re-enable ref cleaning with changes --- src/geo/slicer.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/geo/slicer.js b/src/geo/slicer.js index ac509546..fa099c2c 100644 --- a/src/geo/slicer.js +++ b/src/geo/slicer.js @@ -405,20 +405,27 @@ async function sliceZ(z, points, options = {}) { } // free objects to be re-claimed and reduce memory pressure - if (false) { + if (true) { delete rval.groups delete rval.lines - delete rval.clip.m_AllPolys + if (rval.tops) for (let top of rval.tops) { - top.poly.freeParentRefs(); - top.simple.freeParentRefs(); - for (let shell of top.shells) shell.freeParentRefs(); - for (let fillo of top.fill_off) fillo.freeParentRefs(); - for (let last of top.last) last.freeParentRefs(); + if (top.poly) { + top.poly.freeParentRefs(); + top.simple.freeParentRefs(); + for (let shell of top.shells) shell.freeParentRefs(); + for (let fillo of top.fill_off) fillo.freeParentRefs(); + for (let last of top.last) last.freeParentRefs(); + } else { + top.freeParentRefs(); + } } - for (let clip of rval.clip) clip.freeParentRefs(); + if (rval.clip) { + for (let clip of rval.clip) clip.freeParentRefs(); + if (rval.clip.m_AllPolys) delete rval.clip.m_AllPolys + } } if (each) each(rval);