Fix #103387: Radius affects curves bounding box #105154

Merged
Hans Goudey merged 1 commits from HooglyBoogly/blender:fix-curves-bounds-radius into blender-v3.5-release 2023-02-27 00:01:13 +01:00
1 changed files with 2 additions and 14 deletions

View File

@ -981,7 +981,6 @@ void CurvesGeometry::tag_normals_changed()
}
void CurvesGeometry::tag_radii_changed()
{
this->runtime->bounds_cache.tag_dirty();
}
static void translate_positions(MutableSpan<float3> positions, const float3 &translation)
@ -1064,19 +1063,8 @@ bool CurvesGeometry::bounds_min_max(float3 &min, float3 &max) const
return false;
}
this->runtime->bounds_cache.ensure([&](Bounds<float3> &r_bounds) {
const Span<float3> positions = this->evaluated_positions();
if (this->attributes().contains("radius")) {
const VArraySpan<float> radii = this->attributes().lookup<float>("radius");
Array<float> evaluated_radii(this->evaluated_points_num());
this->ensure_can_interpolate_to_evaluated();
this->interpolate_to_evaluated(radii, evaluated_radii.as_mutable_span());
r_bounds = *bounds::min_max_with_radii(positions, evaluated_radii.as_span());
}
else {
r_bounds = *bounds::min_max(positions);
}
});
this->runtime->bounds_cache.ensure(
[&](Bounds<float3> &r_bounds) { r_bounds = *bounds::min_max(this->evaluated_positions()); });
const Bounds<float3> &bounds = this->runtime->bounds_cache.data();
min = math::min(bounds.min, min);