46 float *quarter_coords_x,
47 float *quarter_coords_y)
66 quarter_coords_y[0] = 0.0f;
76 const bool use_extrude,
87 float *quarter_coords_x = alloca(
sizeof(
float) * (cu->
bevresol + 1));
88 float *quarter_coords_y = alloca(
sizeof(
float) * (cu->
bevresol + 1));
92 if (fill_type ==
FULL) {
94 nr = 4 * cu->
bevresol + (use_extrude ? 6 : 4);
97 else if (fill_type ==
HALF) {
99 nr = 2 * (cu->
bevresol + 1) + (use_extrude ? 2 : 1);
115 float *fp = dl->
verts;
125 for (
int i = cu->
bevresol; i >= 0; i--) {
127 fp[1] = quarter_coords_x[i];
128 fp[2] = -quarter_coords_y[i] - cu->
extrude;
144 const int front_start = (!use_extrude &&
ELEM(fill_type,
HALF,
FULL)) ? 1 : 0;
145 for (
int i = front_start; i < cu->
bevresol + 1; i++) {
147 fp[1] = quarter_coords_x[i];
148 fp[2] = quarter_coords_y[i] + cu->
extrude;
159 if (fill_type ==
FULL) {
160 for (
int i = cu->
bevresol; i > 0; i--) {
162 fp[1] = -quarter_coords_x[i];
163 fp[2] = quarter_coords_y[i] + cu->
extrude;
175 for (
int i = 0; i < cu->
bevresol + 1; i++) {
177 fp[1] = -quarter_coords_x[i];
178 fp[2] = -quarter_coords_y[i] - cu->
extrude;
186 const int nr = 4 + 2 * cu->
bevresol;
196 float *fp = dl->
verts;
197 const float dangle = (2.0f * (
float)
M_PI / (nr));
198 float angle = -(nr - 1) * dangle;
200 for (
int i = 0; i < nr; i++) {
219 float *fp = dl->
verts;
262 float *fp = dlnew->
verts;
263 int nr = dlnew->
parts * dlnew->
nr;
265 fp[2] = fp[1] * facy;
266 fp[1] = -fp[0] * facx;
291 if (use_extrude && !use_bevel) {
294 else if (use_extrude || use_bevel) {
typedef float(TangentPoint)[2]
display list (or rather multi purpose list) stuff.
void BKE_displist_free(struct ListBase *lb)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Object is a sort of wrapper for general info.
Read Guarded memory(de)allocation.
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
static void curve_bevel_make_extrude_and_fill(const Curve *cu, ListBase *disp, const bool use_extrude, const CurveBevelFillType fill_type)
static void curve_bevel_make_only_extrude(const Curve *cu, ListBase *disp)
static CurveBevelFillType curve_bevel_get_fill_type(const Curve *curve)
ListBase BKE_curve_bevel_make(const Curve *curve)
static void curve_bevel_make_from_object(const Curve *cu, ListBase *disp)
static void bevel_quarter_fill(const Curve *curve, float *quarter_coords_x, float *quarter_coords_y)
static void curve_bevel_make_full_circle(const Curve *cu, ListBase *disp)
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
CurveProfilePoint * segments
struct CurveProfile * bevel_profile
struct CurveCache * curve_cache