From 4ea142fc72649c92fc70362a8793ccea8b243109 Mon Sep 17 00:00:00 2001 From: robtfm <50659922+robtfm@users.noreply.github.com> Date: Sun, 10 Sep 2023 02:06:37 +0100 Subject: [PATCH] fix voxel dim calc --- src/transformation/voxelization/voxelized_volume.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transformation/voxelization/voxelized_volume.rs b/src/transformation/voxelization/voxelized_volume.rs index 5228dd24..d4eee154 100644 --- a/src/transformation/voxelization/voxelized_volume.rs +++ b/src/transformation/voxelization/voxelized_volume.rs @@ -167,12 +167,12 @@ impl VoxelizedVolume { } #[cfg(feature = "dim3")] - if d[0] > d[1] && d[0] > d[2] { + if d[0] >= d[1] && d[0] >= d[2] { r = d[0]; result.resolution[0] = resolution; result.resolution[1] = 2 + (resolution as Real * d[1] / d[0]) as u32; result.resolution[2] = 2 + (resolution as Real * d[2] / d[0]) as u32; - } else if d[1] > d[0] && d[1] > d[2] { + } else if d[1] >= d[0] && d[1] >= d[2] { r = d[1]; result.resolution[1] = resolution; result.resolution[0] = 2 + (resolution as Real * d[0] / d[1]) as u32;