49 float *quarter_coords_x,
50 float *quarter_coords_y)
55 for (
int i = 0; i < curve->
bevresol + 1; i++) {
69 quarter_coords_y[0] = 0.0f;
70 for (
int i = 1; i < curve->
bevresol + 1; i++) {
78 ListBaseT<DispList> *disp,
79 const bool use_extrude,
90 float *quarter_coords_x =
static_cast<float *
>(alloca(
sizeof(
float) * (cu->
bevresol + 1)));
91 float *quarter_coords_y =
static_cast<float *
>(alloca(
sizeof(
float) * (cu->
bevresol + 1)));
95 if (fill_type ==
FULL) {
97 nr = 4 * cu->
bevresol + (use_extrude ? 6 : 4);
100 else if (fill_type ==
HALF) {
102 nr = 2 * (cu->
bevresol + 1) + (use_extrude ? 2 : 1);
118 float *fp = dl->
verts;
128 for (
int i = cu->
bevresol; i >= 0; i--) {
130 fp[1] = quarter_coords_x[i];
131 fp[2] = -quarter_coords_y[i] - cu->
extrude;
147 const int front_start = (!use_extrude &&
ELEM(fill_type,
HALF,
FULL)) ? 1 : 0;
148 for (
int i = front_start; i < cu->
bevresol + 1; i++) {
150 fp[1] = quarter_coords_x[i];
151 fp[2] = quarter_coords_y[i] + cu->
extrude;
162 if (fill_type ==
FULL) {
163 for (
int i = cu->
bevresol; i > 0; i--) {
165 fp[1] = -quarter_coords_x[i];
166 fp[2] = quarter_coords_y[i] + cu->
extrude;
178 for (
int i = 0; i < cu->
bevresol + 1; i++) {
180 fp[1] = -quarter_coords_x[i];
181 fp[2] = -quarter_coords_y[i] - cu->
extrude;
189 const int nr = 4 + 2 * cu->
bevresol;
199 float *fp = dl->
verts;
200 const float dangle = (2.0f *
float(
M_PI) / (nr));
201 float angle = -(nr - 1) * dangle;
203 for (
int i = 0; i < nr; i++) {
222 float *fp = dl->
verts;
231 if (cu->
bevobj ==
nullptr) {
240 ListBaseT<DispList> bevdisp = {
nullptr,
nullptr};
266 float *fp = dlnew->
verts;
267 int nr = dlnew->
parts * dlnew->
nr;
269 fp[2] = fp[1] * facy;
270 fp[1] = -fp[0] * facx;
284 ListBaseT<DispList> bevel_shape = {
nullptr,
nullptr};
287 if (curve->
bevobj !=
nullptr) {
292 const bool use_extrude = curve->
extrude != 0.0f;
295 if (use_extrude && !use_bevel) {
298 else if (use_extrude || use_bevel) {
display list (or rather multi purpose list) stuff.
Object is a sort of wrapper for general info.
Read Blender memory allocation and freeing.
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
void * MEM_new_uninitialized(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
static void bevel_quarter_fill(const Curve *curve, float *quarter_coords_x, float *quarter_coords_y)
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
void BKE_displist_free(ListBaseT< DispList > *lb)
static CurveBevelFillType curve_bevel_get_fill_type(const Curve *curve)
static void curve_bevel_make_only_extrude(const Curve *cu, ListBaseT< DispList > *disp)
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
static void curve_bevel_make_from_object(const Curve *cu, ListBaseT< DispList > *disp)
static void curve_bevel_make_full_circle(const Curve *cu, ListBaseT< DispList > *disp)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
static void curve_bevel_make_extrude_and_fill(const Curve *cu, ListBaseT< DispList > *disp, const bool use_extrude, const CurveBevelFillType fill_type)
ListBaseT< DispList > BKE_curve_bevel_make(const Curve *curve)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
ListBaseT< DispList > disp
CurveProfilePoint * segments
eCurveBevelMode bevel_mode
struct CurveProfile * bevel_profile
bke::ObjectRuntime * runtime