From 7450c3ccfdfb906e366ac9727433866e6dd4189d Mon Sep 17 00:00:00 2001 From: Martin Gerhardy Date: Sun, 23 Feb 2025 09:17:44 +0100 Subject: [PATCH] VOXEDIT: optimized region size reduction --- src/tools/voxedit/modules/voxedit-util/SceneManager.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tools/voxedit/modules/voxedit-util/SceneManager.cpp b/src/tools/voxedit/modules/voxedit-util/SceneManager.cpp index 782ff03b4..889e7bb6b 100644 --- a/src/tools/voxedit/modules/voxedit-util/SceneManager.cpp +++ b/src/tools/voxedit/modules/voxedit-util/SceneManager.cpp @@ -669,8 +669,10 @@ void SceneManager::nodeResize(int nodeId, const voxel::Region ®ion) { // we don't have to re-extract a mesh if only new empty voxels were added. modified(nodeId, voxel::Region::InvalidRegion); } else { - // TODO: assemble the 6 surroundings to optimize this for big volumes - modified(nodeId, newVolume->region()); + const core::DynamicArray ®ions = voxel::Region::subtract(oldRegion, region); + for (const voxel::Region &r : regions) { + modified(nodeId, r); + } } if (activeNode() == nodeId) {