Blender V5.0
blender::geometry::UVMinimumEnclosingSquareFinder Class Reference

Public Member Functions

 UVMinimumEnclosingSquareFinder (const float scale, const float margin, const UVPackIsland_Params *params)
float update (const double angle)
void update_recursive (const float angle0, const float quad0, const float angle1, const float quad1)

Public Attributes

const float scale_
const float margin_
const UVPackIsland_Paramsparams_
float best_quad
float best_angle
rctf best_bounds
Vector< float2points
Vector< int > indices

Detailed Description

Helper to find the minimum enclosing square.

Definition at line 1422 of file uv_pack.cc.

Constructor & Destructor Documentation

◆ UVMinimumEnclosingSquareFinder()

blender::geometry::UVMinimumEnclosingSquareFinder::UVMinimumEnclosingSquareFinder ( const float scale,
const float margin,
const UVPackIsland_Params * params )
inline

Definition at line 1435 of file uv_pack.cc.

References best_angle, best_quad, margin_, params, params_, and scale_.

Member Function Documentation

◆ update()

float blender::geometry::UVMinimumEnclosingSquareFinder::update ( const double angle)
inline

Calculates the square associated with a rotation of angle.

Returns
Size of square.

Definition at line 1447 of file uv_pack.cc.

References angle(), best_angle, best_bounds, best_quad, BLI_rctf_do_minmax_v(), BLI_rctf_init_minmax(), cos, blender::geometry::get_aspect_scaled_extent(), i, indices, margin_, params_, points, and sin.

Referenced by blender::geometry::rotate_inside_square(), and update_recursive().

◆ update_recursive()

void blender::geometry::UVMinimumEnclosingSquareFinder::update_recursive ( const float angle0,
const float quad0,
const float angle1,
const float quad1 )
inline

Search between angle0 and angle1, looking for the smallest square.

Definition at line 1473 of file uv_pack.cc.

References DEG2RADF, update(), and update_recursive().

Referenced by blender::geometry::rotate_inside_square(), and update_recursive().

Member Data Documentation

◆ best_angle

float blender::geometry::UVMinimumEnclosingSquareFinder::best_angle

◆ best_bounds

rctf blender::geometry::UVMinimumEnclosingSquareFinder::best_bounds

Definition at line 1430 of file uv_pack.cc.

Referenced by blender::geometry::rotate_inside_square(), and update().

◆ best_quad

float blender::geometry::UVMinimumEnclosingSquareFinder::best_quad

◆ indices

Vector<int> blender::geometry::UVMinimumEnclosingSquareFinder::indices

Definition at line 1433 of file uv_pack.cc.

Referenced by blender::geometry::rotate_inside_square(), and update().

◆ margin_

const float blender::geometry::UVMinimumEnclosingSquareFinder::margin_

Definition at line 1425 of file uv_pack.cc.

Referenced by update(), and UVMinimumEnclosingSquareFinder().

◆ params_

const UVPackIsland_Params* blender::geometry::UVMinimumEnclosingSquareFinder::params_

Definition at line 1426 of file uv_pack.cc.

Referenced by update(), and UVMinimumEnclosingSquareFinder().

◆ points

Vector<float2> blender::geometry::UVMinimumEnclosingSquareFinder::points

Definition at line 1432 of file uv_pack.cc.

Referenced by blender::geometry::rotate_inside_square(), and update().

◆ scale_

const float blender::geometry::UVMinimumEnclosingSquareFinder::scale_

Definition at line 1424 of file uv_pack.cc.

Referenced by UVMinimumEnclosingSquareFinder().


The documentation for this class was generated from the following file: