|
Blender
V2.93
|
#include "MEM_guardedalloc.h"#include "DNA_curveprofile_types.h"#include "DNA_meshdata_types.h"#include "DNA_modifier_types.h"#include "DNA_scene_types.h"#include "BLI_alloca.h"#include "BLI_array.h"#include "BLI_math.h"#include "BLI_memarena.h"#include "BLI_utildefines.h"#include "BKE_curveprofile.h"#include "BKE_customdata.h"#include "BKE_deform.h"#include "BKE_mesh.h"#include "eigen_capi.h"#include "bmesh.h"#include "bmesh_bevel.h"#include "./intern/bmesh_private.h"Go to the source code of this file.
Classes | |
| struct | NewVert |
| struct | EdgeHalf |
| struct | Profile |
| struct | ProfileSpacing |
| struct | MathLayerInfo |
| struct | BoundVert |
| struct | VMesh |
| struct | BevVert |
| struct | BevelParams |
Typedefs | |
| typedef struct NewVert | NewVert |
| typedef struct EdgeHalf | EdgeHalf |
| typedef struct Profile | Profile |
| typedef struct ProfileSpacing | ProfileSpacing |
| typedef struct MathLayerInfo | MathLayerInfo |
| typedef struct BoundVert | BoundVert |
| typedef struct VMesh | VMesh |
| typedef struct BevVert | BevVert |
| typedef enum AngleKind | AngleKind |
| typedef struct BevelParams | BevelParams |
Enumerations | |
| enum | FKind { F_NONE , F_ORIG , F_VERT , F_EDGE , F_RECON } |
| enum | AngleKind { ANGLE_SMALLER = -1 , ANGLE_STRAIGHT = 0 , ANGLE_LARGER = 1 } |
Functions | |
| static void | flag_out_edge (BMesh *bm, BMEdge *bme) |
| static void | flag_out_vert (BMesh *bm, BMVert *bmv) |
| static void | disable_flag_out_edge (BMesh *bm, BMEdge *bme) |
| static void | record_face_kind (BevelParams *bp, BMFace *f, FKind fkind) |
| static FKind | get_face_kind (BevelParams *bp, BMFace *f) |
| static bool | nearly_parallel (const float d1[3], const float d2[3]) |
| static bool | nearly_parallel_normalized (const float d1[3], const float d2[3]) |
| static BoundVert * | add_new_bound_vert (MemArena *mem_arena, VMesh *vm, const float co[3]) |
| BLI_INLINE void | adjust_bound_vert (BoundVert *bv, const float co[3]) |
| static NewVert * | mesh_vert (VMesh *vm, int i, int j, int k) |
| static void | create_mesh_bmvert (BMesh *bm, VMesh *vm, int i, int j, int k, BMVert *eg) |
| static void | copy_mesh_vert (VMesh *vm, int ito, int jto, int kto, int ifrom, int jfrom, int kfrom) |
| static EdgeHalf * | find_edge_half (BevVert *bv, BMEdge *bme) |
| static BevVert * | find_bevvert (BevelParams *bp, BMVert *bmv) |
| static EdgeHalf * | find_other_end_edge_half (BevelParams *bp, EdgeHalf *e, BevVert **r_bvother) |
| static EdgeHalf * | next_bev (BevVert *bv, EdgeHalf *from_e) |
| static int | count_ccw_edges_between (EdgeHalf *e1, EdgeHalf *e2) |
| static bool | edges_face_connected_at_vert (BMEdge *bme1, BMEdge *bme2) |
| static BMFace * | boundvert_rep_face (BoundVert *v, BMFace **r_fother) |
| static BMFace * | bev_create_ngon (BMesh *bm, BMVert **vert_arr, const int totv, BMFace **face_arr, BMFace *facerep, BMEdge **edge_arr, int mat_nr, bool do_interp) |
| static BMFace * | bev_create_quad (BMesh *bm, BMVert *v1, BMVert *v2, BMVert *v3, BMVert *v4, BMFace *f1, BMFace *f2, BMFace *f3, BMFace *f4, int mat_nr) |
| static BMFace * | bev_create_quad_ex (BMesh *bm, BMVert *v1, BMVert *v2, BMVert *v3, BMVert *v4, BMFace *f1, BMFace *f2, BMFace *f3, BMFace *f4, BMEdge *e1, BMEdge *e2, BMEdge *e3, BMEdge *e4, BMFace *frep, int mat_nr) |
| static bool | contig_ldata_across_loops (BMesh *bm, BMLoop *l1, BMLoop *l2, int layer_index) |
| static bool | contig_ldata_across_edge (BMesh *bm, BMEdge *e, BMFace *f1, BMFace *f2) |
| static void | math_layer_info_init (BevelParams *bp, BMesh *bm) |
| static BMFace * | choose_rep_face (BevelParams *bp, BMFace **face, int nfaces) |
| static void | bev_merge_uvs (BMesh *bm, BMVert *v) |
| static void | bev_merge_edge_uvs (BMesh *bm, BMEdge *bme, BMVert *v) |
| static void | slide_dist (EdgeHalf *e, BMVert *v, float d, float r_slideco[3]) |
| static bool | is_outside_edge (EdgeHalf *e, const float co[3], BMVert **ret_closer_v) |
| static AngleKind | edges_angle_kind (EdgeHalf *e1, EdgeHalf *e2, BMVert *v) |
| static bool | point_between_edges (const float co[3], BMVert *v, BMFace *f, EdgeHalf *e1, EdgeHalf *e2) |
| static bool | edge_edge_angle_less_than_180 (const BMEdge *e1, const BMEdge *e2, const BMFace *f) |
| static void | offset_meet_lines_percent_or_absolute (BevelParams *bp, EdgeHalf *e1, EdgeHalf *e2, BMVert *v, float r_l1a[3], float r_l1b[3], float r_l2a[3], float r_l2b[3]) |
| static void | offset_meet (BevelParams *bp, EdgeHalf *e1, EdgeHalf *e2, BMVert *v, BMFace *f, bool edges_between, float meetco[3], const EdgeHalf *e_in_plane) |
| static bool | offset_meet_edge (EdgeHalf *e1, EdgeHalf *e2, BMVert *v, float meetco[3], float *r_angle) |
| static bool | good_offset_on_edge_between (EdgeHalf *e1, EdgeHalf *e2, EdgeHalf *emid, BMVert *v) |
| static bool | offset_on_edge_between (BevelParams *bp, EdgeHalf *e1, EdgeHalf *e2, EdgeHalf *emid, BMVert *v, float meetco[3], float *r_sinratio) |
| static void | offset_in_plane (EdgeHalf *e, const float plane_no[3], bool left, float r_co[3]) |
| static void | project_to_edge (const BMEdge *e, const float co_a[3], const float co_b[3], float projco[3]) |
| static void | set_profile_params (BevelParams *bp, BevVert *bv, BoundVert *bndv) |
| static void | move_profile_plane (BoundVert *bndv, BMVert *bmvert) |
| static void | move_weld_profile_planes (BevVert *bv, BoundVert *bndv1, BoundVert *bndv2) |
| static int | bev_ccw_test (BMEdge *a, BMEdge *b, BMFace *f) |
| static bool | make_unit_square_map (const float va[3], const float vmid[3], const float vb[3], float r_mat[4][4]) |
| static void | make_unit_cube_map (const float va[3], const float vb[3], const float vc[3], const float vd[3], float r_mat[4][4]) |
| static double | superellipse_co (double x, float r, bool rbig) |
| static void | get_profile_point (BevelParams *bp, const Profile *pro, int i, int nseg, float r_co[3]) |
| static void | calculate_profile_segments (const Profile *profile, const float map[4][4], const bool use_map, const bool reversed, const int ns, const double *xvals, const double *yvals, float *r_prof_co) |
| static void | calculate_profile (BevelParams *bp, BoundVert *bndv, bool reversed, bool miter) |
| static void | snap_to_superellipsoid (float co[3], const float super_r, bool midline) |
| static void | check_edge_data_seam_sharp_edges (BevVert *bv, int flag, bool neg) |
| static void | bevel_extend_edge_data (BevVert *bv) |
| static void | bevel_edges_sharp_boundary (BMesh *bm, BevelParams *bp) |
| static void | bevel_harden_normals (BevelParams *bp, BMesh *bm) |
| Harden normals for bevel. More... | |
| static void | bevel_set_weighted_normal_face_strength (BMesh *bm, BevelParams *bp) |
| static void | set_bound_vert_seams (BevVert *bv, bool mark_seam, bool mark_sharp) |
| static int | count_bound_vert_seams (BevVert *bv) |
| static bool | eh_on_plane (EdgeHalf *e) |
| static void | calculate_vm_profiles (BevelParams *bp, BevVert *bv, VMesh *vm) |
| static void | build_boundary_vertex_only (BevelParams *bp, BevVert *bv, bool construct) |
| static void | build_boundary_terminal_edge (BevelParams *bp, BevVert *bv, EdgeHalf *efirst, const bool construct) |
| static void | adjust_miter_coords (BevelParams *bp, BevVert *bv, EdgeHalf *emiter) |
| static void | adjust_miter_inner_coords (BevelParams *bp, BevVert *bv, EdgeHalf *emiter) |
| static void | build_boundary (BevelParams *bp, BevVert *bv, bool construct) |
| static EdgeHalf * | next_edgehalf_bev (BevelParams *bp, EdgeHalf *start_edge, bool toward_bv, BevVert **r_bv) |
| static void | regularize_profile_orientation (BevelParams *bp, BMEdge *bme) |
| static void | adjust_the_cycle_or_chain (BoundVert *vstart, bool iscycle) |
| static void | adjust_offsets (BevelParams *bp, BMesh *bm) |
| static BoundVert * | pipe_test (BevVert *bv) |
| static VMesh * | new_adj_vmesh (MemArena *mem_arena, int count, int seg, BoundVert *bounds) |
| static NewVert * | mesh_vert_canon (VMesh *vm, int i, int j, int k) |
| static bool | is_canon (VMesh *vm, int i, int j, int k) |
| static void | vmesh_copy_equiv_verts (VMesh *vm) |
| static void | vmesh_center (VMesh *vm, float r_cent[3]) |
| static void | avg4 (float co[3], const NewVert *v0, const NewVert *v1, const NewVert *v2, const NewVert *v3) |
| static float | sabin_gamma (int n) |
| static void | fill_vmesh_fracs (VMesh *vm, float *frac, int i) |
| static void | fill_profile_fracs (BevelParams *bp, BoundVert *bndv, float *frac, int ns) |
| static int | interp_range (const float *frac, int n, const float f, float *r_rest) |
| static VMesh * | interp_vmesh (BevelParams *bp, VMesh *vm_in, int nseg) |
| static VMesh * | cubic_subdiv (BevelParams *bp, VMesh *vm_in) |
| static VMesh * | make_cube_corner_square (MemArena *mem_arena, int nseg) |
| static VMesh * | make_cube_corner_square_in (MemArena *mem_arena, int nseg) |
| static VMesh * | make_cube_corner_adj_vmesh (BevelParams *bp) |
| static int | tri_corner_test (BevelParams *bp, BevVert *bv) |
| static VMesh * | tri_corner_adj_vmesh (BevelParams *bp, BevVert *bv) |
| static VMesh * | adj_vmesh (BevelParams *bp, BevVert *bv) |
| static void | snap_to_pipe_profile (BoundVert *vpipe, bool midline, float co[3]) |
| static VMesh * | pipe_adj_vmesh (BevelParams *bp, BevVert *bv, BoundVert *vpipe) |
| static void | get_incident_edges (BMFace *f, BMVert *v, BMEdge **r_e1, BMEdge **r_e2) |
| static BMEdge * | find_closer_edge (float *co, BMEdge *e1, BMEdge *e2) |
| static float | snap_face_dist_squared (float *co, BMFace *f, BMEdge **r_snap_e, float *r_snap_co) |
| static float | interp_poly_area (BevVert *bv, BMFace *frep) |
| static bool | is_bad_uv_poly (BevVert *bv, BMFace *frep) |
| static BMFace * | frep_for_center_poly (BevelParams *bp, BevVert *bv) |
| static void | build_center_ngon (BevelParams *bp, BMesh *bm, BevVert *bv, int mat_nr) |
| static void | build_square_in_vmesh (BevelParams *bp, BMesh *bm, BevVert *bv, VMesh *vm1) |
| static void | closer_v3_v3v3v3 (float r[3], const float a[3], const float b[3], const float v[3]) |
| static VMesh * | square_out_adj_vmesh (BevelParams *bp, BevVert *bv) |
| static void | bevel_build_rings (BevelParams *bp, BMesh *bm, BevVert *bv, BoundVert *vpipe) |
| static void | bevel_build_cutoff (BevelParams *bp, BMesh *bm, BevVert *bv) |
| static BMFace * | bevel_build_poly (BevelParams *bp, BMesh *bm, BevVert *bv) |
| static void | bevel_build_trifan (BevelParams *bp, BMesh *bm, BevVert *bv) |
| static void | bevel_vert_two_edges (BevelParams *bp, BMesh *bm, BevVert *bv) |
| static void | build_vmesh (BevelParams *bp, BMesh *bm, BevVert *bv) |
| static float | edge_face_angle (EdgeHalf *e) |
| static int | bevel_edge_order_extend (BMesh *bm, BevVert *bv, int i) |
| static bool | fast_bevel_edge_order (BevVert *bv) |
| static void | find_bevel_edge_order (BMesh *bm, BevVert *bv, BMEdge *first_bme) |
| static BevVert * | bevel_vert_construct (BMesh *bm, BevelParams *bp, BMVert *v) |
| static bool | bev_rebuild_polygon (BMesh *bm, BevelParams *bp, BMFace *f) |
| static void | bevel_rebuild_existing_polygons (BMesh *bm, BevelParams *bp, BMVert *v) |
| static void | bevel_reattach_wires (BMesh *bm, BevelParams *bp, BMVert *v) |
| static void | bev_merge_end_uvs (BMesh *bm, BevVert *bv, EdgeHalf *e) |
| static bool | bevvert_is_weld_cross (BevVert *bv) |
| static void | weld_cross_attrs_copy (BMesh *bm, BevVert *bv, VMesh *vm, int vmindex, EdgeHalf *e) |
| static void | bevel_build_edge_polygons (BMesh *bm, BevelParams *bp, BMEdge *bme) |
| static double | find_superellipse_chord_endpoint (double x0, double dtarget, float r, bool rbig) |
| static void | find_even_superellipse_chords_general (int seg, float r, double *xvals, double *yvals) |
| static void | find_even_superellipse_chords (int n, float r, double *xvals, double *yvals) |
| static float | find_profile_fullness (BevelParams *bp) |
| static void | set_profile_spacing (BevelParams *bp, ProfileSpacing *pro_spacing, bool custom) |
| static float | geometry_collide_offset (BevelParams *bp, EdgeHalf *eb) |
| static float | vertex_collide_offset (BevelParams *bp, EdgeHalf *ea) |
| static void | bevel_limit_offset (BevelParams *bp, BMesh *bm) |
| void | BM_mesh_bevel (BMesh *bm, const float offset, const int offset_type, const int profile_type, const int segments, const float profile, const bool affect_type, const bool use_weights, const bool limit_offset, const struct MDeformVert *dvert, const int vertex_group, const int mat, const bool loop_slide, const bool mark_seam, const bool mark_sharp, const bool harden_normals, const int face_strength_mode, const int miter_outer, const int miter_inner, const float spread, const float smoothresh, const struct CurveProfile *custom_profile, const int vmesh_method) |
Main functions for beveling a BMesh (used by the tool and modifier)
Definition in file bmesh_bevel.c.
| #define BEV_EXTEND_EDGE_DATA_CHECK | ( | eh, | |
| flag | |||
| ) | (BM_elem_flag_test(eh->e, flag)) |
Definition at line 2252 of file bmesh_bevel.c.
| #define BEVEL_EPSILON 1e-6f |
Definition at line 54 of file bmesh_bevel.c.
| #define BEVEL_EPSILON_ANG DEG2RADF(2.0f) |
Definition at line 58 of file bmesh_bevel.c.
| #define BEVEL_EPSILON_ANG_DOT (1.0f - cosf(BEVEL_EPSILON_ANG)) |
Difference in dot products that corresponds to 2.0 degree difference between vectors.
Definition at line 63 of file bmesh_bevel.c.
| #define BEVEL_EPSILON_BIG 1e-4f |
Definition at line 56 of file bmesh_bevel.c.
| #define BEVEL_EPSILON_BIG_SQ 1e-8f |
Definition at line 57 of file bmesh_bevel.c.
| #define BEVEL_EPSILON_D 1e-6 |
Definition at line 53 of file bmesh_bevel.c.
| #define BEVEL_EPSILON_SQ 1e-12f |
Definition at line 55 of file bmesh_bevel.c.
| #define BEVEL_GOOD_ANGLE 0.25f |
Definition at line 1496 of file bmesh_bevel.c.
| #define BEVEL_MATCH_SPEC_WEIGHT 0.2 |
Definition at line 66 of file bmesh_bevel.c.
| #define BEVEL_MAX_ADJUST_PCT 10.0f |
Definition at line 64 of file bmesh_bevel.c.
| #define BEVEL_MAX_AUTO_ADJUST_PCT 300.0f |
Definition at line 65 of file bmesh_bevel.c.
| #define BEVEL_SMALL_ANG DEG2RADF(10.0f) |
Definition at line 59 of file bmesh_bevel.c.
| #define BEVEL_SMALL_ANG_DOT (1.0f - cosf(BEVEL_SMALL_ANG)) |
Difference in dot products that corresponds to 10 degree difference between vectors.
Definition at line 61 of file bmesh_bevel.c.
| #define BM_BEVEL_EDGE_TAG_DISABLE | ( | bme | ) | BM_ELEM_API_FLAG_DISABLE((bme), _FLAG_OVERLAP) |
Definition at line 5832 of file bmesh_bevel.c.
| #define BM_BEVEL_EDGE_TAG_ENABLE | ( | bme | ) | BM_ELEM_API_FLAG_ENABLE((bme), _FLAG_OVERLAP) |
Definition at line 5831 of file bmesh_bevel.c.
| #define BM_BEVEL_EDGE_TAG_TEST | ( | bme | ) | BM_ELEM_API_FLAG_TEST((bme), _FLAG_OVERLAP) |
Definition at line 5833 of file bmesh_bevel.c.
| #define BM_ELEM_LONG_TAG (1 << 6) |
Definition at line 389 of file bmesh_bevel.c.
| #define CIRCLE_FULLNESS_SEGS 11 |
| #define EDGE_OUT 4 |
Definition at line 392 of file bmesh_bevel.c.
| #define PRO_CIRCLE_R 2.0f |
Definition at line 160 of file bmesh_bevel.c.
| #define PRO_LINE_R 1.0f |
Definition at line 161 of file bmesh_bevel.c.
| #define PRO_SQUARE_IN_R 0.0f |
Definition at line 162 of file bmesh_bevel.c.
| #define PRO_SQUARE_R 1e4f |
Definition at line 159 of file bmesh_bevel.c.
| #define VEC_VALUE_LEN 6 |
| #define VERT_OUT 8 |
Definition at line 393 of file bmesh_bevel.c.
| typedef struct BevelParams BevelParams |
Bevel parameters and state.
| typedef struct MathLayerInfo MathLayerInfo |
If the mesh has custom data Loop layers that 'have math' we use this data to help decide which face to use as representative when there is an ambiguous choice as to which face to use, which happens when there is an odd number of segments.
The face_compent field of the following will only be set if there are an odd number of segments. The it uses BMFace indices to index into it, so will only be valid as long BMFaces are not added or deleted in the BMesh. "Connected Component" here means connected in UV space: i.e., one face is directly connected to another if they share an edge and all of Loop UV custom layers are contiguous across that edge.
Profile specification: The profile is a path defined with start, middle, and end control points projected onto a plane (plane_no is normal, plane_co is a point on it) via lines in a given direction (proj_dir).
Many interesting profiles are in family of superellipses: (abs(x/a))^r + abs(y/b))^r = 1 r==2 => ellipse; r==1 => line; r < 1 => concave; r > 1 => bulging out. Special cases: let r==0 mean straight-inward, and r==4 mean straight outward.
After the parameters are all set, the actual profile points are calculated and pointed to by prof_co. We also may need profile points for a higher resolution number of segments for the subdivision while making the ADJ vertex mesh pattern, and that goes in prof_co_2.
| typedef struct ProfileSpacing ProfileSpacing |
The un-transformed 2D storage of profile vertex locations. Also, for non-custom profiles this serves as a cache for the results of the expensive calculation of u parameter values to get even spacing on superellipse for current BevelParams seg and pro_super_r.
| enum AngleKind |
Helper for keeping track of angle kind.
| Enumerator | |
|---|---|
| ANGLE_SMALLER | Angle less than 180 degrees. |
| ANGLE_STRAIGHT | 180 degree angle. |
| ANGLE_LARGER | Angle greater than 180 degrees. |
Definition at line 306 of file bmesh_bevel.c.
| enum FKind |
| Enumerator | |
|---|---|
| F_NONE | Used when there is no face at all. |
| F_ORIG | Original face, not touched. |
| F_VERT | Face for construction around a vert. |
| F_EDGE | Face for a beveled edge. |
| F_RECON | Reconstructed original face with some new verts. |
Definition at line 292 of file bmesh_bevel.c.
Definition at line 453 of file bmesh_bevel.c.
References BoundVert::adjchain, BoundVert::any_seam, BLI_memarena_alloc(), VMesh::boundstart, NewVert::co, copy_v3_v3(), VMesh::count, BoundVert::index, BoundVert::is_arc_start, BoundVert::is_patch_start, BoundVert::is_profile_start, mem_arena, BoundVert::next, NULL, BoundVert::nv, BoundVert::prev, PRO_LINE_R, BoundVert::profile, BoundVert::sinratio, Profile::super_r, and BoundVert::visited.
Referenced by build_boundary(), build_boundary_terminal_edge(), build_boundary_vertex_only(), make_cube_corner_adj_vmesh(), make_cube_corner_square(), and make_cube_corner_square_in().
|
static |
Definition at line 4520 of file bmesh_bevel.c.
References add_v3_v3(), BEVEL_EPSILON_SQ, BEVEL_PROFILE_CUSTOM, VMesh::boundstart, BMVert::co, NewVert::co, copy_v3_v3(), VMesh::count, cubic_subdiv(), ProfileSpacing::fullness, get_profile_point(), interp_vmesh(), len_squared_v3(), madd_v3_v3v3fl(), BevelParams::mem_arena, mem_arena, mesh_vert(), mul_v3_fl(), new_adj_vmesh(), BoundVert::next, BoundVert::nv, BevelParams::pro_spacing, PRO_SQUARE_IN_R, BevelParams::pro_super_r, BoundVert::profile, BevelParams::profile_type, VMesh::seg, sub_v3_v3v3(), tri_corner_adj_vmesh(), tri_corner_test(), BevVert::v, BevVert::vmesh, and vmesh_copy_equiv_verts().
Referenced by bevel_build_rings(), and pipe_adj_vmesh().
| BLI_INLINE void adjust_bound_vert | ( | BoundVert * | bv, |
| const float | co[3] | ||
| ) |
Definition at line 483 of file bmesh_bevel.c.
References NewVert::co, copy_v3_v3(), and BoundVert::nv.
Referenced by adjust_miter_coords(), build_boundary(), build_boundary_terminal_edge(), and build_boundary_vertex_only().
|
static |
Definition at line 2872 of file bmesh_bevel.c.
References adjust_bound_vert(), BEVEL_MITER_ARC, BEVEL_MITER_PATCH, BLI_assert, BM_edge_other_vert(), BMVert::co, NewVert::co, copy_v3_v3(), EdgeHalf::e, BoundVert::elast, isect_line_plane_v3(), madd_v3_v3v3fl(), BevelParams::miter_outer, BoundVert::next, normalize_v3(), NULL, BoundVert::nv, BevelParams::offset, EdgeHalf::rightv, BevelParams::seg, sub_v3_v3v3(), BevVert::v, v1, and v2.
|
static |
Definition at line 2921 of file bmesh_bevel.c.
References BM_edge_other_vert(), VMesh::boundstart, BMVert::co, NewVert::co, copy_v3_v3(), BMVert::e, e, BoundVert::elast, madd_v3_v3v3fl(), BoundVert::next, normalize_v3(), BoundVert::nv, BevelParams::spread, sub_v3_v3v3(), v, BevVert::v, and BevVert::vmesh.
|
static |
Adjust the offsets to try to make them, as much as possible, have even-width bevels with offsets that match their specs. The problem that we can try to ameliorate is that when loop slide is active, the meet point will probably not be the one that makes both sides have their specified width. And because both ends may be on loop slide edges, the widths at each end could be different.
It turns out that the dependent offsets either form chains or cycles, and we can process each of those separately.
Definition at line 3679 of file bmesh_bevel.c.
References BoundVert::adjchain, adjust_the_cycle_or_chain(), BLI_assert, bm, BM_elem_flag_test, BM_ELEM_TAG, BM_ITER_MESH, BM_VERTS_OF_MESH, VMesh::boundstart, build_boundary(), BoundVert::eon, find_bevvert(), find_other_end_edge_half(), EdgeHalf::leftv, BoundVert::next, NULL, EdgeHalf::rightv, v, BoundVert::visited, and BevVert::vmesh.
Referenced by BM_mesh_bevel().
|
static |
Adjust the offsets for a single cycle or chain. For chains and some cycles, a fast solution exists. Otherwise, we set up and solve a linear least squares problem that tries to minimize the squared differences of lengths at each end of an edge, and (with smaller weight) the squared differences of the offsets from their specs.
Definition at line 3517 of file bmesh_bevel.c.
References BEVEL_MATCH_SPEC_WEIGHT, BM_elem_index_get, EdgeHalf::e, EIG_linear_least_squares_solver_new(), EIG_linear_solver_delete(), EIG_linear_solver_matrix_add(), EIG_linear_solver_print_matrix(), EIG_linear_solver_right_hand_side_add(), EIG_linear_solver_solve(), EIG_linear_solver_variable_get(), float(), EdgeHalf::offset_l, EdgeHalf::offset_r, and v.
Referenced by adjust_offsets().
|
static |
Definition at line 3917 of file bmesh_bevel.c.
References add_v3_v3(), add_v3_v3v3(), BMVert::co, NewVert::co, mul_v3_fl(), v1, and v2.
Referenced by cubic_subdiv().
Definition at line 1886 of file bmesh_bevel.c.
References Freestyle::a, BM_face_edge_share_loop(), and BMLoop::next.
Referenced by bevel_vert_construct().
|
static |
Make ngon from verts alone. Make sure to properly copy face attributes and do custom data interpolation from corresponding elements of face_arr, if that is non-NULL, else from facerep. If edge_arr is non-NULL, then for interpolation purposes only, the corresponding elements of vert_arr are snapped to any non-NULL edges in that array. If mat_nr >= 0 then the material of the face is set to that.
Definition at line 674 of file bmesh_bevel.c.
References BLI_assert, bm, BM_CREATE_NOP, BM_EDGES_OF_FACE, BM_elem_attrs_copy(), BM_elem_flag_enable, BM_ELEM_TAG, BM_face_create_verts(), BM_ITER_ELEM, BM_loop_interp_from_face(), BM_LOOPS_OF_FACE, closest_to_line_segment_v3(), BMVert::co, copy_v3_v3(), flag_out_edge(), l, BMFace::mat_nr, NULL, BMLoop::v, BMEdge::v1, and BMEdge::v2.
Referenced by bev_create_quad(), bev_create_quad_ex(), bev_rebuild_polygon(), bevel_build_cutoff(), bevel_build_edge_polygons(), bevel_build_poly(), and build_center_ngon().
|
static |
Definition at line 738 of file bmesh_bevel.c.
References bev_create_ngon(), bm, NULL, v1, and v2.
Referenced by bevel_build_rings().
|
static |
Definition at line 754 of file bmesh_bevel.c.
References bev_create_ngon(), bm, v1, and v2.
Referenced by bevel_build_rings().
Definition at line 1033 of file bmesh_bevel.c.
References add_v2_v2(), bm, BM_ELEM_CD_GET_VOID_P, BM_ITER_ELEM, BM_LOOPS_OF_VERT, CD_MLOOPUV, copy_v2_v2(), CustomData_get_n_offset(), CustomData_number_of_layers(), BMLoop::e, l, BMesh::ldata, mul_v2_fl(), NULL, BMLoop::prev, MLoopUV::uv, and v.
Referenced by bevel_build_edge_polygons().
Definition at line 6629 of file bmesh_bevel.c.
References bev_merge_uvs(), bm, e, mesh_vert(), v, and BevVert::vmesh.
Referenced by bevel_build_edge_polygons().
Definition at line 1001 of file bmesh_bevel.c.
References add_v2_v2(), bm, BM_ELEM_CD_GET_VOID_P, BM_ITER_ELEM, BM_LOOPS_OF_VERT, CD_MLOOPUV, copy_v2_v2(), CustomData_get_n_offset(), CustomData_number_of_layers(), l, BMesh::ldata, mul_v2_fl(), MLoopUV::uv, and v.
Referenced by bev_merge_end_uvs(), bev_rebuild_polygon(), and bevel_build_rings().
|
static |
Definition at line 6350 of file bmesh_bevel.c.
References BevVert::any_seam, bev_create_ngon(), bev_merge_uvs(), BLI_array_append, BLI_array_free, BLI_array_len, BLI_array_staticdeclare, BLI_assert, bm, BM_DEFAULT_NGON_STACK_SIZE, BM_edge_exists(), BM_EDGES_OF_FACE, BM_elem_attrs_copy(), BM_elem_flag_disable, BM_elem_flag_enable, BM_elem_flag_test, BM_ELEM_SEAM, BM_ELEM_SMOOTH, BM_ELEM_TAG, BM_FACES_OF_EDGE, BM_ITER_ELEM, BM_LOOPS_OF_FACE, count_ccw_edges_between(), disable_flag_out_edge(), BMVert::e, BMLoop::e, e, F_RECON, find_bevvert(), find_edge_half(), l, EdgeHalf::leftv, VMesh::mesh_kind, mesh_vert(), BoundVert::next, NULL, BMLoop::prev, EdgeHalf::prev, BoundVert::prev, EdgeHalf::profile_index, record_face_kind(), EdgeHalf::rightv, VMesh::seg, BMLoop::v, v, NewVert::v, and BevVert::vmesh.
Referenced by bevel_rebuild_existing_polygons().
|
static |
Builds the vertex mesh when the vertex mesh type is set to "cut off" with a face closing off each incoming edge's profile.
TODO(Hans): Make cutoff VMesh work with outer miter != sharp. This should be possible but there are two problems currently:
Definition at line 5359 of file bmesh_bevel.c.
References bev_create_ngon(), BEVEL_EPSILON, BLI_array_free, BLI_array_staticdeclare, BLI_memarena_alloc(), bm, BM_DEFAULT_NGON_STACK_SIZE, VMesh::boundstart, NewVert::co, copy_v3_v3(), VMesh::count, create_mesh_bmvert(), cross_v3_v3v3(), dot_v3v3(), Profile::height, BoundVert::index, BoundVert::is_arc_start, BoundVert::is_patch_start, len_squared_v3v3(), length(), madd_v3_v3v3fl(), BevelParams::mat_nr, max_ii(), BevelParams::mem_arena, mesh_vert(), negate_v3(), BoundVert::next, BMVert::no, NULL, BoundVert::nv, Profile::plane_no, BoundVert::prev, BoundVert::profile, BevelParams::seg, sqrtf, NewVert::v, BevVert::v, and BevVert::vmesh.
Referenced by build_vmesh().
|
static |
Build the bevel polygons along the selected Edge.
Definition at line 6707 of file bmesh_bevel.c.
References BevVert::any_seam, bev_create_ngon(), bev_merge_edge_uvs(), bev_merge_end_uvs(), bevvert_is_weld_cross(), BLI_assert, bm, BM_edge_exists(), BM_edge_is_manifold(), BM_elem_attrs_copy(), BM_elem_flag_enable, BM_ELEM_LONG_TAG, BM_ITER_ELEM, BM_LOOPS_OF_FACE, choose_rep_face(), ELEM, F_EDGE, faces, find_bevvert(), find_edge_half(), EdgeHalf::fnext, EdgeHalf::fprev, i1, BoundVert::index, EdgeHalf::is_seam, l, EdgeHalf::leftv, BevelParams::mat_nr, VMesh::mesh_kind, mesh_vert(), NULL, BoundVert::nv, record_face_kind(), EdgeHalf::rightv, EdgeHalf::seg, BMLoop::v, v, NewVert::v, BMEdge::v1, BMEdge::v2, verts, BevVert::vmesh, and weld_cross_attrs_copy().
Referenced by BM_mesh_bevel().
|
static |
Definition at line 5510 of file bmesh_bevel.c.
References BevVert::any_seam, bev_create_ngon(), BLI_array_append, BLI_array_free, BLI_array_staticdeclare, bm, BM_DEFAULT_NGON_STACK_SIZE, VMesh::boundstart, boundvert_rep_face(), BMVert::co, BoundVert::ebev, F_VERT, find_closer_edge(), frep_for_center_poly(), get_incident_edges(), BoundVert::index, BevelParams::mat_nr, mesh_vert(), BoundVert::next, NULL, BoundVert::nv, record_face_kind(), EdgeHalf::seg, NewVert::v, BevVert::v, and BevVert::vmesh.
Referenced by bevel_build_trifan(), and build_vmesh().
|
static |
Given that the boundary is built and the boundary BMVert's have been made, calculate the positions of the interior mesh points for the M_ADJ pattern, using cubic subdivision, then make the BMVert's and the new faces.
Definition at line 5178 of file bmesh_bevel.c.
References adj_vmesh(), BevelParams::affect_type, BoundVert::any_seam, bev_create_quad(), bev_create_quad_ex(), bev_merge_uvs(), BEVEL_AFFECT_VERTICES, BEVEL_PROFILE_CUSTOM, BLI_assert, bm, VMesh::boundstart, boundvert_rep_face(), build_center_ngon(), build_square_in_vmesh(), choose_rep_face(), copy_v3_v3(), VMesh::count, count_bound_vert_seams(), create_mesh_bmvert(), BMVert::e, e, EdgeHalf::e, BoundVert::ebev, BoundVert::efirst, F_VERT, BoundVert::index, is_canon(), BevelParams::mat_nr, mesh_vert(), BoundVert::next, NULL, pipe_adj_vmesh(), BoundVert::prev, PRO_SQUARE_IN_R, PRO_SQUARE_R, BevelParams::pro_super_r, BevelParams::profile_type, record_face_kind(), VMesh::seg, BevVert::selcount, square_out_adj_vmesh(), tri_corner_adj_vmesh(), tri_corner_test(), NewVert::v, BevVert::v, BevVert::vmesh, and vmesh_copy_equiv_verts().
Referenced by build_vmesh().
|
static |
Definition at line 5578 of file bmesh_bevel.c.
References bevel_build_poly(), BLI_assert, bm, BM_FACE_FIRST_LOOP, BM_face_split(), BMLoop::e, F_VERT, flag_out_edge(), BMFace::len, BMLoop::next, next_bev(), NULL, BMLoop::prev, record_face_kind(), BevVert::selcount, and BMLoop::v.
Referenced by build_vmesh().
Try to extend the bv->edges[] array beyond i by finding more successor edges. This is a possibly exponential-time search, but it is only exponential in the number of "internal faces" at a vertex – i.e., faces that bridge between the edges that naturally form a manifold cap around bv. It is rare to have more than one of these, so unlikely that the exponential time case will be hit in practice. Returns the new index i' where bv->edges[i'] ends the best path found. The path will have the tags of all of its edges set.
Definition at line 5844 of file bmesh_bevel.c.
References BLI_array_append, BLI_array_clear, BLI_array_free, BLI_array_len, BLI_array_staticdeclare, BLI_assert, bm, BM_BEVEL_EDGE_TAG_DISABLE, BM_BEVEL_EDGE_TAG_ENABLE, BM_BEVEL_EDGE_TAG_TEST, BM_DEFAULT_NGON_STACK_SIZE, BM_ITER_ELEM, BM_LOOPS_OF_EDGE, BMLoop::e, EdgeHalf::e, BevVert::edgecount, BevVert::edges, edges_face_connected_at_vert(), if(), l, BMLoop::next, NULL, BMLoop::prev, BMLoop::v, and BevVert::v.
Referenced by find_bevel_edge_order().
|
static |
Definition at line 2411 of file bmesh_bevel.c.
References bm, BM_elem_flag_disable, BM_elem_flag_test, BM_ELEM_SMOOTH, BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_LOOPS_OF_FACE, BMLoop::e, ELEM, BMLoop::f, F_EDGE, F_RECON, F_VERT, get_face_kind(), l, and BMLoop::radial_next.
Referenced by bevel_harden_normals().
|
static |
Definition at line 2303 of file bmesh_bevel.c.
References BM_elem_flag_set, BM_ELEM_SEAM, BM_ELEM_SMOOTH, VMesh::boundstart, VMesh::count, e, BoundVert::index, VMesh::mesh_kind, mesh_vert(), BoundVert::next, BoundVert::seam_len, VMesh::seg, BoundVert::sharp_len, NewVert::v, v1, v2, and BevVert::vmesh.
Referenced by BM_mesh_bevel().
|
static |
Harden normals for bevel.
The desired effect is that the newly created F_EDGE and F_VERT faces appear smoothly shaded with the normals at the boundaries with F_RECON faces matching those recon faces. And at boundaries between F_EDGE and F_VERT faces, the normals should match the F_EDGE ones. Assumes custom loop normals are in use.
Definition at line 2446 of file bmesh_bevel.c.
References add_v3_v3v3(), bevel_edges_sharp_boundary(), BKE_lnor_space_custom_normal_to_data(), bm, BM_edges_sharp_from_angle_set(), BM_ELEM_CD_GET_VOID_P, BM_elem_flag_test, BM_elem_index_get, BM_ELEM_LONG_TAG, BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_lnorspace_update(), BM_LOOPS_OF_FACE, BM_mesh_normals_update(), BM_vert_step_fan_loop(), CD_CUSTOMLOOPNORMAL, CustomData_get_offset(), BMLoop::e, ELEM, BMLoop::f, F_EDGE, F_NONE, F_ORIG, F_RECON, F_VERT, get_face_kind(), BevelParams::harden_normals, l, BMesh::ldata, BMesh::lnor_spacearr, MLoopNorSpaceArray::lspacearr, BMVert::no, BMFace::no, norm(), normalize_v3(), NULL, BevelParams::offset, BMLoop::prev, BevelParams::smoothresh, and BMLoop::v.
Referenced by BM_mesh_bevel().
|
static |
Calculate an offset that is the lesser of the current bp.offset and the maximum possible offset before geometry collisions happen. If the offset changes as a result of this, adjust the current edge offset specs to reflect this clamping, and store the new offset in bp.offset.
Definition at line 7385 of file bmesh_bevel.c.
References BevelParams::affect_type, BEVEL_AFFECT_VERTICES, bm, BM_elem_flag_test, BM_ELEM_TAG, BM_ITER_MESH, BM_VERTS_OF_MESH, BevVert::edgecount, BevVert::edges, find_bevvert(), geometry_collide_offset(), BevelParams::offset, EdgeHalf::offset_l, EdgeHalf::offset_l_spec, EdgeHalf::offset_r, EdgeHalf::offset_r_spec, and vertex_collide_offset().
Referenced by BM_mesh_bevel().
|
static |
Definition at line 6580 of file bmesh_bevel.c.
References bm, BM_CREATE_NO_DOUBLE, BM_edge_create(), BM_edge_other_vert(), BM_elem_flag_test, BM_ELEM_TAG, VMesh::boundstart, BMVert::co, NewVert::co, e, find_bevvert(), len_squared_v3v3(), BoundVert::next, NULL, BoundVert::nv, v, NewVert::v, BevVert::vmesh, BevVert::wire_edges, and BevVert::wirecount.
Referenced by BM_mesh_bevel().
|
static |
Definition at line 6558 of file bmesh_bevel.c.
References bev_rebuild_polygon(), bm, BM_DEFAULT_ITER_STACK_SIZE, BM_face_kill(), BM_FACES_OF_VERT, BM_iter_as_arrayN(), faces, LIKELY, MEM_freeN, NULL, and v.
Referenced by BM_mesh_bevel().
|
static |
Definition at line 2569 of file bmesh_bevel.c.
References BEVEL_FACE_STRENGTH_AFFECTED, BEVEL_FACE_STRENGTH_ALL, BEVEL_FACE_STRENGTH_NEW, bm, BM_data_layer_add_named(), BM_ELEM_CD_GET_VOID_P, BM_FACES_OF_MESH, BM_ITER_MESH, CD_PROP_INT32, CustomData_get_layer_index(), CustomData_get_n_offset(), CustomData_get_named_layer_index(), F_EDGE, F_ORIG, F_RECON, F_VERT, FACE_STRENGTH_MEDIUM, BevelParams::face_strength_mode, FACE_STRENGTH_STRONG, FACE_STRENGTH_WEAK, get_face_kind(), MOD_WEIGHTEDNORMALS_FACEWEIGHT_CDLAYER_ID, and BMesh::pdata.
Referenced by BM_mesh_bevel().
|
static |
Definition at line 6066 of file bmesh_bevel.c.
References add_v3_v3v3(), BevelParams::affect_type, angle_v3v3(), bev_ccw_test(), BEVEL_AFFECT_VERTICES, BEVEL_AMT_ABSOLUTE, BEVEL_AMT_DEPTH, BEVEL_AMT_OFFSET, BEVEL_AMT_PERCENT, BEVEL_AMT_WIDTH, BEVEL_EPSILON, BKE_defvert_find_weight(), BLI_assert, BLI_ghash_insert(), BLI_memarena_alloc(), bm, BM_BEVEL_EDGE_TAG_DISABLE, BM_BEVEL_EDGE_TAG_ENABLE, BM_edge_calc_length(), BM_edge_face_count(), BM_edge_is_wire(), BM_edge_other_vert(), BM_EDGES_OF_VERT, BM_elem_flag_disable, BM_elem_flag_test, BM_elem_float_data_get(), BM_elem_index_get, BM_ELEM_TAG, BM_ITER_ELEM, CD_BWEIGHT, BMVert::co, contig_ldata_across_edge(), cosf, BevelParams::dvert, BMVert::e, e, EdgeHalf::e, BMesh::edata, edge_face_angle(), BevVert::edgecount, BevVert::edges, ELEM, fabsf, find_bevel_edge_order(), EdgeHalf::fnext, EdgeHalf::fprev, BevelParams::mem_arena, normalize_v3(), NULL, BevVert::offset, BevelParams::offset, BevelParams::offset_type, VMesh::seg, BevelParams::seg, BevVert::selcount, sinf, sub_v3_v3v3(), SWAP, BevelParams::use_weights, v, BevVert::v, BMEdge::v2, v2, BMesh::vdata, BevelParams::vert_hash, BevelParams::vertex_group, BevVert::vmesh, BevVert::wire_edges, BevVert::wirecount, and z.
Referenced by BM_mesh_bevel().
|
static |
Definition at line 5636 of file bmesh_bevel.c.
References BevelParams::affect_type, BEVEL_AFFECT_VERTICES, BLI_assert, bm, BM_CREATE_NO_DOUBLE, BM_edge_create(), BM_vert_face_check(), VMesh::boundstart, BMVert::co, copy_mesh_vert(), copy_v3_v3(), VMesh::count, create_mesh_bmvert(), EdgeHalf::e, BevVert::edges, Profile::end, flag_out_edge(), get_profile_point(), mesh_vert(), Profile::middle, NULL, Profile::plane_co, Profile::plane_no, BevelParams::pro_super_r, BoundVert::profile, Profile::proj_dir, VMesh::seg, Profile::start, Profile::super_r, NewVert::v, BevVert::v, v1, v2, BevVert::vmesh, and zero_v3().
Referenced by build_vmesh().
|
static |
Definition at line 6644 of file bmesh_bevel.c.
References BevVert::edgecount, BevVert::edges, EdgeHalf::is_bev, and BevVert::selcount.
Referenced by bevel_build_edge_polygons().
| void BM_mesh_bevel | ( | BMesh * | bm, |
| const float | offset, | ||
| const int | offset_type, | ||
| const int | profile_type, | ||
| const int | segments, | ||
| const float | profile, | ||
| const bool | affect_type, | ||
| const bool | use_weights, | ||
| const bool | limit_offset, | ||
| const struct MDeformVert * | dvert, | ||
| const int | vertex_group, | ||
| const int | mat, | ||
| const bool | loop_slide, | ||
| const bool | mark_seam, | ||
| const bool | mark_sharp, | ||
| const bool | harden_normals, | ||
| const int | face_strength_mode, | ||
| const int | miter_outer, | ||
| const int | miter_inner, | ||
| const float | spread, | ||
| const float | smoothresh, | ||
| const struct CurveProfile * | custom_profile, | ||
| const int | vmesh_method | ||
| ) |
Definition at line 7454 of file bmesh_bevel.c.
References adjust_offsets(), BevelParams::affect_type, BEVEL_AFFECT_VERTICES, BEVEL_AMT_ABSOLUTE, BEVEL_AMT_PERCENT, bevel_build_edge_polygons(), bevel_extend_edge_data(), BEVEL_FACE_STRENGTH_NONE, bevel_harden_normals(), bevel_limit_offset(), BEVEL_MITER_SHARP, BEVEL_PROFILE_CUSTOM, bevel_reattach_wires(), bevel_rebuild_existing_polygons(), bevel_set_weighted_normal_face_strength(), bevel_vert_construct(), BEVEL_VMESH_CUTOFF, BLI_assert, BLI_ghash_flag_set(), BLI_ghash_free(), BLI_ghash_ptr_new(), BLI_memarena_free(), BLI_memarena_new(), BLI_memarena_use_calloc(), bm, BevelParams::bm, BM_EDGES_OF_MESH, BM_elem_flag_disable, BM_elem_flag_enable, BM_elem_flag_test, BM_ELEM_LONG_TAG, BM_ELEM_TAG, BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_ITER_MESH_MUTABLE, BM_LOOPS_OF_FACE, BM_vert_kill(), BM_VERTS_OF_MESH, BMO_edge_flag_test, BMO_vert_flag_test, build_boundary(), build_vmesh(), e, EDGE_OUT, ELEM, F_EDGE, fabsf, BevelParams::face_hash, BevelParams::face_strength_mode, find_bevvert(), find_profile_fullness(), ProfileSpacing::fullness, get_face_kind(), GHASH_FLAG_ALLOW_DUPES, BevelParams::harden_normals, l, logf, math_layer_info_init(), max_ii(), BevelParams::mem_arena, MEM_SIZE_OPTIMAL, BevelParams::miter_inner, BevelParams::miter_outer, NULL, BevelParams::offset, BevelParams::offset_adjust, PIL_check_seconds_timer(), PRO_CIRCLE_R, PRO_LINE_R, BevelParams::pro_spacing, BevelParams::pro_spacing_miter, PRO_SQUARE_IN_R, PRO_SQUARE_R, BevelParams::pro_super_r, BevelParams::profile_type, regularize_profile_orientation(), BevelParams::seg, set_profile_spacing(), sqrtf, BMesh::use_toolflags, v, BevelParams::vert_hash, VERT_OUT, and BevelParams::vmesh_method.
Referenced by bmo_bevel_exec(), and modifyMesh().
Return a good representative face (for materials, etc.) for faces created around/near BoundVert v. Sometimes care about a second choice, if there is one. If r_fother parameter is non-NULL and there is another, different, possible frep, return the other one in that parameter.
Definition at line 610 of file bmesh_bevel.c.
Referenced by bevel_build_poly(), bevel_build_rings(), and build_center_ngon().
|
static |
Make a circular list of BoundVerts for bv, each of which has the coordinates of a vertex on the boundary of the beveled vertex bv->v. This may adjust some EdgeHalf widths, and there might have to be a subsequent pass to make the widths as consistent as possible. Doesn't make the actual BMVerts.
For a width consistency pass, we just recalculate the coordinates of the #BoundVerts. If the other ends have been (re)built already, then we copy the offsets from there to match, else we use the ideal (user-specified) widths.
| construct | The first time through, construct will be true and we are making the #BoundVerts and setting up the BoundVert and EdgeHalf pointers appropriately. Also, if construct, decide on the mesh pattern that will be used inside the boundary. |
Definition at line 2964 of file bmesh_bevel.c.
References add_new_bound_vert(), adjust_bound_vert(), BevelParams::affect_type, ANGLE_LARGER, ANGLE_SMALLER, BEVEL_AFFECT_VERTICES, BEVEL_MITER_PATCH, BEVEL_MITER_SHARP, BLI_assert, build_boundary_terminal_edge(), build_boundary_vertex_only(), copy_v3_v3(), e, BoundVert::ebev, BevVert::edgecount, edges_angle_kind(), BoundVert::efirst, eh_on_plane(), BoundVert::elast, BoundVert::eon, good_offset_on_edge_between(), EdgeHalf::is_bev, EdgeHalf::leftv, BevelParams::loop_slide, BevelParams::mem_arena, mem_arena, BevelParams::miter_inner, BevelParams::miter_outer, EdgeHalf::next, next_bev(), NULL, offset_meet(), offset_on_edge_between(), r, BevelParams::seg, BevVert::selcount, v, BevVert::v, v1, v2, and BevVert::vmesh.
Referenced by adjust_offsets(), and BM_mesh_bevel().
|
static |
Special case of build_boundary when a single edge is beveled. The 'width adjust' part of build_boundary has been done already, and efirst is the first beveled edge at vertex bv.
Definition at line 2734 of file bmesh_bevel.c.
References add_new_bound_vert(), adjust_bound_vert(), BEVEL_AMT_ABSOLUTE, BEVEL_AMT_PERCENT, BEVEL_EPSILON_BIG, BEVEL_PROFILE_CUSTOM, BLI_assert, VMesh::boundstart, NewVert::co, VMesh::count, dist_squared_to_plane_v3(), e, BoundVert::ebev, BevVert::edgecount, BoundVert::efirst, BoundVert::elast, EdgeHalf::leftv, BevelParams::mark_seam, BevelParams::mark_sharp, BevelParams::mem_arena, mem_arena, VMesh::mesh_kind, move_profile_plane(), BoundVert::next, BMVert::no, NULL, BoundVert::nv, offset_in_plane(), EdgeHalf::offset_l_spec, offset_meet(), BevelParams::offset_type, Profile::plane_co, plane_from_point_normal_v3(), Profile::plane_no, BoundVert::profile, BevelParams::profile, BevelParams::profile_type, EdgeHalf::rightv, set_bound_vert_seams(), set_profile_params(), slide_dist(), sqrtf, BevVert::v, and BevVert::vmesh.
Referenced by build_boundary().
|
static |
Definition at line 2694 of file bmesh_bevel.c.
References add_new_bound_vert(), adjust_bound_vert(), BevelParams::affect_type, BEVEL_AFFECT_VERTICES, BLI_assert, VMesh::count, e, BevVert::edges, BevelParams::mark_seam, BevelParams::mark_sharp, BevelParams::mem_arena, VMesh::mesh_kind, BevelParams::seg, set_bound_vert_seams(), slide_dist(), v, BevVert::v, and BevVert::vmesh.
Referenced by build_boundary().
|
static |
Definition at line 4842 of file bmesh_bevel.c.
References BevVert::any_seam, bev_create_ngon(), BLI_array_append, BLI_array_free, BLI_array_len, BLI_array_staticdeclare, bm, BM_DEFAULT_NGON_STACK_SIZE, VMesh::boundstart, boundvert_rep_face(), BMVert::co, F_VERT, find_closer_edge(), frep_for_center_poly(), get_incident_edges(), mesh_vert(), NULL, record_face_kind(), VMesh::seg, v, BevVert::v, and BevVert::vmesh.
Referenced by bevel_build_rings(), and build_square_in_vmesh().
|
static |
Special case of bevel_build_rings when triangle-corner and profile is 0. There is no corner mesh except, if nseg odd, for a center poly. Boundary verts merge with previous ones according to pattern: (i, 0, k) merged with (i+1, 0, ns-k) for k <= ns/2.
Definition at line 4891 of file bmesh_bevel.c.
References bm, build_center_ngon(), copy_v3_v3(), VMesh::count, create_mesh_bmvert(), BevelParams::mat_nr, mesh_vert(), VMesh::seg, NewVert::v, BevVert::v, and BevVert::vmesh.
Referenced by bevel_build_rings().
|
static |
Definition at line 5688 of file bmesh_bevel.c.
References BevelParams::affect_type, BEVEL_AFFECT_VERTICES, bevel_build_cutoff(), bevel_build_poly(), bevel_build_rings(), bevel_build_trifan(), BEVEL_PROFILE_CUSTOM, bevel_vert_two_edges(), BLI_memarena_alloc(), bm, VMesh::boundstart, calculate_vm_profiles(), NewVert::co, copy_mesh_vert(), copy_v3_v3(), VMesh::count, create_mesh_bmvert(), BoundVert::ebev, get_profile_point(), BoundVert::index, BevelParams::mem_arena, VMesh::mesh, VMesh::mesh_kind, mesh_vert(), mid_v3_v3v3(), move_weld_profile_planes(), BoundVert::next, NULL, BoundVert::nv, pipe_test(), PRO_LINE_R, BoundVert::profile, BevelParams::profile_type, VMesh::seg, BevelParams::seg, BevVert::selcount, set_profile_params(), Profile::super_r, NewVert::v, BevVert::v, and BevVert::vmesh.
Referenced by BM_mesh_bevel().
|
static |
Calculate the actual coordinate values for bndv's profile. This is only needed if bp->seg > 1. Allocate the space for them if that hasn't been done already. If bp->seg is not a power of 2, also need to calculate the coordinate values for the power of 2 >= bp->seg, because the ADJ pattern needs power-of-2 boundaries during construction.
Definition at line 2119 of file bmesh_bevel.c.
References BEVEL_PROFILE_SUPERELLIPSE, BEVEL_VMESH_CUTOFF, BLI_memarena_alloc(), calculate_profile_segments(), Profile::end, Profile::height, if(), len_v3v3(), make_unit_square_map(), BevelParams::mem_arena, Profile::middle, mul_v3_m4v3(), NULL, PRO_LINE_R, BevelParams::pro_spacing, BevelParams::pro_spacing_miter, Profile::prof_co, Profile::prof_co_2, BoundVert::profile, BevelParams::profile_type, BevelParams::seg, ProfileSpacing::seg_2, Profile::start, Profile::super_r, BevelParams::vmesh_method, ProfileSpacing::xvals, ProfileSpacing::xvals_2, ProfileSpacing::yvals, and ProfileSpacing::yvals_2.
Referenced by calculate_vm_profiles(), and make_cube_corner_adj_vmesh().
|
static |
Helper for calculate_profile that builds the 3D locations for the segments and the higher power of 2 segments.
Definition at line 2062 of file bmesh_bevel.c.
References add_v3_v3v3(), copy_v3_v3(), Profile::end, float(), interp_v3_v3v3(), is_zero_v3(), isect_line_plane_v3(), mul_v3_m4v3(), Profile::plane_co, Profile::plane_no, Profile::proj_dir, and Profile::start.
Referenced by calculate_profile().
|
static |
Calculate the profiles for all the BoundVerts of VMesh vm.
Definition at line 2673 of file bmesh_bevel.c.
References BEVEL_PROFILE_CUSTOM, VMesh::boundstart, calculate_profile(), BoundVert::is_arc_start, BoundVert::is_patch_start, BoundVert::is_profile_start, BoundVert::next, BoundVert::profile, BevelParams::profile_type, set_profile_params(), and Profile::special_params.
Referenced by build_vmesh().
|
static |
Definition at line 2254 of file bmesh_bevel.c.
References BEV_EXTEND_EDGE_DATA_CHECK, BM_ELEM_SEAM, BM_ELEM_SMOOTH, e, BevVert::edges, MDeformVert::flag, EdgeHalf::is_bev, and EdgeHalf::next.
Referenced by set_bound_vert_seams().
|
static |
Use a tie-breaking rule to choose a representative face when there are number of choices, face[0], face[1], ..., face[nfaces]. This is needed when there are an odd number of segments, and the center segment (and its continuation into vmesh) can usually arbitrarily be the previous face or the next face. Or, for the center polygon of a corner, all of the faces around the vertex are possibleface_component choices. If we just choose randomly, the resulting UV maps or material assignment can look ugly/inconsistent. Allow for the case when arguments are null.
Definition at line 928 of file bmesh_bevel.c.
References BLI_array_alloca, BLI_assert, BM_elem_flag_test, BM_elem_index_get, BM_ELEM_SELECT, BM_face_calc_center_bounds(), MathLayerInfo::face_component, float(), BMFace::mat_nr, BevelParams::math_layer_info, NULL, and VEC_VALUE_LEN.
Referenced by bevel_build_edge_polygons(), bevel_build_rings(), and frep_for_center_poly().
|
static |
Copy whichever of a and b is closer to v into r.
Definition at line 4924 of file bmesh_bevel.c.
References Freestyle::a, copy_v3_v3(), len_squared_v3v3(), r, and v.
Referenced by square_out_adj_vmesh().
Definition at line 789 of file bmesh_bevel.c.
References BLI_assert, bm, BM_edge_loop_pair(), contig_ldata_across_loops(), CustomData_layer_has_math(), e, BMLoop::f, BMesh::ldata, BMLoop::next, SWAP, CustomData::totlayer, UNUSED_VARS_NDEBUG, BMLoop::v, v1, and v2.
Referenced by bevel_vert_construct(), and math_layer_info_init().
|
static |
Definition at line 777 of file bmesh_bevel.c.
References bm, CustomData_data_equals(), BMHeader::data, BMLoop::head, CustomData::layers, BMesh::ldata, CustomDataLayer::offset, type, and CustomDataLayer::type.
Referenced by contig_ldata_across_edge().
|
static |
Definition at line 509 of file bmesh_bevel.c.
References NewVert::co, copy_v3_v3(), mesh_vert(), and NewVert::v.
Referenced by bevel_vert_two_edges(), and build_vmesh().
|
static |
Definition at line 2640 of file bmesh_bevel.c.
References BevVert::any_seam, BevVert::edgecount, BevVert::edges, and EdgeHalf::is_seam.
Referenced by bevel_build_rings().
Definition at line 501 of file bmesh_bevel.c.
References bm, BM_CREATE_NOP, BM_elem_flag_disable, BM_ELEM_TAG, BM_vert_create(), NewVert::co, flag_out_vert(), mesh_vert(), and NewVert::v.
Referenced by bevel_build_cutoff(), bevel_build_rings(), bevel_vert_two_edges(), build_square_in_vmesh(), and build_vmesh().
|
static |
Definition at line 4103 of file bmesh_bevel.c.
References add_v3_v3(), add_v3_v3v3(), avg4(), beta(), BEVEL_PROFILE_CUSTOM, BLI_assert, VMesh::boundstart, copy_v3_v3(), VMesh::count, get_profile_point(), madd_v3_v3fl(), BevelParams::mem_arena, mesh_vert(), mesh_vert_canon(), mul_v3_fl(), new_adj_vmesh(), BoundVert::next, BoundVert::profile, BevelParams::profile_type, sabin_gamma(), VMesh::seg, vmesh_copy_equiv_verts(), and zero_v3().
Referenced by adj_vmesh(), and make_cube_corner_adj_vmesh().
Definition at line 411 of file bmesh_bevel.c.
References bm, BMO_edge_flag_disable, EDGE_OUT, and BMesh::use_toolflags.
Referenced by bev_rebuild_polygon().
|
static |
Definition at line 1176 of file bmesh_bevel.c.
References BLI_assert, BMVert::co, cross(), cross_v3_v3v3(), dot_v3v3(), BMFace::no, NULL, sub_v3_v3v3(), v, BMEdge::v1, v1, BMEdge::v2, and v2.
Referenced by offset_meet_lines_percent_or_absolute().
Definition at line 5821 of file bmesh_bevel.c.
References angle_normalized_v3v3(), e, M_PI, and BMVert::no.
Referenced by bevel_vert_construct().
Definition at line 1109 of file bmesh_bevel.c.
References ANGLE_LARGER, ANGLE_SMALLER, ANGLE_STRAIGHT, BM_edge_other_vert(), BMVert::co, cross(), cross_v3_v3v3(), dot_v3v3(), EdgeHalf::e, EdgeHalf::fnext, EdgeHalf::fprev, nearly_parallel_normalized(), BMVert::no, BMFace::no, normalize_v3(), sub_v3_v3v3(), v, v1, and v2.
Referenced by build_boundary(), and square_out_adj_vmesh().
Definition at line 591 of file bmesh_bevel.c.
References BM_ITER_ELEM, BM_LOOPS_OF_EDGE, BMLoop::e, l, BMLoop::next, and BMLoop::prev.
Referenced by bevel_edge_order_extend().
|
static |
Definition at line 2656 of file bmesh_bevel.c.
References BEVEL_EPSILON_BIG, dot_v3v3(), e, fabsf, and BMVert::no.
Referenced by build_boundary().
|
static |
Definition at line 5946 of file bmesh_bevel.c.
References BM_BEVEL_EDGE_TAG_DISABLE, BM_BEVEL_EDGE_TAG_ENABLE, BM_BEVEL_EDGE_TAG_TEST, BM_EDGES_OF_VERT, BM_face_edge_share_loop(), BM_FACES_OF_EDGE, BM_ITER_ELEM, BMVert::e, e, EdgeHalf::e, BevVert::edgecount, BevVert::edges, BMEdge::l, NULL, and BevVert::v.
Referenced by find_bevel_edge_order().
|
static |
Definition at line 3979 of file bmesh_bevel.c.
References NewVert::co, copy_v3_v3(), CCL_NAMESPACE_BEGIN::frac(), get_profile_point(), len_v3v3(), BoundVert::nv, and BoundVert::profile.
Referenced by interp_vmesh().
Definition at line 3958 of file bmesh_bevel.c.
References CCL_NAMESPACE_BEGIN::frac(), len_v3v3(), mesh_vert(), and VMesh::seg.
Referenced by interp_vmesh().
Definition at line 6003 of file bmesh_bevel.c.
References bevel_edge_order_extend(), BLI_assert, bm, BM_BEVEL_EDGE_TAG_ENABLE, BM_BEVEL_EDGE_TAG_TEST, BM_edge_face_count(), BM_EDGES_OF_VERT, BM_ITER_ELEM, BM_LOOPS_OF_EDGE, BMVert::e, BMLoop::e, e, EdgeHalf::e, BevVert::edgecount, BevVert::edges, BMLoop::f, fast_bevel_edge_order(), EdgeHalf::fprev, l, BMLoop::next, NULL, BMLoop::prev, BMLoop::v, and BevVert::v.
Referenced by bevel_vert_construct().
|
static |
Definition at line 529 of file bmesh_bevel.c.
References BLI_ghash_lookup(), and BevelParams::vert_hash.
Referenced by adjust_offsets(), bev_rebuild_polygon(), bevel_build_edge_polygons(), bevel_limit_offset(), bevel_reattach_wires(), BM_mesh_bevel(), find_other_end_edge_half(), and regularize_profile_orientation().
Definition at line 4719 of file bmesh_bevel.c.
References BLI_assert, BMVert::co, dist_squared_to_line_segment_v3(), NULL, BMEdge::v1, and BMEdge::v2.
Referenced by bevel_build_poly(), and build_center_ngon().
Definition at line 518 of file bmesh_bevel.c.
References EdgeHalf::e, BevVert::edgecount, BevVert::edges, and NULL.
Referenced by bev_rebuild_polygon(), bevel_build_edge_polygons(), find_other_end_edge_half(), and regularize_profile_orientation().
Find equidistant points (x0,y0), (x1,y1)... (xn,yn) on the superellipse function in the first quadrant. For special profiles (linear, arc, rectangle) the point can be calculated easily, for any other profile a more expensive search procedure must be used because there is no known closed form for equidistant parametrization. xvals and yvals should be size n+1.
Definition at line 7022 of file bmesh_bevel.c.
References KDL::cos(), double(), find_even_superellipse_chords_general(), M_PI, M_SQRT2, PRO_CIRCLE_R, PRO_LINE_R, PRO_SQUARE_IN_R, PRO_SQUARE_R, r, and KDL::sin().
Referenced by set_profile_spacing().
|
static |
This search procedure to find equidistant points (x,y) in the first superellipse quadrant works for every superellipse exponent but is more expensive than known solutions for special cases. Call the point on superellipse that intersects x=y line mx. For r>=1 use only the range x in [0,mx] and mirror the rest along x=y line, for r<1 use only x in [mx,1]. Points are initially spaced and iteratively repositioned to have the same distance.
Definition at line 6922 of file bmesh_bevel.c.
References e, find_superellipse_chord_endpoint(), M_SQRT2, KDL::pow(), r, sqrt(), sum(), and superellipse_co().
Referenced by find_even_superellipse_chords().
|
static |
Find the EdgeHalf representing the other end of e->e.
Definition at line 539 of file bmesh_bevel.c.
References BLI_assert, BMVert::e, e, find_bevvert(), find_edge_half(), NULL, BMEdge::v1, and BMEdge::v2.
Referenced by adjust_offsets(), geometry_collide_offset(), next_edgehalf_bev(), and vertex_collide_offset().
|
static |
Find the profile's "fullness," which is the fraction of the space it takes up way from the boundvert's centroid to the original vertex for a non-custom profile, or in the case of a custom profile, the average "height" of the profile points along its centerline.
Definition at line 7098 of file bmesh_bevel.c.
References BEVEL_PROFILE_CUSTOM, CIRCLE_FULLNESS_SEGS, float(), PRO_CIRCLE_R, PRO_LINE_R, BevelParams::pro_spacing, BevelParams::pro_super_r, BevelParams::profile, BevelParams::profile_type, BevelParams::seg, ProfileSpacing::xvals, and ProfileSpacing::yvals.
Referenced by BM_mesh_bevel().
|
static |
Definition at line 6854 of file bmesh_bevel.c.
References e, fabs(), M_SQRT2, KDL::pow(), r, sqrt(), and superellipse_co().
Referenced by find_even_superellipse_chords_general().
Definition at line 397 of file bmesh_bevel.c.
References bm, BMO_edge_flag_enable, EDGE_OUT, and BMesh::use_toolflags.
Referenced by bev_create_ngon(), bevel_build_trifan(), and bevel_vert_two_edges().
Definition at line 404 of file bmesh_bevel.c.
References bm, BMO_vert_flag_enable, BMesh::use_toolflags, and VERT_OUT.
Referenced by create_mesh_bmvert().
|
static |
Pick a good face from all the faces around bv to use for a representative face, using choose_rep_face. We want to choose from among the faces that would be chosen for a single-segment edge polygon between two successive Boundverts. But the single beveled edge is a special case, where we also want to consider the third face (else can get zero-area UV interpolated face).
If there are math-having custom loop layers, like UV, then don't include faces that would result in zero-area UV polygons if chosen as the rep.
Definition at line 4800 of file bmesh_bevel.c.
References BLI_array_alloca, choose_rep_face(), BevVert::edgecount, BevVert::edges, EdgeHalf::fnext, EdgeHalf::fprev, MathLayerInfo::has_math_layers, is_bad_uv_poly(), EdgeHalf::is_bev, BevelParams::math_layer_info, NULL, and BevVert::selcount.
Referenced by bevel_build_poly(), and build_center_ngon().
|
static |
Assume we have a situation like:
a d
\ /
A \ / C
\ th1 th2/
b---------c
B
where edges are A, B, and C, following a face around vertices a, b, c, d. th1 is angle abc and th2 is angle bcd; and the argument EdgeHalf eb is B, going from b to c. In general case, edge offset specs for A, B, C have the form ka*t, kb*t, kc*t where ka, kb, kc are some factors (may be 0) and t is the current bp->offset. We want to calculate t at which the clone of B parallel to it collapses. This can be calculated using trig. Another case of geometry collision that can happen is When B slides along A because A is un-beveled. Then it might collide with a. Similarly for B sliding along C.
Definition at line 7245 of file bmesh_bevel.c.
References angle_v3v3v3(), BEVEL_AMT_ABSOLUTE, BEVEL_AMT_PERCENT, BM_edge_calc_length(), BM_face_edge_share_loop(), BMVert::co, EdgeHalf::e, ELEM, find_other_end_edge_half(), EdgeHalf::fnext, EdgeHalf::is_bev, EdgeHalf::is_rev, BMLoop::next, EdgeHalf::next, NULL, BevelParams::offset, EdgeHalf::offset_l_spec, EdgeHalf::offset_r_spec, BevelParams::offset_type, BMLoop::prev, EdgeHalf::prev, sinf, t, tanf, BMLoop::v, BevVert::v, BMEdge::v1, and BMEdge::v2.
Referenced by bevel_limit_offset().
|
static |
Definition at line 425 of file bmesh_bevel.c.
References BLI_ghash_lookup(), F_ORIG, BevelParams::face_hash, and POINTER_AS_INT.
Referenced by bevel_edges_sharp_boundary(), bevel_harden_normals(), bevel_set_weighted_normal_face_strength(), and BM_mesh_bevel().
Definition at line 4697 of file bmesh_bevel.c.
References BM_EDGES_OF_FACE, BM_ITER_ELEM, e, NULL, and v.
Referenced by bevel_build_poly(), and build_center_ngon().
|
static |
Find the point on given profile at parameter i which goes from 0 to nseg as the profile moves from pro->start to pro->end. We assume that nseg is either the global seg number or a power of 2 less than or equal to the power of 2 >= seg. In the latter case, we subsample the profile for seg_2, which will not necessarily give equal spaced chords, but is in fact more what is desired by the cubic subdivision method used to make the vmesh pattern.
Definition at line 2033 of file bmesh_bevel.c.
References BLI_assert, copy_v3_v3(), Profile::end, is_power_of_2_i(), NULL, BevelParams::pro_spacing, Profile::prof_co, Profile::prof_co_2, BevelParams::seg, ProfileSpacing::seg_2, and Profile::start.
Referenced by adj_vmesh(), bevel_vert_two_edges(), build_vmesh(), cubic_subdiv(), fill_profile_fracs(), and make_cube_corner_adj_vmesh().
|
static |
Return true if it will look good to put the meeting point where offset_on_edge_between would put it. This means that neither side sees a reflex angle.
Definition at line 1556 of file bmesh_bevel.c.
References offset_meet_edge(), and v.
Referenced by build_boundary().
Definition at line 4755 of file bmesh_bevel.c.
References blender::compositor::area(), area_poly_v3(), BLI_array_alloca, BLI_assert, VMesh::boundstart, BMVert::co, VMesh::count, count, fabsf, float(), NULL, snap_face_dist_squared(), v, and BevVert::vmesh.
Referenced by is_bad_uv_poly().
Definition at line 4004 of file bmesh_bevel.c.
References CCL_NAMESPACE_BEGIN::frac().
Referenced by interp_vmesh().
|
static |
Definition at line 4031 of file bmesh_bevel.c.
References BEVEL_EPSILON, BLI_array_alloca, VMesh::boundstart, center, copy_v3_v3(), VMesh::count, fill_profile_fracs(), fill_vmesh_fracs(), CCL_NAMESPACE_BEGIN::frac(), interp_bilinear_quad_v3(), interp_range(), BevelParams::mem_arena, mesh_vert(), mesh_vert_canon(), new_adj_vmesh(), BoundVert::next, BoundVert::prev, quad, VMesh::seg, vmesh_center(), and vmesh_copy_equiv_verts().
Referenced by adj_vmesh(), and make_cube_corner_adj_vmesh().
If we make a poly out of verts around bv, snapping to rep frep, will uv poly have zero area? The uv poly is made by snapping all outside-of-frep vertices to the closest edge in frep. Sometimes this results in a zero or very small area polygon, which translates to a zero or very small area polygon in UV space – not good for interpolating textures.
Definition at line 4780 of file bmesh_bevel.c.
References blender::compositor::area(), BEVEL_EPSILON_BIG, and interp_poly_area().
Referenced by frep_for_center_poly().
|
static |
Definition at line 3869 of file bmesh_bevel.c.
References VMesh::seg.
Referenced by bevel_build_rings(), make_cube_corner_square(), pipe_adj_vmesh(), and vmesh_copy_equiv_verts().
Definition at line 1088 of file bmesh_bevel.c.
References BEVEL_EPSILON_BIG, BMVert::co, dot_v3v3(), BMVert::e, e, normalize_v3(), sub_v3_v3v3(), BMEdge::v1, and BMEdge::v2.
Referenced by offset_meet().
|
static |
Make a VMesh with nseg segments that covers the unit radius sphere octant with center at (0,0,0). This has BoundVerts at (1,0,0), (0,1,0) and (0,0,1), with quarter circle arcs on the faces for the orthogonal planes through the origin.
Definition at line 4357 of file bmesh_bevel.c.
References add_new_bound_vert(), BEVEL_PROFILE_CUSTOM, VMesh::boundstart, calculate_profile(), NewVert::co, copy_v3_fl(), copy_v3_v3(), VMesh::count, cross_v3_v3v3(), cubic_subdiv(), Profile::end, get_profile_point(), interp_vmesh(), M_SQRT1_3, make_cube_corner_square(), make_cube_corner_square_in(), BevelParams::mem_arena, mem_arena, mesh_vert(), Profile::middle, mul_v3_fl(), new_adj_vmesh(), BoundVert::next, NULL, BoundVert::nv, Profile::plane_co, Profile::plane_no, PRO_SQUARE_IN_R, PRO_SQUARE_R, BevelParams::pro_super_r, BoundVert::profile, BevelParams::profile_type, Profile::proj_dir, r, VMesh::seg, BevelParams::seg, snap_to_superellipsoid(), Profile::start, Profile::super_r, and vmesh_copy_equiv_verts().
Referenced by tri_corner_adj_vmesh().
Definition at line 4282 of file bmesh_bevel.c.
References add_new_bound_vert(), copy_v3_v3(), VMesh::count, float(), is_canon(), mem_arena, mesh_vert(), new_adj_vmesh(), NULL, and vmesh_copy_equiv_verts().
Referenced by make_cube_corner_adj_vmesh().
Special case for cube corner, when r is PRO_SQUARE_IN_R, meaning inward straight sides. We mostly don't want a VMesh at all for this case – just a three-way weld with a triangle in the middle for odd nseg.
Definition at line 4316 of file bmesh_bevel.c.
References add_new_bound_vert(), copy_v3_v3(), VMesh::count, float(), M_SQRT2, mem_arena, mesh_vert(), new_adj_vmesh(), and NULL.
Referenced by make_cube_corner_adj_vmesh().
|
static |
Like make_unit_square_map, but this one makes a matrix that transforms the (1,1,1) corner of a unit cube into an arbitrary corner with corner vert d and verts around it a, b, c (in CCW order, viewed from d normal dir). The matrix mat is calculated to map: (1,0,0) -> va (0,1,0) -> vb (0,0,1) -> vc (1,1,1) -> vd We want M to make M*A=B where A has the left side above, as columns and B has the right side as columns - both extended into homogeneous coords. So M = B*(Ainverse). Doing Ainverse by hand gives the code below. The cols of M are 1/2{va-vb+vc-vd}, 1/2{-va+vb-vc+vd}, 1/2{-va-vb+vc+vd}, and 1/2{va+vb+vc-vd} and Blender matrices have cols at m[i][*].
Definition at line 1977 of file bmesh_bevel.c.
References add_v3_v3(), copy_v3_v3(), mul_v3_fl(), and sub_v3_v3().
Referenced by tri_corner_adj_vmesh().
|
static |
Fill matrix r_mat so that a point in the sheared parallelogram with corners va, vmid, vb (and the 4th that is implied by it being a parallelogram) is the result of transforming the unit square by multiplication with r_mat. If it can't be done because the parallelogram is degenerate, return false, else return true. Method: Find vo, the origin of the parallelogram with other three points va, vmid, vb. Also find vd, which is in direction normal to parallelogram and 1 unit away from the origin. The quarter circle in first quadrant of unit square will be mapped to the quadrant of a sheared ellipse in the parallelogram, using a matrix. The matrix mat is calculated to map: (0,1,0) -> va (1,1,0) -> vmid (1,0,0) -> vb (0,1,1) -> vd We want M to make M*A=B where A has the left side above, as columns and B has the right side as columns - both extended into homogeneous coords. So M = B*(Ainverse). Doing Ainverse by hand gives the code below.
Definition at line 1920 of file bmesh_bevel.c.
References add_v3_v3v3(), angle_v3v3(), BEVEL_EPSILON_ANG, cross_v3_v3v3(), fabsf, is_zero_v3(), M_PI, normalize_v3(), sub_v3_v3(), and sub_v3_v3v3().
Referenced by calculate_profile(), and snap_to_pipe_profile().
|
static |
Definition at line 838 of file bmesh_bevel.c.
References BLI_assert, BLI_memarena_alloc(), bm, BM_EDGES_OF_FACE, BM_elem_index_get, BM_FACE, BM_face_at_index(), BM_FACES_OF_EDGE, BM_ITER_ELEM, BM_mesh_elem_index_ensure(), BM_mesh_elem_table_ensure(), CD_MLOOPUV, contig_ldata_across_edge(), CustomData_has_layer(), MathLayerInfo::face_component, MathLayerInfo::has_math_layers, BMesh::ldata, BevelParams::math_layer_info, BevelParams::mem_arena, MEM_freeN, MEM_malloc_arrayN, NULL, BevelParams::seg, BMesh::totface, and CustomData::totlayer.
Referenced by BM_mesh_bevel().
Definition at line 493 of file bmesh_bevel.c.
References VMesh::mesh, and VMesh::seg.
Referenced by adj_vmesh(), bev_merge_end_uvs(), bev_rebuild_polygon(), bevel_build_cutoff(), bevel_build_edge_polygons(), bevel_build_poly(), bevel_build_rings(), bevel_extend_edge_data(), bevel_vert_two_edges(), build_center_ngon(), build_square_in_vmesh(), build_vmesh(), copy_mesh_vert(), create_mesh_bmvert(), cubic_subdiv(), fill_vmesh_fracs(), interp_vmesh(), make_cube_corner_adj_vmesh(), make_cube_corner_square(), make_cube_corner_square_in(), mesh_vert_canon(), pipe_adj_vmesh(), square_out_adj_vmesh(), tri_corner_adj_vmesh(), vmesh_center(), vmesh_copy_equiv_verts(), and weld_cross_attrs_copy().
VMesh verts for vertex i have data for (i, 0 <= j <= ns2, 0 <= k <= ns), where ns2 = floor(nseg / 2). But these overlap data from previous and next i: there are some forced equivalences. Let's call these indices the canonical ones: we will just calculate data for these 0 <= j <= ns2, 0 <= k < ns2 (for odd ns2) 0 <= j < ns2, 0 <= k <= ns2 (for even ns2) also (j=ns2, k=ns2) at i=0 (for even ns2) This function returns the canonical one for any i, j, k in [0,n],[0,ns],[0,ns].
Definition at line 3849 of file bmesh_bevel.c.
References BLI_assert, VMesh::count, mesh_vert(), and VMesh::seg.
Referenced by cubic_subdiv(), interp_vmesh(), and vmesh_copy_equiv_verts().
Maybe move the profile plane for bndv->ebev to the plane its profile's start, and the original beveled vert, bmv. This will usually be the plane containing its adjacent non-beveled edges, but sometimes the start and the end are not on those edges.
Currently just used in build_boundary_terminal_edge.
Definition at line 1810 of file bmesh_bevel.c.
References BEVEL_EPSILON_BIG, BMVert::co, copy_v3_v3(), cross_v3_v3v3(), dot3, dot_v3v3(), Profile::end, fabsf, is_zero_v3(), normalize_v3(), Profile::plane_no, BoundVert::profile, Profile::proj_dir, Profile::special_params, Profile::start, and sub_v3_v3v3().
Referenced by build_boundary_terminal_edge().
Move the profile plane for the two BoundVerts involved in a weld. We want the plane that is most likely to have the intersections of the two edges' profile projections on it. bndv1 and bndv2 are by construction the intersection points of the outside parts of the profiles. The original vertex should form a third point of the desired plane.
Definition at line 1849 of file bmesh_bevel.c.
References BEVEL_EPSILON, BMVert::co, NewVert::co, copy_v3_v3(), cross_v3_v3v3(), dot_v3v3(), fabsf, is_zero_v3(), normalize_v3(), BoundVert::nv, Profile::plane_no, BoundVert::profile, Profile::proj_dir, Profile::special_params, sub_v3_v3v3(), and BevVert::v.
Referenced by build_vmesh().
Definition at line 432 of file bmesh_bevel.c.
References angle_v3v3(), BEVEL_EPSILON_ANG, fabsf, and M_PI.
Referenced by set_profile_params().
Definition at line 442 of file bmesh_bevel.c.
References BEVEL_EPSILON_ANG_DOT, BLI_ASSERT_UNIT_V3, compare_ff(), dot_v3v3(), and fabsf.
Referenced by edges_angle_kind().
Definition at line 3827 of file bmesh_bevel.c.
References BLI_memarena_alloc(), bounds(), VMesh::boundstart, VMesh::count, count, mem_arena, VMesh::mesh, VMesh::mesh_kind, and VMesh::seg.
Referenced by adj_vmesh(), cubic_subdiv(), interp_vmesh(), make_cube_corner_adj_vmesh(), make_cube_corner_square(), make_cube_corner_square_in(), and square_out_adj_vmesh().
Definition at line 558 of file bmesh_bevel.c.
References e, BevVert::edgecount, BevVert::edges, and NULL.
Referenced by bevel_build_trifan(), and build_boundary().
|
static |
Helper function to return the next Beveled EdgeHalf along a path.
| toward_bv | Whether the direction to travel points toward or away from the BevVert connected to the current EdgeHalf. |
| r_bv | The BevVert connected to the EdgeHalf – updated if we're traveling to the other EdgeHalf of an original edge. |
Definition at line 3381 of file bmesh_bevel.c.
References BEVEL_SMALL_ANG_DOT, BMVert::co, compare_ff(), dot_v3v3(), EdgeHalf::e, find_other_end_edge_half(), EdgeHalf::is_bev, EdgeHalf::next, normalize_v3(), NULL, sub_v3_v3v3(), BMEdge::v1, and BMEdge::v2.
Referenced by regularize_profile_orientation().
|
static |
Definition at line 1635 of file bmesh_bevel.c.
References BM_edge_other_vert(), BMVert::co, copy_v3_v3(), cross_v3_v3v3(), BMVert::e, e, fabsf, left, madd_v3_v3fl(), normalize_v3(), sub_v3_v3v3(), v, BMEdge::v1, BMEdge::v2, and zero_v3().
Referenced by build_boundary_terminal_edge().
|
static |
Calculate the meeting point between the offset edges for e1 and e2, putting answer in meetco. e1 and e2 share vertex v and face f (may be NULL) and viewed from the normal side of the bevel vertex, e1 precedes e2 in CCW order. Offset edge is on right of both edges, where e1 enters v and e2 leave it. When offsets are equal, the new point is on the edge bisector, with length offset/sin(angle/2), but if the offsets are not equal (we allow for because the bevel modifier has edge weights that may lead to different offsets) then the meeting point can be found by intersecting offset lines. If making the meeting point significantly changes the left or right offset from the user spec, record the change in offset_l (or offset_r); later we can tell that a change has happened because the offset will differ from its original value in offset_l_spec (or offset_r_spec).
| edges_between | If this is true, there are edges between e1 and e2 in CCW order so they don't share a common face. We want the meeting point to be on an existing face so it should be dropped onto one of the intermediate faces, if possible. |
| e_in_plane | If we need to drop from the calculated offset lines to one of the faces, we don't want to drop onto the 'in plane' face, so if this is not null skip this edge's faces. |
Definition at line 1309 of file bmesh_bevel.c.
References add_v3_v3(), add_v3_v3v3(), angle_v3v3(), BEVEL_AMT_ABSOLUTE, BEVEL_AMT_PERCENT, BEVEL_EPSILON_ANG, BEVEL_SMALL_ANG, BM_edge_other_vert(), closest_to_plane_normalized_v3(), BMVert::co, copy_v3_v3(), cosf, cross_v3_v3v3(), dot_v3v3(), e, EdgeHalf::e, ELEM, fabsf, EdgeHalf::fnext, EdgeHalf::fprev, is_outside_edge(), isect_line_line_v3(), M_PI, madd_v3_v3fl(), max_ff(), mid_v3_v3v3(), mul_v3_fl(), negate_v3(), EdgeHalf::next, BMVert::no, BMFace::no, normalize_v3(), NULL, EdgeHalf::offset_l, offset_meet_lines_percent_or_absolute(), EdgeHalf::offset_r, BevelParams::offset_type, plane_from_point_normal_v3(), point_between_edges(), EdgeHalf::prev, slide_dist(), sub_v3_v3v3(), v, and zero_v3().
Referenced by build_boundary(), and build_boundary_terminal_edge().
|
static |
Calculate the meeting point between e1 and e2 (one of which should have zero offsets), where e1 precedes e2 in CCW order around their common vertex v (viewed from normal side). If r_angle is provided, return the angle between e and meetco in *r_angle. If the angle is 0, or it is 180 degrees or larger, there will be no meeting point; return false in that case, else true.
Definition at line 1506 of file bmesh_bevel.c.
References angle_normalized_v3v3(), BEVEL_GOOD_ANGLE, BM_edge_other_vert(), BMVert::co, copy_v3_v3(), cross_v3_v3v3(), dot_v3v3(), EdgeHalf::e, fabsf, float(), M_PI, madd_v3_v3fl(), BMVert::no, normalize_v3(), EdgeHalf::offset_l, EdgeHalf::offset_r, sinf, sub_v3_v3v3(), and v.
Referenced by good_offset_on_edge_between(), and offset_on_edge_between().
|
static |
Definition at line 1215 of file bmesh_bevel.c.
References BEVEL_AMT_ABSOLUTE, BevelParams::bm, BM_edge_calc_length(), BM_edge_other_vert(), BM_elem_float_data_get(), BM_face_vert_share_loop(), CD_BWEIGHT, BMVert::co, copy_v3_v3(), BMLoop::e, EdgeHalf::e, BMesh::edata, edge_edge_angle_less_than_180(), EdgeHalf::fnext, EdgeHalf::fprev, l, NULL, BevelParams::offset, BevelParams::offset_type, BMLoop::prev, slide_dist(), BevelParams::use_weights, v, v1, and v2.
Referenced by offset_meet().
|
static |
Calculate the best place for a meeting point for the offsets from edges e1 and e2 on the in-between edge emid. Viewed from the vertex normal side, the CCW order of these edges is e1, emid, e2. Return true if we placed meetco as compromise between where two edges met. If we did, put the ratio of sines of angles in *r_sinratio too. However, if the bp->offset_type is BEVEL_AMT_PERCENT or BEVEL_AMT_ABSOLUTE, we just slide along emid by the specified amount.
Definition at line 1572 of file bmesh_bevel.c.
References BEVEL_AMT_ABSOLUTE, BEVEL_AMT_PERCENT, BLI_assert, BevelParams::bm, BM_edge_other_vert(), BM_elem_float_data_get(), CD_BWEIGHT, BMVert::co, copy_v3_v3(), EdgeHalf::e, BMesh::edata, ELEM, interp_v3_v3v3(), EdgeHalf::is_bev, madd_v3_v3v3fl(), mid_v3_v3v3(), normalize_v3(), BevelParams::offset, offset_meet_edge(), EdgeHalf::offset_r, BevelParams::offset_type, sinf, slide_dist(), sub_v3_v3v3(), BevelParams::use_weights, v, and v2.
Referenced by build_boundary().
|
static |
See pipe_test for conditions that make 'pipe'; vpipe is the return value from that. We want to make an ADJ mesh but then snap the vertices to the profile in a plane perpendicular to the pipes.
Definition at line 4635 of file bmesh_bevel.c.
References adj_vmesh(), BEVEL_PROFILE_CUSTOM, NewVert::co, VMesh::count, ELEM, float(), BoundVert::index, interp_v3_v3v3(), is_canon(), max_ii(), mesh_vert(), min_ff(), BoundVert::next, BevelParams::profile_type, VMesh::seg, snap_to_pipe_profile(), and BevVert::vmesh.
Referenced by bevel_build_rings().
Do the edges at bv form a "pipe"? Current definition: 3 or 4 beveled edges, 2 in line with each other, with other edges on opposite sides of the pipe if there are 4. Also, the vertex boundary should have 3 or 4 vertices in it, and all of the faces involved should be parallel to the pipe edges. Return the boundary vert whose ebev is one of the pipe edges, and whose next boundary vert has a beveled, non-pipe edge.
Definition at line 3786 of file bmesh_bevel.c.
References angle_normalized_v3v3(), BEVEL_EPSILON_ANG, BEVEL_EPSILON_BIG, BM_edge_other_vert(), VMesh::boundstart, BMVert::co, VMesh::count, dot_v3v3(), e, EdgeHalf::e, BoundVert::ebev, BevVert::edgecount, BevVert::edges, fabsf, BMVert::no, normalize_v3(), NULL, BevVert::selcount, sub_v3_v3v3(), BevVert::v, v1, v2, and BevVert::vmesh.
Referenced by build_vmesh().
|
static |
Definition at line 1147 of file bmesh_bevel.c.
References angle_normalized_v3v3(), BEVEL_EPSILON_ANG, BM_edge_other_vert(), BMVert::co, cross_v3_v3v3(), dot_v3v3(), EdgeHalf::e, float(), M_PI, BMFace::no, normalize_v3(), sub_v3_v3v3(), v, v1, and v2.
Referenced by offset_meet().
|
static |
Definition at line 1668 of file bmesh_bevel.c.
References BLI_assert, BMVert::co, copy_v3_v3(), e, and isect_line_line_v3().
Referenced by set_profile_params().
|
static |
Definition at line 418 of file bmesh_bevel.c.
References BLI_ghash_insert(), BevelParams::face_hash, and POINTER_FROM_INT.
Referenced by bev_rebuild_polygon(), bevel_build_edge_polygons(), bevel_build_poly(), bevel_build_rings(), bevel_build_trifan(), and build_center_ngon().
|
static |
Starting along any beveled edge, travel along the chain / cycle of beveled edges including that edge, marking consistent profile orientations along the way. Orientations are marked by setting whether the BoundVert that contains each profile's information is the side of the profile's start or not.
Definition at line 3466 of file bmesh_bevel.c.
References NewVert::co, find_bevvert(), find_edge_half(), EdgeHalf::is_bev, BoundVert::is_profile_start, EdgeHalf::leftv, next_edgehalf_bev(), BoundVert::nv, EdgeHalf::rightv, BMEdge::v1, and EdgeHalf::visited_rpo.
Referenced by BM_mesh_bevel().
|
static |
Definition at line 3927 of file bmesh_bevel.c.
References KDL::cos(), M_PI, M_SQRT3, KDL::pow(), sqrt(), x, and y.
Referenced by cubic_subdiv().
|
static |
Definition at line 2617 of file bmesh_bevel.c.
References BevVert::any_seam, BM_ELEM_SEAM, BM_ELEM_SMOOTH, VMesh::boundstart, check_edge_data_seam_sharp_edges(), e, v, and BevVert::vmesh.
Referenced by build_boundary_terminal_edge(), and build_boundary_vertex_only().
|
static |
Definition at line 1684 of file bmesh_bevel.c.
References add_v3_v3v3(), BevelParams::affect_type, BEVEL_AFFECT_VERTICES, BMVert::co, NewVert::co, copy_v3_v3(), cross_v3_v3v3(), BMVert::e, e, BoundVert::ebev, Profile::end, BoundVert::is_arc_start, isect_line_line_v3(), mid_v3_v3v3(), Profile::middle, nearly_parallel(), negate_v3(), BoundVert::next, normalize_v3(), BoundVert::nv, Profile::plane_co, Profile::plane_no, PRO_CIRCLE_R, PRO_LINE_R, BevelParams::pro_super_r, BoundVert::profile, Profile::proj_dir, project_to_edge(), BevVert::selcount, Profile::start, sub_v3_v3v3(), Profile::super_r, BevVert::v, BMEdge::v1, BMEdge::v2, and zero_v3().
Referenced by build_boundary_terminal_edge(), build_vmesh(), and calculate_vm_profiles().
|
static |
Fills the ProfileSpacing struct with the 2D coordinates for the profile's vertices. The superellipse used for multi-segment profiles does not have a closed-form way to generate evenly spaced points along an arc. We use an expensive search procedure to find the parameter values that lead to bp->seg even chords. We also want spacing for a number of segments that is a power of 2 >= bp->seg (but at least 4). Use doubles because otherwise we cannot come close to float precision for final results.
| pro_spacing | The struct to fill. Changes depending on whether there needs to be a separate miter profile. |
Definition at line 7159 of file bmesh_bevel.c.
References BKE_curveprofile_init(), BLI_memarena_alloc(), BevelParams::custom_profile, double(), find_even_superellipse_chords(), max_ii(), BevelParams::mem_arena, NULL, power_of_2_max_i(), BevelParams::pro_spacing, BevelParams::pro_super_r, BevelParams::seg, ProfileSpacing::seg_2, CurveProfile::segments, CurveProfile::segments_len, CurveProfilePoint::x, ProfileSpacing::xvals, ProfileSpacing::xvals_2, CurveProfilePoint::y, ProfileSpacing::yvals, and ProfileSpacing::yvals_2.
Referenced by BM_mesh_bevel().
Definition at line 1074 of file bmesh_bevel.c.
References BEVEL_EPSILON_D, BM_edge_other_vert(), BMVert::co, copy_v3_v3(), BMVert::e, e, float(), len, madd_v3_v3fl(), normalize_v3(), sub_v3_v3v3(), and v.
Referenced by build_boundary_terminal_edge(), build_boundary_vertex_only(), offset_meet(), offset_meet_lines_percent_or_absolute(), and offset_on_edge_between().
|
static |
Definition at line 4733 of file bmesh_bevel.c.
References BM_EDGES_OF_FACE, BM_ITER_ELEM, closest(), closest_to_line_segment_v3(), BMVert::co, copy_v3_v3(), e, len_squared_v3v3(), and NULL.
Referenced by interp_poly_area().
Snap co to the closest point on the profile for vpipe projected onto the plane containing co with normal in the direction of edge vpipe->ebev. For the square profiles, need to decide whether to snap to just one plane or to the midpoint of the profile; do so if midline is true.
Definition at line 4591 of file bmesh_bevel.c.
References BEVEL_EPSILON_D, closest_to_line_segment_v3(), closest_to_plane_v3(), BMVert::co, compare_v3v3(), copy_v3_v3(), BMVert::e, e, BoundVert::ebev, Profile::end, invert_m4_m4(), make_unit_square_map(), Profile::middle, mul_v3_m4v3(), plane_from_point_normal_v3(), BoundVert::profile, snap(), snap_to_superellipsoid(), Profile::start, sub_v3_v3v3(), Profile::super_r, BMEdge::v1, and BMEdge::v2.
Referenced by pipe_adj_vmesh().
Snap a direction co to a superellipsoid with parameter super_r. For square profiles, midline says whether or not to snap to both planes.
Only currently used for the pipe and cube corner special cases.
Definition at line 2182 of file bmesh_bevel.c.
References Freestyle::a, BEVEL_EPSILON, BLI_assert, Freestyle::c, ELEM, fabsf, max_ff(), min_ff(), normalize_v3(), powf, PRO_CIRCLE_R, PRO_SQUARE_IN_R, PRO_SQUARE_R, r, x, y, and z.
Referenced by make_cube_corner_adj_vmesh(), and snap_to_pipe_profile().
|
static |
Special case of VMesh when profile == 1 and there are 3 or more beveled edges. We want the effect of parallel offset lines (n/2 of them) on each side of the center, for even n. Wherever they intersect with each other between two successive beveled edges, those intersections are part of the vmesh rings. We have to move the boundary edges too – the usual method is to make one profile plane between successive BoundVerts, but for the effect we want here, there will be two planes, one on each side of the original edge. At the moment, this is not called for odd number of segments, though code does something if it is.
Definition at line 4946 of file bmesh_bevel.c.
References add_v3_v3v3(), ANGLE_SMALLER, ANGLE_STRAIGHT, angle_v3v3v3(), BEVEL_SMALL_ANG, VMesh::boundstart, closer_v3_v3v3v3(), closest_to_line_segment_v3(), BMVert::co, NewVert::co, copy_v3_v3(), VMesh::count, EdgeHalf::e, edges_angle_kind(), BoundVert::efirst, BoundVert::elast, float(), interp_v3_v3v3(), BoundVert::is_arc_start, BoundVert::is_patch_start, isect_line_line_v3(), BevelParams::mem_arena, MEM_callocN, MEM_freeN, MEM_mallocN, mesh_vert(), mid_v3_v3v3(), Profile::middle, new_adj_vmesh(), BoundVert::next, BoundVert::nv, BoundVert::prev, BoundVert::profile, VMesh::seg, sinf, sub_v3_v3v3(), BevVert::v, BMEdge::v1, BMEdge::v2, BevVert::vmesh, and vmesh_copy_equiv_verts().
Referenced by bevel_build_rings().
Get the coordinate on the superellipse (x^r + y^r = 1), at parameter value x (or, if !rbig, mirrored (y=x)-line). rbig should be true if r > 1.0 and false if <= 1.0. Assume r > 0.0.
Definition at line 2012 of file bmesh_bevel.c.
References BLI_assert, KDL::pow(), r, and x.
Referenced by find_even_superellipse_chords_general(), and find_superellipse_chord_endpoint().
|
static |
Definition at line 4488 of file bmesh_bevel.c.
References VMesh::boundstart, BMVert::co, NewVert::co, copy_v3_v3(), make_cube_corner_adj_vmesh(), make_unit_cube_map(), mesh_vert(), mul_m4_v4(), BoundVert::next, BoundVert::nv, BevelParams::seg, v, BevVert::v, and BevVert::vmesh.
Referenced by adj_vmesh(), and bevel_build_rings().
|
static |
Definition at line 4441 of file bmesh_bevel.c.
References BevelParams::affect_type, BEVEL_AFFECT_VERTICES, BEVEL_EPSILON, BEVEL_PROFILE_CUSTOM, BM_edge_calc_face_angle_signed_ex(), compare_ff(), VMesh::count, BMVert::e, e, BevVert::edgecount, BevVert::edges, fabsf, M_PI, M_PI_2, M_PI_4, EdgeHalf::offset_l, PRO_SQUARE_R, BevelParams::pro_super_r, BevelParams::profile_type, BevVert::selcount, and BevVert::vmesh.
Referenced by adj_vmesh(), and bevel_build_rings().
|
static |
We have an edge A between vertices a and b, where EdgeHalf ea is the half of A that starts at a. For vertex-only bevels, the new vertices slide from a at a rate ka*t and from b at a rate kb*t. We want to calculate the t at which the two meet.
Definition at line 7361 of file bmesh_bevel.c.
References BM_edge_calc_length(), EdgeHalf::e, find_other_end_edge_half(), NULL, BevelParams::offset, and EdgeHalf::offset_l_spec.
Referenced by bevel_limit_offset().
Definition at line 3901 of file bmesh_bevel.c.
References add_v3_v3(), copy_v3_v3(), VMesh::count, mesh_vert(), mul_v3_fl(), VMesh::seg, and zero_v3().
Referenced by interp_vmesh().
|
static |
Definition at line 3880 of file bmesh_bevel.c.
References NewVert::co, copy_v3_v3(), VMesh::count, is_canon(), mesh_vert(), mesh_vert_canon(), VMesh::seg, NewVert::v, and v1.
Referenced by adj_vmesh(), bevel_build_rings(), cubic_subdiv(), interp_vmesh(), make_cube_corner_adj_vmesh(), make_cube_corner_square(), and square_out_adj_vmesh().
|
static |
Copy edge attribute data across the non-beveled crossing edges of a cross weld.
Situation looks like this:
e->next |
----—3----— ----—2----— ----—1----— e ----—0---— | e->prev
where e is the EdgeHalf of one of the beveled edges, e->next and e->prev are EdgeHalfs for the unbeveled edges of the cross and their attributes are to be copied to the edges 01, 12, 23. The vert i is mesh_vert(vm, vmindex, 0, i)->v.
Definition at line 6670 of file bmesh_bevel.c.
References BLI_assert, bm, BM_edge_exists(), BM_elem_attrs_copy(), BM_elem_flag_disable, BM_elem_flag_enable, BM_elem_flag_test, BM_ELEM_SEAM, BM_ELEM_SMOOTH, e, BevVert::edges, mesh_vert(), NULL, and v.
Referenced by bevel_build_edge_polygons().