Blender V2.61 - r43446
|
#include <math.h>
#include "MEM_guardedalloc.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BKE_bmesh.h"
Go to the source code of this file.
Definition in file BME_tools.c.
BME_TransData* BME_assign_transdata | ( | BME_TransData_Head * | td, |
BME_Mesh * | bm, | ||
BME_Vert * | v, | ||
float * | co, | ||
float * | org, | ||
float * | vec, | ||
float * | loc, | ||
float | factor, | ||
float | weight, | ||
float | maxfactor, | ||
float * | max | ||
) |
Definition at line 71 of file BME_tools.c.
References BLI_ghash_insert(), BLI_ghash_lookup(), BLI_memarena_alloc(), BME_TransData::bm, BME_TransData::co, BME_Vert::co, copy_v3_v3(), BME_TransData::factor, BME_TransData_Head::gh, BME_TransData_Head::len, BME_TransData::loc, BME_TransData_Head::ma, max, BME_TransData::max, BME_TransData::maxfactor, normalize_v3(), NULL, BME_TransData::org, BME_TransData::v, BME_Loop::v, BME_TransData::vec, and BME_TransData::weight.
Referenced by BME_bevel_add_vweight(), BME_bevel_initialize(), and BME_bevel_split_edge().
BME_Mesh* BME_bevel | ( | BME_Mesh * | bm, |
float | value, | ||
int | res, | ||
int | options, | ||
int | defgrp_index, | ||
float | angle, | ||
BME_TransData_Head ** | rtd | ||
) | [read] |
Definition at line 1295 of file BME_tools.c.
References BLI_MEMARENA_STD_BUFSIZE, BME_bevel_initialize(), BME_bevel_mesh(), BME_bevel_reinitialize(), BME_free_transdata(), BME_get_transdata(), BME_init_transdata(), BME_model_begin(), BME_model_end(), BME_tesselate(), BME_Vert::co, simple_enum_gen::d, BME_TransData::factor, ListBase::first, i, madd_v3_v3v3fl(), BME_TransData::max, BME_Vert::next, BME_TransData::org, BME_Vert::tflag1, BME_Loop::v, BME_TransData::vec, and BME_Mesh::verts.
Referenced by applyModifier(), and bevel_menu().
static void BME_bevel_add_vweight | ( | BME_TransData_Head * | td, |
BME_Mesh * | bm, | ||
BME_Vert * | v, | ||
float | weight, | ||
float | factor, | ||
int | options | ||
) | [static] |
Definition at line 849 of file BME_tools.c.
References BME_assign_transdata(), BME_BEVEL_BEVEL, BME_BEVEL_EMAX, BME_BEVEL_EMIN, BME_BEVEL_NONMAN, BME_get_transdata(), BME_Vert::co, BME_TransData::factor, NULL, BME_Vert::tflag1, and BME_TransData::weight.
Referenced by BME_bevel_initialize().
static BME_Loop* BME_bevel_edge | ( | BME_Mesh * | bm, |
BME_Loop * | l, | ||
float | value, | ||
int | UNUSEDoptions, | ||
float * | up_vec, | ||
BME_TransData_Head * | td | ||
) | [static] |
Definition at line 630 of file BME_tools.c.
References BME_BEVEL_BEVEL, BME_BEVEL_NONMAN, BME_BEVEL_ORIG, BME_bevel_split_edge(), BME_collapse_vert(), BME_JFKE(), BME_split_face(), BME_CycleNode::data, BME_Loop::e, credits_svn_gen::e, BME_Loop::f, BME_Loop::next, BME_CycleNode::next, NULL, BME_Loop::prev, BME_Loop::radial, BME_Edge::tflag1, BME_Vert::tflag1, and BME_Loop::v.
Referenced by BME_bevel_poly().
Definition at line 883 of file BME_tools.c.
References BME_Vert::co, cross_v3_v3v3(), BME_CycleNode::data, dot_v3v3(), BME_Edge::loop, BME_Loop::next, BME_CycleNode::next, normalize_v3(), BME_Loop::prev, BME_Loop::radial, BME_Loop::v, and VECSUB.
Referenced by BME_bevel_initialize().
static int BME_bevel_get_vec | ( | float * | vec, |
BME_Vert * | v1, | ||
BME_Vert * | v2, | ||
BME_TransData_Head * | td | ||
) | [static] |
Definition at line 339 of file BME_tools.c.
References BME_get_transdata(), BME_Vert::co, compare_v3v3(), BME_Loop::f, len_v3(), BME_TransData::org, sub_v3_v3v3(), and zero_v3().
Referenced by BME_bevel_poly(), BME_bevel_set_max(), and BME_bevel_split_edge().
static BME_Mesh* BME_bevel_initialize | ( | BME_Mesh * | bm, |
int | options, | ||
int | UNUSEDdefgrp_index, | ||
float | angle, | ||
BME_TransData_Head * | td | ||
) | [static] |
BME_bevel_initialize
Prepare the mesh for beveling:
Sets the tflag1's of the mesh elements based on the options passed.
Returns - A BME_Mesh pointer to the BMesh passed as a parameter.
Definition at line 942 of file BME_tools.c.
References BME_assign_transdata(), BME_bevel_add_vweight(), BME_BEVEL_ANGLE, BME_BEVEL_BEVEL, BME_bevel_get_angle(), BME_BEVEL_NONMAN, BME_BEVEL_ORIG, BME_BEVEL_SELECT, BME_BEVEL_VERT, BME_BEVEL_WEIGHT, BME_cycle_length(), BME_disk_getpointer(), BME_face_sharededges(), BME_is_nonmanifold_vert(), BME_Vert::bweight, BME_Edge::bweight, BME_Vert::co, cos(), BME_CycleNode::data, credits_svn_gen::e, BME_Vert::edge, BME_Mesh::edges, BME_Loop::f, ListBase::first, BME_Vert::flag, BME_Edge::flag, len(), BME_Edge::loop, M_PI, BME_Poly::next, BME_CycleNode::next, BME_Edge::next, BME_Vert::next, NULL, BME_Mesh::polys, BME_Loop::radial, SELECT, BME_Poly::tflag1, BME_Vert::tflag1, BME_Edge::tflag1, BME_Loop::v, BME_Edge::v1, BME_Edge::v2, and BME_Mesh::verts.
Referenced by BME_bevel().
static int BME_bevel_is_split_vert | ( | BME_Loop * | l | ) | [static] |
Definition at line 321 of file BME_tools.c.
References BME_BEVEL_ORIG, BME_Loop::e, BME_Loop::prev, BME_Vert::tflag1, BME_Edge::tflag1, and BME_Loop::v.
Referenced by BME_bevel_split_edge().
static BME_Mesh* BME_bevel_mesh | ( | BME_Mesh * | bm, |
float | value, | ||
int | res, | ||
int | options, | ||
int | UNUSEDdefgrp_index, | ||
BME_TransData_Head * | td | ||
) | [static] |
Definition at line 1187 of file BME_tools.c.
References BME_BEVEL_BEVEL, BME_BEVEL_NONMAN, BME_BEVEL_ORIG, BME_bevel_poly(), BME_bevel_wire(), BME_cycle_length(), BME_disk_getpointer(), BME_disk_next_edgeflag(), BME_disk_nextedge(), BME_JFKE_safe(), BME_split_face(), bmesh_dissolve_disk(), BME_CycleNode::data, BME_Loop::e, credits_svn_gen::e, BME_Vert::edge, BME_Loop::f, ListBase::first, i, len(), BME_Poly::len, BME_Edge::loop, BME_Poly::next, BME_Loop::next, BME_CycleNode::next, BME_Vert::next, BME_Mesh::polys, BME_Loop::prev, BME_Loop::radial, BME_Poly::tflag1, BME_Vert::tflag1, BME_Edge::tflag1, BME_Loop::v, and BME_Mesh::verts.
Referenced by BME_bevel().
static BME_Poly* BME_bevel_poly | ( | BME_Mesh * | bm, |
BME_Poly * | f, | ||
float | value, | ||
int | options, | ||
BME_TransData_Head * | td | ||
) | [static] |
BME_bevel_poly
Polygon inset tool:
Insets a polygon/face based on the tflag1's of its vertices and edges. Used by the bevel tool only, for now. The parameter "value" is the distance to inset (should be negative). The parameter "options" is not currently used.
Returns - A BME_Poly pointer to the resulting inner face.
Definition at line 764 of file BME_tools.c.
References add_v3_v3(), BME_BEVEL_BEVEL, BME_bevel_edge(), BME_bevel_get_vec(), BME_BEVEL_ORIG, BME_bevel_vert(), BME_get_transdata(), copy_v3_v3(), cross_v3_v3v3(), dot_v3v3(), BME_Loop::e, BME_Loop::f, BME_TransData::factor, i, len(), BME_Poly::len, len_v3(), BME_TransData::loc, BME_Poly::loopbase, max, BME_TransData::max, mul_v3_fl(), BME_Loop::next, next, normalize_v3(), NULL, BME_Loop::prev, project_v3_v3v3(), BME_Edge::tflag1, BME_Vert::tflag1, BME_Loop::v, and BME_TransData::vec.
Referenced by BME_bevel_mesh().
static float BME_bevel_project_vec | ( | float * | vec1, |
float * | vec2, | ||
float * | up_vec, | ||
int | is_forward, | ||
BME_TransData_Head * | UNUSEDtd | ||
) | [static] |
Definition at line 378 of file BME_tools.c.
References cross_v3_v3v3(), dot_v3v3(), BME_Loop::f, fabsf, and normalize_v3().
Referenced by BME_bevel_split_edge().
Definition at line 1126 of file BME_tools.c.
References BME_BEVEL_ORIG, credits_svn_gen::e, BME_Mesh::edges, BME_Loop::f, ListBase::first, BME_Poly::next, BME_Edge::next, BME_Vert::next, BME_Mesh::polys, BME_Poly::tflag1, BME_Vert::tflag1, BME_Edge::tflag1, BME_Loop::v, and BME_Mesh::verts.
Referenced by BME_bevel().
static float BME_bevel_set_max | ( | BME_Vert * | v1, |
BME_Vert * | v2, | ||
float | value, | ||
BME_TransData_Head * | td | ||
) | [static] |
Definition at line 551 of file BME_tools.c.
References BME_bevel_get_vec(), BME_get_transdata(), copy_v3_v3(), dot_v3v3(), BME_TransData::factor, len_v3(), BME_TransData::loc, max, BME_TransData::max, mul_v3_fl(), NULL, project_v3_v3v3(), and BME_TransData::vec.
Referenced by BME_bevel_wire().
static BME_Vert* BME_bevel_split_edge | ( | BME_Mesh * | bm, |
BME_Vert * | v, | ||
BME_Vert * | v1, | ||
BME_Loop * | l, | ||
float * | up_vec, | ||
float | value, | ||
BME_TransData_Head * | td | ||
) | [static] |
Definition at line 408 of file BME_tools.c.
References BME_assign_transdata(), BME_BEVEL_BEVEL, BME_bevel_get_vec(), BME_bevel_is_split_vert(), BME_BEVEL_ORIG, BME_bevel_project_vec(), BME_disk_nextedge(), BME_edge_getothervert(), BME_get_transdata(), BME_new_transdata_float(), BME_split_edge(), BME_Vert::co, cross_v3_v3v3(), BME_Loop::e, BME_Vert::edge, BME_TransData::factor, len(), len_v3(), BME_TransData::loc, madd_v3_v3v3fl(), BME_TransData::max, BME_TransData::maxfactor, BME_Loop::next, normalize_v3(), NULL, BME_TransData::org, BME_Loop::prev, sub_v3_v3v3(), BME_Vert::tflag1, BME_Edge::tflag1, BME_Loop::v, and BME_TransData::weight.
Referenced by BME_bevel_edge(), BME_bevel_vert(), and BME_bevel_wire().
static BME_Loop* BME_bevel_vert | ( | BME_Mesh * | bm, |
BME_Loop * | l, | ||
float | value, | ||
int | UNUSEDoptions, | ||
float * | up_vec, | ||
BME_TransData_Head * | td | ||
) | [static] |
Definition at line 731 of file BME_tools.c.
References BME_bevel_split_edge(), BME_split_face(), BME_Loop::e, BME_Loop::f, BME_Loop::next, NULL, BME_Loop::prev, and BME_Loop::v.
Referenced by BME_bevel_poly().
static BME_Vert* BME_bevel_wire | ( | BME_Mesh * | bm, |
BME_Vert * | v, | ||
float | value, | ||
int | res, | ||
int | UNUSEDoptions, | ||
BME_TransData_Head * | td | ||
) | [static] |
Definition at line 605 of file BME_tools.c.
References BME_BEVEL_NONMAN, BME_bevel_set_max(), BME_bevel_split_edge(), BME_disk_nextedge(), BME_edge_getothervert(), BME_JEKV(), BME_Vert::edge, NULL, and BME_Vert::tflag1.
Referenced by BME_bevel_mesh().
Definition at line 293 of file BME_tools.c.
References BME_edge_getothervert(), BME_JEKV(), CustomData_bmesh_interp(), BME_Loop::data, BME_CycleNode::data, BME_Mesh::ldata, BME_Edge::loop, BME_Loop::next, BME_CycleNode::next, NULL, BME_Loop::radial, and BME_Loop::v.
Referenced by BME_bevel_edge(), and bmesh_dissolve_disk().
static void BME_data_facevert_edgesplit | ( | BME_Mesh * | bm, |
BME_Vert * | v1, | ||
BME_Vert * | UNUSEDv2, | ||
BME_Vert * | v, | ||
BME_Edge * | e1, | ||
float | fac | ||
) | [static] |
Definition at line 238 of file BME_tools.c.
References CustomData_bmesh_interp(), BME_Loop::data, BME_CycleNode::data, BME_Mesh::ldata, BME_Edge::loop, BME_Loop::next, BME_CycleNode::next, NULL, BME_Loop::prev, BME_Loop::radial, and BME_Loop::v.
Referenced by BME_split_edge().
Definition at line 920 of file BME_tools.c.
References BME_radial_find_face(), BME_Loop::e, BME_Poly::loopbase, and BME_Loop::next.
Referenced by BME_bevel_initialize().
void BME_free_transdata | ( | BME_TransData_Head * | td | ) |
Definition at line 65 of file BME_tools.c.
References BLI_ghash_free(), BLI_memarena_free(), BME_TransData_Head::gh, BME_TransData_Head::ma, MEM_freeN(), and NULL.
Referenced by bevel_menu(), and BME_bevel().
BME_TransData* BME_get_transdata | ( | BME_TransData_Head * | td, |
BME_Vert * | v | ||
) | [read] |
Definition at line 117 of file BME_tools.c.
References BLI_ghash_lookup(), and BME_TransData_Head::gh.
Referenced by BME_bevel(), BME_bevel_add_vweight(), BME_bevel_get_vec(), BME_bevel_poly(), BME_bevel_set_max(), BME_bevel_split_edge(), and BME_bmesh_to_editmesh().
BME_TransData_Head* BME_init_transdata | ( | int | bufsize | ) |
Definition at line 54 of file BME_tools.c.
References BLI_ghash_new(), BLI_ghashutil_ptrcmp(), BLI_ghashutil_ptrhash(), BLI_memarena_new(), BLI_memarena_use_calloc(), BME_TransData_Head::gh, BME_TransData_Head::ma, and MEM_callocN().
Referenced by BME_bevel().
Definition at line 128 of file BME_tools.c.
References BME_cycle_length(), BME_disk_nextedge(), BME_CycleNode::data, BME_Loop::e, credits_svn_gen::e, BME_Vert::edge, BME_Loop::flag, len(), BME_Edge::loop, BME_Loop::next, BME_CycleNode::next, NULL, BME_Loop::prev, BME_Loop::radial, and BME_Loop::v.
Referenced by BME_bevel_initialize().
static BME_Poly* BME_JFKE_safe | ( | BME_Mesh * | bm, |
BME_Poly * | f1, | ||
BME_Poly * | f2, | ||
BME_Edge * | e | ||
) | [static] |
Definition at line 190 of file BME_tools.c.
References BME_JFKE(), BME_loop_reverse(), BME_CycleNode::data, BME_Edge::loop, BME_CycleNode::next, BME_Loop::radial, and BME_Loop::v.
Referenced by BME_bevel_mesh(), and bmesh_dissolve_disk().
float* BME_new_transdata_float | ( | BME_TransData_Head * | td | ) |
Definition at line 124 of file BME_tools.c.
References BLI_memarena_alloc(), and BME_TransData_Head::ma.
Referenced by BME_bevel_split_edge().
static BME_Vert* BME_split_edge | ( | BME_Mesh * | bm, |
BME_Vert * | v, | ||
BME_Edge * | e, | ||
BME_Edge ** | ne, | ||
float | percent | ||
) | [static] |
Definition at line 270 of file BME_tools.c.
References BME_data_facevert_edgesplit(), BME_edge_getothervert(), BME_SEMV(), BME_Vert::bweight, BME_Edge::bweight, BME_Vert::co, BME_Edge::crease, BME_Vert::flag, BME_Edge::flag, BME_Edge::h, len(), len_v3(), NULL, VECADDFAC, and VECSUB.
Referenced by BME_bevel_split_edge().
static BME_Poly* BME_split_face | ( | BME_Mesh * | bm, |
BME_Poly * | f, | ||
BME_Vert * | v1, | ||
BME_Vert * | v2, | ||
BME_Loop ** | nl, | ||
BME_Edge * | example | ||
) | [static] |
Definition at line 203 of file BME_tools.c.
References BME_SFME(), BME_Edge::bweight, BME_Edge::crease, BME_Edge::flag, BME_Poly::flag, BME_Edge::h, BME_Poly::h, BME_Poly::mat_nr, ME_FACE_SEL, and SELECT.
Referenced by BME_bevel_edge(), BME_bevel_mesh(), BME_bevel_vert(), and BME_tesselate().
Definition at line 1263 of file BME_tools.c.
References BME_split_face(), BME_Loop::e, BME_Loop::f, ListBase::first, BME_Poly::len, BME_Poly::loopbase, BME_Poly::next, BME_Loop::next, NULL, BME_Mesh::polys, and BME_Loop::v.
Referenced by BME_bevel().
BME_bevel_mesh
Mesh beveling tool:
Bevels an entire mesh. It currently uses the tflag1's of its vertices and edges to track topological changes. The parameter "value" is the distance to inset (should be negative). The parameter "options" is not currently used.
Returns - A BME_Mesh pointer to the BMesh passed as a parameter.
Definition at line 1160 of file BME_tools.c.
References BME_collapse_vert(), BME_cycle_length(), BME_disk_nextedge(), BME_JFKE_safe(), BME_CycleNode::data, credits_svn_gen::e, BME_Vert::edge, BME_Loop::f, len(), BME_Edge::loop, BME_CycleNode::next, NULL, and BME_Loop::radial.
Referenced by BME_bevel_mesh().