Blender V5.3
curve.cc File Reference
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <optional>
#include "MEM_guardedalloc.h"
#include "BLI_ghash.hh"
#include "BLI_index_range.hh"
#include "BLI_listbase.hh"
#include "BLI_math_base_safe.hh"
#include "BLI_math_geom_c.hh"
#include "BLI_math_matrix_c.hh"
#include "BLI_math_rotation_c.hh"
#include "BLI_math_solvers.hh"
#include "BLI_math_vector_c.hh"
#include "BLI_math_vector_types.hh"
#include "BLI_string.hh"
#include "BLI_string_utf8.hh"
#include "BLI_utildefines.hh"
#include "BLT_translation.hh"
#include "DNA_anim_types.h"
#include "DNA_curve_types.h"
#include "DNA_material_types.h"
#include "DNA_key_types.h"
#include "DNA_object_types.h"
#include "DNA_vfont_types.h"
#include "BKE_curve.hh"
#include "BKE_curveprofile.h"
#include "BKE_idtype.hh"
#include "BKE_key.hh"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.hh"
#include "BKE_object_types.hh"
#include "BKE_vfont.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_query.hh"
#include "BLO_read_write.hh"

Go to the source code of this file.

Classes

struct  blender::BevelSort

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define DNA_DEPRECATED_ALLOW
#define p2_h1   ((p2) - 3)
#define p2_h2   ((p2) + 3)
#define SEL_F1   (1 << 0)
#define SEL_F2   (1 << 1)
#define SEL_F3   (1 << 2)
#define MAT_NR_REMAP(n)

Enumerations

enum class  blender::NURBSValidationStatus {
  blender::Valid , blender::AtLeastTwoPointsRequired , blender::MorePointsThanOrderRequired , blender::MoreRowsForBezierRequired ,
  blender::MorePointsForBezierRequired
}

Functions

static void blender::curve_init_data (ID *id)
static void blender::curve_copy_data (Main *bmain, std::optional< Library * > owner_library, ID *id_dst, const ID *id_src, const int flag)
static void blender::curve_free_data (ID *id)
static void blender::curve_foreach_id (ID *id, LibraryForeachIDData *data)
static void blender::curve_blend_write (BlendWriter *writer, ID *id, const void *id_address)
static void blender::curve_blend_read_data (BlendDataReader *reader, ID *id)
void blender::BKE_curve_editfont_free (Curve *cu)
static void blender::curve_editNurb_keyIndex_cv_free_cb (CVKeyIndex *index)
void blender::BKE_curve_editNurb_keyIndex_delCV (CVKeyIndexMap *keyindex, const void *cv)
void blender::BKE_curve_editNurb_keyIndex_free (CVKeyIndexMap **keyindex)
void blender::BKE_curve_editNurb_free (Curve *cu)
void blender::BKE_curve_init (Curve *cu, ObjectType curve_type)
Curve * blender::BKE_curve_add (Main *bmain, const char *name, ObjectType type)
ListBaseT< Nurb > * blender::BKE_curve_editNurbs_get (Curve *cu)
const ListBaseT< Nurb > * blender::BKE_curve_editNurbs_get_for_read (const Curve *cu)
void blender::BKE_curve_dimension_update (Curve *cu)
void blender::BKE_curve_type_test (Object *ob, bool dimension_update)
void blender::BKE_curve_texspace_calc (Curve *cu)
void blender::BKE_curve_texspace_ensure (Curve *cu)
bool blender::BKE_nurbList_index_get_co (ListBaseT< Nurb > *nurb, int index, float r_co[3])
int blender::BKE_nurbList_verts_count (const ListBaseT< Nurb > *nurb)
int blender::BKE_nurbList_verts_count_without_handles (const ListBaseT< Nurb > *nurb)
void blender::BKE_nurb_free (Nurb *nu)
void blender::BKE_nurbList_free (ListBaseT< Nurb > *lb)
Nurb * blender::BKE_nurb_duplicate (const Nurb *nu)
Nurb * blender::BKE_nurb_copy (Nurb *src, int pntsu, int pntsv)
void blender::BKE_nurbList_duplicate (ListBaseT< Nurb > *lb1, const ListBaseT< Nurb > *lb2)
void blender::BKE_nurb_project_2d (Nurb *nu)
static void blender::calc_nurb_minmax (const Nurb *nu, bool use_radius, float min[3], float max[3])
float blender::BKE_nurb_calc_length (const Nurb *nu, int resolution)
void blender::BKE_nurb_points_add (Nurb *nu, int number)
void blender::BKE_nurb_bezierPoints_add (Nurb *nu, int number)
int blender::BKE_nurb_index_from_uv (Nurb *nu, int u, int v)
void blender::BKE_nurb_index_to_uv (Nurb *nu, int index, int *r_u, int *r_v)
BezTriple * blender::BKE_nurb_bezt_get_next (Nurb *nu, BezTriple *bezt)
BPoint * blender::BKE_nurb_bpoint_get_next (Nurb *nu, BPoint *bp)
BezTriple * blender::BKE_nurb_bezt_get_prev (Nurb *nu, BezTriple *bezt)
BPoint * blender::BKE_nurb_bpoint_get_prev (Nurb *nu, BPoint *bp)
void blender::BKE_nurb_bezt_calc_normal (Nurb *nu, BezTriple *bezt, float r_normal[3])
void blender::BKE_nurb_bezt_calc_plane (Nurb *nu, BezTriple *bezt, float r_plane[3])
void blender::BKE_nurb_bpoint_calc_normal (Nurb *nu, BPoint *bp, float r_normal[3])
void blender::BKE_nurb_bpoint_calc_plane (Nurb *nu, BPoint *bp, float r_plane[3])
static void blender::calcknots (float *knots, const int pnts, const short order, const short flag)
static void blender::makeknots (Nurb *nu, short uv)
void blender::BKE_nurb_knot_alloc_u (Nurb *nu)
void blender::BKE_nurb_knot_calc_u (Nurb *nu)
void blender::BKE_nurb_knot_calc_v (Nurb *nu)
static void blender::basisNurb (float t, short order, int pnts, const float *knots, float *basis, int *start, int *end)
void blender::BKE_nurb_makeFaces (const Nurb *nu, float *coord_array, int rowstride, int resolu, int resolv)
void blender::BKE_nurb_makeCurve (const Nurb *nu, float *coord_array, float *tilt_array, float *radius_array, float *weight_array, int resolu, int stride)
unsigned int blender::BKE_curve_calc_coords_axis_len (unsigned int bezt_array_len, unsigned int resolu, bool is_cyclic, bool use_cyclic_duplicate_endpoint)
void blender::BKE_curve_calc_coords_axis (const BezTriple *bezt_array, unsigned int bezt_array_len, unsigned int resolu, bool is_cyclic, bool use_cyclic_duplicate_endpoint, unsigned int axis, unsigned int stride, float *r_points)
void blender::BKE_curve_forward_diff_bezier (float q0, float q1, float q2, float q3, float *p, int it, int stride)
void blender::BKE_curve_forward_diff_tangent_bezier (float q0, float q1, float q2, float q3, float *p, int it, int stride)
static void blender::forward_diff_bezier_cotangent (const float p0[3], const float p1[3], const float p2[3], const float p3[3], float p[3], int it, int stride)
static int blender::cu_isectLL (const float v1[3], const float v2[3], const float v3[3], const float v4[3], short cox, short coy, float *lambda, float *mu, float vec[3])
static bool blender::bevelinside (const BevList *bl1, const BevList *bl2)
static int blender::vergxcobev (const void *a1, const void *a2)
static void blender::calc_bevel_sin_cos (float x1, float y1, float x2, float y2, float *r_sina, float *r_cosa)
static void blender::tilt_bezpart (const BezTriple *prevbezt, const BezTriple *bezt, const Nurb *nu, float *tilt_array, float *radius_array, float *weight_array, int resolu, int stride)
static void blender::bevel_list_calc_bisect (BevList *bl)
static void blender::bevel_list_flip_tangents (BevList *bl)
static void blender::bevel_list_apply_tilt (BevList *bl)
static void blender::bevel_list_smooth (BevList *bl, int smooth_iter)
static void blender::make_bevel_list_3D_zup (BevList *bl)
static void blender::minimum_twist_between_two_points (BevPoint *bevp_curr, const BevPoint *bevp_prev)
static void blender::make_bevel_list_3D_minimum_twist (BevList *bl)
static void blender::make_bevel_list_3D_tangent (BevList *bl)
static void blender::make_bevel_list_3D (BevList *bl, int smooth_iter, int twist_mode)
static void blender::make_bevel_list_segment_3D (BevList *bl)
static void blender::make_bevel_list_segment_2D (BevList *bl)
static void blender::make_bevel_list_2D (BevList *bl)
static void blender::bevlist_firstlast_direction_calc_from_bpoint (const Nurb *nu, BevList *bl)
void blender::BKE_curve_bevelList_free (ListBaseT< BevList > *bev)
void blender::BKE_curve_bevelList_make (Object *ob, const ListBaseT< Nurb > *nurbs, bool for_render)
static void blender::calchandleNurb_intern (BezTriple *bezt, const BezTriple *prev, const BezTriple *next, eBezTriple_Flag handle_sel_flag, bool is_fcurve, bool skip_align, char fcurve_smoothing)
static void blender::calchandlesNurb_intern (Nurb *nu, eBezTriple_Flag handle_sel_flag, bool skip_align)
static void * blender::allocate_arrays (int count, float ***floats, char ***chars, const char *name)
static void blender::free_arrays (void *buffer)
static float blender::bezier_relax_direction (const float *a, const float *b, const float *c, const float *d, const float *h, int i, int count)
static void blender::bezier_lock_unknown (float *a, float *b, float *c, float *d, int i, float value)
static void blender::bezier_restore_equation (float *a, float *b, float *c, float *d, const float *a0, const float *b0, const float *c0, const float *d0, int i)
static bool blender::tridiagonal_solve_with_limits (float *a, float *b, float *c, float *d, float *h, const float *hmin, const float *hmax, int solve_count)
static void blender::bezier_eq_continuous (float *a, float *b, float *c, float *d, const float *dy, const float *l, int i)
static void blender::bezier_eq_noaccel_right (float *a, float *b, float *c, float *d, const float *dy, const float *l, int i)
static void blender::bezier_eq_noaccel_left (float *a, float *b, float *c, float *d, const float *dy, const float *l, int i)
static void blender::bezier_clamp (float *hmax, float *hmin, int i, float dy, bool no_reverse, bool no_overshoot)
static void blender::bezier_output_handle_inner (BezTriple *bezt, bool right, const float newval[3], bool endpoint)
static void blender::bezier_output_handle (BezTriple *bezt, bool right, float dy, bool endpoint)
static bool blender::bezier_check_solve_end_handle (BezTriple *bezt, char htype, bool end)
static float blender::bezier_calc_handle_adj (float hsize[2], float dx)
static void blender::bezier_handle_calc_smooth_fcurve (BezTriple *bezt, int total, int start, int count, bool cycle)
static bool blender::is_free_auto_point (BezTriple *bezt)
void blender::BKE_nurb_handle_smooth_fcurve (BezTriple *bezt, int total, bool cyclic)
void blender::BKE_nurb_handle_calc (BezTriple *bezt, BezTriple *prev, BezTriple *next, bool is_fcurve, char smoothing)
void blender::BKE_nurb_handle_calc_ex (BezTriple *bezt, BezTriple *prev, BezTriple *next, eBezTriple_Flag__Alias handle_sel_flag, bool is_fcurve, char smoothing)
void blender::BKE_nurb_handles_calc (Nurb *nu)
static void blender::nurbList_handles_swap_select (Nurb *nu)
static void blender::nurb_handles_calc__align_selected (Nurb *nu)
void blender::BKE_nurb_handle_calc_simple (Nurb *nu, BezTriple *bezt)
void blender::BKE_nurb_handle_calc_simple_auto (Nurb *nu, BezTriple *bezt)
short blender::BKE_nurb_bezt_handle_test_calc_flag (const BezTriple *bezt, const eBezTriple_Flag__Alias sel_flag, const eNurbHandleTest_Mode handle_mode)
void blender::BKE_nurb_bezt_handle_test (BezTriple *bezt, eBezTriple_Flag__Alias sel_flag, const eNurbHandleTest_Mode handle_mode, bool use_around_local)
void blender::BKE_nurb_handles_test (Nurb *nu, eNurbHandleTest_Mode handle_mode, bool use_around_local)
void blender::BKE_nurb_handles_autocalc (Nurb *nu, eBezTriple_Flag flag)
void blender::BKE_nurbList_handles_autocalc (ListBaseT< Nurb > *editnurb, eBezTriple_Flag flag)
void blender::BKE_nurbList_handles_set (ListBaseT< Nurb > *editnurb, eNurbHandleTest_Mode handle_mode, eBezTriple_Handle code)
void blender::BKE_nurbList_handles_recalculate (ListBaseT< Nurb > *editnurb, bool calc_length, eBezTriple_Flag flag)
void blender::BKE_nurbList_flag_set (ListBaseT< Nurb > *editnurb, eBezTriple_Flag flag, bool set)
bool blender::BKE_nurbList_flag_set_from_flag (ListBaseT< Nurb > *editnurb, eBezTriple_Flag from_flag, eBezTriple_Flag flag)
void blender::BKE_nurb_direction_switch (Nurb *nu)
void blender::BKE_curve_nurbs_vert_coords_get (const ListBaseT< Nurb > *lb, MutableSpan< float3 > vert_coords)
Array< float3 > blender::BKE_curve_nurbs_vert_coords_alloc (const ListBaseT< Nurb > *lb)
void blender::BKE_curve_nurbs_vert_coords_apply_with_mat4 (ListBaseT< Nurb > *lb, const Span< float3 >, const float4x4 &transform, bool constrain_2d)
void blender::BKE_curve_nurbs_vert_coords_apply (ListBaseT< Nurb > *lb, const Span< float3 > vert_coords, bool constrain_2d)
Array< float3 > blender::BKE_curve_nurbs_key_vert_coords_alloc (const ListBaseT< Nurb > *lb, const float *key)
void blender::BKE_curve_nurbs_key_vert_tilts_apply (ListBaseT< Nurb > *lb, const float *key)
static NURBSValidationStatus blender::nurb_check_valid (const int pnts, const short order, const short flag, const short type, const bool is_surf, int *r_points_needed)
bool blender::BKE_nurb_valid_message (int pnts, short order, short flag, short type, bool is_surf, int dir, char *message_dst, size_t maxncpy)
bool blender::BKE_nurb_check_valid_u (const Nurb *nu)
bool blender::BKE_nurb_check_valid_v (const Nurb *nu)
bool blender::BKE_nurb_check_valid_uv (const Nurb *nu)
bool blender::BKE_nurb_order_clamp_u (Nurb *nu)
bool blender::BKE_nurb_order_clamp_v (Nurb *nu)
bool blender::BKE_nurb_type_convert (Nurb *nu, eNurbType type, bool use_handles, const char **r_err_msg)
ListBaseT< Nurb > * blender::BKE_curve_nurbs_get (Curve *cu)
const ListBaseT< Nurb > * blender::BKE_curve_nurbs_get_for_read (const Curve *cu)
void blender::BKE_curve_nurb_active_set (Curve *cu, const Nurb *nu)
Nurb * blender::BKE_curve_nurb_active_get (Curve *cu)
void * blender::BKE_curve_vert_active_get (Curve *cu)
int blender::BKE_curve_nurb_vert_index_get (const Nurb *nu, const void *vert)
void blender::BKE_curve_nurb_vert_active_set (Curve *cu, const Nurb *nu, const void *vert)
bool blender::BKE_curve_nurb_vert_active_get (Curve *cu, Nurb **r_nu, void **r_vert)
void blender::BKE_curve_nurb_vert_active_validate (Curve *cu)
static std::optional< Bounds< float3 > > blender::calc_nurblist_bounds (const ListBaseT< Nurb > *nurbs, const bool use_radius)
std::optional< Bounds< float3 > > blender::BKE_curve_minmax (const Curve *cu, bool use_radius)
bool blender::BKE_curve_center_median (Curve *cu, float cent[3])
void blender::BKE_curve_transform_ex (Curve *cu, const float mat[4][4], bool do_keys, bool do_props, float unit_scale)
void blender::BKE_curve_transform (Curve *cu, const float mat[4][4], bool do_keys, bool do_props)
void blender::BKE_curve_translate (Curve *cu, const float offset[3], bool do_keys)
void blender::BKE_curve_material_index_remove (Curve *cu, int index)
bool blender::BKE_curve_material_index_used (const Curve *cu, int index)
void blender::BKE_curve_material_index_clear (Curve *cu)
bool blender::BKE_curve_material_index_validate (Curve *cu)
void blender::BKE_curve_material_remap (Curve *cu, const unsigned int *remap, unsigned int remap_len)
void blender::BKE_curve_smooth_flag_set (Curve *cu, bool use_smooth)
void blender::BKE_curve_rect_from_textbox (const Curve *cu, const TextBox *tb, rctf *r_rect)
void blender::BKE_curve_correct_bezpart (const float v1[2], float v2[2], float v3[2], const float v4[2])
void blender::BKE_curve_eval_geometry (Depsgraph *depsgraph, Curve *curve)
void blender::BKE_curve_batch_cache_dirty_tag (Curve *cu, int mode)
void blender::BKE_curve_batch_cache_free (Curve *cu)

Macro Definition Documentation

◆ DNA_DEPRECATED_ALLOW

#define DNA_DEPRECATED_ALLOW

Definition at line 33 of file curve.cc.

◆ MAT_NR_REMAP

#define MAT_NR_REMAP ( n)
Value:
if (n < remap_len_short) { \
BLI_assert(n >= 0 && remap[n] < remap_len_short); \
n = remap[n]; \
} \
((void)0)

Referenced by blender::BKE_curve_material_remap(), and blender::BKE_mesh_material_remap().

◆ p2_h1

#define p2_h1   ((p2) - 3)

◆ p2_h2

#define p2_h2   ((p2) + 3)

◆ SEL_F1

◆ SEL_F2

◆ SEL_F3