From 1b19ca6a6f8c9e3e47456905dab3de11cd910ea2 Mon Sep 17 00:00:00 2001 From: Derek Benson Date: Thu, 6 Feb 2025 14:18:21 -0500 Subject: [PATCH] Add mutable accessor for a VoxelSet's voxels. This is to allow external code to call into VHACD with a set of voxels that it computes without forcing it to generate a bunch of geometry to then get revoxelized. --- src/transformation/voxelization/voxel_set.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/transformation/voxelization/voxel_set.rs b/src/transformation/voxelization/voxel_set.rs index 5b37ff00..bd1695af 100644 --- a/src/transformation/voxelization/voxel_set.rs +++ b/src/transformation/voxelization/voxel_set.rs @@ -165,6 +165,11 @@ impl VoxelSet { &self.voxels } + /// A mutable reference to the set of voxels. + pub fn voxels_mut(&mut self) -> &mut Vec { + &mut self.voxels + } + /// Update the bounding box of this voxel set. pub fn compute_bb(&mut self) { let num_voxels = self.voxels.len();