Fix: Points to Volume node crashes with too small radius
OpenVDB likes to crash even in release builds when volumes become too small. To fix this I used the same function that we use in other places already to determine if the resulting volume will be too small.
This commit is contained in:
parent
f06a1368bb
commit
122d6d67e6
|
@ -209,9 +209,14 @@ static void initialize_volume_component_from_points(GeoNodeExecParams ¶ms,
|
|||
}
|
||||
}
|
||||
|
||||
if (positions.is_empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const float max_radius = *std::max_element(radii.begin(), radii.end());
|
||||
const float voxel_size = compute_voxel_size(params, positions, max_radius);
|
||||
if (voxel_size == 0.0f || positions.is_empty()) {
|
||||
const double determinant = std::pow<double>(voxel_size, 3.0);
|
||||
if (!BKE_volume_grid_determinant_valid(determinant)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue