Blender V5.3
bmo_circularize.cc File Reference
#include "BLI_kdopbvh.hh"
#include "BLI_listbase.hh"
#include "BLI_map.hh"
#include "BLI_math_geom_c.hh"
#include "BLI_math_matrix.hh"
#include "BLI_math_matrix_c.hh"
#include "BLI_math_vector.hh"
#include "BLI_span.hh"
#include "BLI_vector.hh"
#include <numbers>
#include <optional>
#include "bmesh.hh"
#include "intern/bmesh_operators_private.hh"

Go to the source code of this file.

Classes

struct  blender::CircleVert
struct  blender::VertChain
struct  blender::NearestTriUserData

Namespaces

namespace  blender
 BMesh Iterators.

Typedefs

using blender::FaceTessellationCache = Map<BMFace *, Array<std::array<BMVert *, 3>>>

Enumerations

enum  blender::FitMethod { blender::FIT_METHOD_LEAST_SQUARE = 0 , blender::FIT_METHOD_CONTRACT = 1 }

Functions

static bool blender::is_valid_boundary_edge (BMEdge *e, const char hflag, const bool check_axis[3], bool extract_wire_edges)
static void blender::bm_vert_chain_extract_from_boundary_edges (BMesh *bm, Vector< VertChain > &r_chains, const char hflag, const bool check_axis[3], bool extract_wire_edges)
static bool blender::bm_vert_chain_orientation_matrix_calc (Span< BMVert * > chain, float3 &r_center, float3x3 &r_mat)
static void blender::project_chain_to_2d (Span< BMVert * > chain, const float3 &center, const float3x3 &mat, Vector< CircleVert > &r_2d_verts)
static void blender::calculate_circle_best_fit (Span< CircleVert > verts, const std::optional< float2 > &fixed_center, float2 &r_center, float *r_radius)
static void blender::calculate_circle_inside_fit (Span< CircleVert > verts, const std::optional< float2 > &fixed_center, float2 &r_center, float *r_radius)
static void blender::calculate_target_locations (MutableSpan< CircleVert > verts, const float2 &center, const float radius, const bool is_regular, const bool is_closed, const float rotation_angle)
static void blender::nearest_tri_cb (void *userdata, int index, const float co[3], BVHTreeNearest *nearest)
static void blender::project_on_mesh (BVHTree *bvh_tree, NearestTriUserData *bvh_data, BMVert *v, const float3 &center_pos, const float3 &normal, float3 &r_pos, FaceTessellationCache &tess_cache)
void blender::bmo_circularize_exec (BMesh *bm, BMOperator *op)

Variables

constexpr int blender::NON_LINEAR_LEAST_SQUARES_MAX_ITERATIONS = 500
constexpr float blender::MIRROR_LIMIT = 0.001f
constexpr float blender::CIRCULARIZE_EPSILON = 1e-6f

Detailed Description

Circularize selected boundary chains.

Definition in file bmo_circularize.cc.