/** Moves a brush plane along its normal so that the "expanded" plane will touch the centre of the bounds precisely when the original plane would touch the bounds itself. @param brushPlane The original plane @param bounds The bounds @return The expanded plane */ BrushExpander::BrushPlane BrushExpander::expand_brush_plane(const BrushPlane& brushPlane, const Bounds& bounds) { const Vector3d& n = brushPlane.plane.normal(); const double d = brushPlane.plane.distance_value(); double expansionDistance = bounds.brush_expansion_distance(n); return BrushPlane(Plane(n, d+expansionDistance), brushPlane.auxData); }