Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2019-11-21 00:12:32 +0300
committerHans Goudey <h.goudey@me.com>2019-11-21 00:25:28 +0300
commitba1e9ae4733ae956331c7e8899f6939997205298 (patch)
tree007362ed2c9ee4564b67404f552906d6e66848db /source/blender/blenkernel/BKE_curveprofile.h
parent8c6ce742391b2b8798143a4a2c2224ebbeb7f1ec (diff)
Bevel: Custom Profile and CurveProfile Widget
Custom profiles in bevel allows the profile curve to be controlled by manually placed control points. Orientation is regularized along groups of edges, and the 'pipe case' is updated. This commit includes many updates to comments and changed variable names as well. A 'cutoff' vertex mesh method is added to bevel in addition to the existing grid fill option for replacing vertices. The UI of the bevel modifier and tool are updated and unified. Also, a 'CurveProfile' widget is added to BKE for defining the profile in the interface, which may be useful in other situations. Many thanks to Howard, my mentor for this GSoC project. Reviewers: howardt, campbellbarton Differential Revision: https://developer.blender.org/D5516
Diffstat (limited to 'source/blender/blenkernel/BKE_curveprofile.h')
-rw-r--r--source/blender/blenkernel/BKE_curveprofile.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_curveprofile.h b/source/blender/blenkernel/BKE_curveprofile.h
new file mode 100644
index 00000000000..1f6659d785a
--- /dev/null
+++ b/source/blender/blenkernel/BKE_curveprofile.h
@@ -0,0 +1,76 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Copyright (C) 2019 Blender Foundation.
+ * All rights reserved.
+ */
+
+#ifndef __BKE_CURVEPROFILE_H__
+#define __BKE_CURVEPROFILE_H__
+
+/** \file
+ * \ingroup bke
+ */
+
+struct CurveProfile;
+struct CurveProfilePoint;
+
+void BKE_curveprofile_set_defaults(struct CurveProfile *profile);
+
+struct CurveProfile *BKE_curveprofile_add(int preset);
+
+void BKE_curveprofile_free_data(struct CurveProfile *profile);
+
+void BKE_curveprofile_free(struct CurveProfile *profile);
+
+void BKE_curveprofile_copy_data(struct CurveProfile *target, const struct CurveProfile *profile);
+
+struct CurveProfile *BKE_curveprofile_copy(const struct CurveProfile *profile);
+
+bool BKE_curveprofile_remove_point(struct CurveProfile *profile, struct CurveProfilePoint *point);
+
+void BKE_curveprofile_remove_by_flag(struct CurveProfile *profile, const short flag);
+
+struct CurveProfilePoint *BKE_curveprofile_insert(struct CurveProfile *profile, float x, float y);
+
+void BKE_curveprofile_selected_handle_set(struct CurveProfile *profile, int type_1, int type_2);
+
+void BKE_curveprofile_reverse(struct CurveProfile *profile);
+
+void BKE_curveprofile_reset(struct CurveProfile *profile);
+
+void BKE_curveprofile_create_samples(struct CurveProfile *profile,
+ int segments_len,
+ bool sample_straight_edges,
+ struct CurveProfilePoint *r_samples);
+
+void BKE_curveprofile_initialize(struct CurveProfile *profile, short segments_len);
+
+/* Called for a complete update of the widget after modifications */
+void BKE_curveprofile_update(struct CurveProfile *profile, const bool rem_doubles);
+
+/* Need to find the total length of the curve to sample a portion of it */
+float BKE_curveprofile_total_length(const struct CurveProfile *profile);
+
+void BKE_curveprofile_create_samples_even_spacing(struct CurveProfile *profile,
+ int segments_len,
+ struct CurveProfilePoint *r_samples);
+
+/* Length portion is the fraction of the total path length where we want the location */
+void BKE_curveprofile_evaluate_length_portion(const struct CurveProfile *profile,
+ float length_portion,
+ float *x_out,
+ float *y_out);
+#endif