Function centerline::get_transform

source ·
pub fn get_transform<T: GenericVector3 + HasMatrix4>(
    total_aabb: Aabb3<T>,
    desired_voronoi_dimension: T::Scalar
) -> Result<(Plane, T::Matrix4Type, Aabb2<T::Vector2>), CenterlineError>
where T::Scalar: FloatCore,
Expand description

Calculate an affine transform that will center, flip plane to XY, and scale the arbitrary shape so that it will fill the screen. For good measure the scale is then multiplied by 256 so the points makes half decent input data to boost voronoi (integer input only) ‘desired_voronoi_dimension’ is the maximum length of the voronoi input data aabb boost_voronoi uses integers as input so float vertices have to be scaled up substantially to maintain numerical precision