2
* ***** BEGIN GPL LICENSE BLOCK *****
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License
6
* as published by the Free Software Foundation; either version 2
7
* of the License, or (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software Foundation,
16
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
* The Original Code is Copyright (C) 2004 Blender Foundation.
19
* All rights reserved.
21
* The Original Code is: all of this file.
23
* Contributor(s): Geoffrey Bantle.
25
* ***** END GPL LICENSE BLOCK *****
28
#ifndef __BKE_BMESH_H__
29
#define __BKE_BMESH_H__
34
* \brief BMesh modeler structure and functions.
38
/*NOTE: this is the bmesh 1.0 code. it's completely outdated.*/
40
/* uncomment to use the new bevel operator as a modifier */
41
#define USE_BM_BEVEL_OP_AS_MOD
43
/* bevel tool defines */
45
#define BME_BEVEL_ORIG 1
46
#define BME_BEVEL_BEVEL (1 << 1)
47
#define BME_BEVEL_NONMAN (1 << 2)
48
#define BME_BEVEL_WIRE (1 << 3)
51
#define BME_BEVEL_SELECT 1
52
#define BME_BEVEL_VERT (1 << 1)
53
#define BME_BEVEL_RADIUS (1 << 2)
54
#define BME_BEVEL_ANGLE (1 << 3)
55
#define BME_BEVEL_WEIGHT (1 << 4)
56
#define BME_BEVEL_VGROUP (1 << 5)
57
//~ #define BME_BEVEL_EWEIGHT (1<<4)
58
//~ #define BME_BEVEL_VWEIGHT (1<<5)
59
#define BME_BEVEL_PERCENT (1 << 6)
60
#define BME_BEVEL_EMIN (1 << 7)
61
#define BME_BEVEL_EMAX (1 << 8)
62
#define BME_BEVEL_RUNNING (1 << 9)
63
#define BME_BEVEL_RES (1 << 10)
65
#define BME_BEVEL_EVEN (1 << 11) /* this is a new setting not related to old (trunk bmesh bevel code) but adding
66
* here because they are mixed - campbell */
67
#define BME_BEVEL_DIST (1 << 12) /* same as above */
69
#define BME_BEVEL_OVERLAP_OK (1 << 13)
71
typedef struct BME_TransData {
72
struct BMesh *bm; /* the bmesh the vert belongs to */
73
struct BMVert *v; /* pointer to the vert this tdata applies to */
74
float co[3]; /* the original coordinate */
75
float org[3]; /* the origin */
76
float vec[3]; /* a directional vector; always, always normalize! */
77
void *loc; /* a pointer to the data to transform (likely the vert's cos) */
78
float factor; /* primary scaling factor; also accumulates number of weighted edges for beveling tool */
79
float weight; /* another scaling factor; used primarily for propogating vertex weights to transforms; */
80
/* weight is also used across recursive bevels to help with the math */
81
float maxfactor; /* the unscaled, original factor (used only by "edge verts" in recursive beveling) */
82
float *max; /* the maximum distance this vert can be transformed; negative is infinite
83
* it points to the "parent" maxfactor (where maxfactor makes little sense)
84
* where the max limit is stored (limits are stored per-corner) */
87
typedef struct BME_TransData_Head {
88
struct GHash *gh; /* the hash structure for element lookup */
89
struct MemArena *ma; /* the memory "pool" we will be drawing individual elements from */
93
struct BME_TransData *BME_get_transdata(struct BME_TransData_Head *td, struct BMVert *v);
94
void BME_free_transdata(struct BME_TransData_Head *td);
95
struct BMesh *BME_bevel(struct BMesh *bm, float value, int res, int options, int defgrp_index, float angle,
96
BME_TransData_Head **rtd);