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:
authorLeon Schittek <lone_noel>2022-02-18 20:25:25 +0300
committerHans Goudey <h.goudey@me.com>2022-02-18 20:27:28 +0300
commitddc52f2e1d0d15c2176c54691dbc24c549453c3b (patch)
tree36949b6d2e87283afbb64d8d4c0c8c08682c5e6f /source/blender/blenkernel
parentaf6a1b08e3f0d0070ac9423868d2d3f81057717a (diff)
Fix: Curve to Mesh node creates caps when curve is cyclic
The "Fill Caps" option on the Curve to Mesh node introduced in rBbc2f4dd8b408ee makes it possible to fill the open ends of the sweep to create a manifold mesh. This patch fixes an edge case, where caps were created even when the rail curve (the curve used in the "Curve" input socket) was cyclic making the resulting mesh non-manifold. Differential Revision: https://developer.blender.org/D14124
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/curve_to_mesh_convert.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/curve_to_mesh_convert.cc b/source/blender/blenkernel/intern/curve_to_mesh_convert.cc
index 833b2fe99ec..097414cced1 100644
--- a/source/blender/blenkernel/intern/curve_to_mesh_convert.cc
+++ b/source/blender/blenkernel/intern/curve_to_mesh_convert.cc
@@ -186,7 +186,8 @@ static void spline_extrude_to_mesh_data(const ResultInfo &info,
}
}
- if (fill_caps && profile.is_cyclic()) {
+ const bool has_caps = fill_caps && profile.is_cyclic() && !spline.is_cyclic();
+ if (has_caps) {
const int poly_size = info.spline_edge_len * info.profile_edge_len;
const int cap_loop_offset = info.loop_offset + poly_size * 4;
const int cap_poly_offset = info.poly_offset + poly_size;
@@ -270,7 +271,8 @@ static inline int spline_extrude_loop_size(const Spline &curve,
const bool fill_caps)
{
const int tube = curve.evaluated_edges_size() * profile.evaluated_edges_size() * 4;
- const int caps = (fill_caps && profile.is_cyclic()) ? profile.evaluated_edges_size() * 2 : 0;
+ const bool has_caps = fill_caps && profile.is_cyclic() && !curve.is_cyclic();
+ const int caps = has_caps ? profile.evaluated_edges_size() * 2 : 0;
return tube + caps;
}
@@ -279,7 +281,8 @@ static inline int spline_extrude_poly_size(const Spline &curve,
const bool fill_caps)
{
const int tube = curve.evaluated_edges_size() * profile.evaluated_edges_size();
- const int caps = (fill_caps && profile.is_cyclic()) ? 2 : 0;
+ const bool has_caps = fill_caps && profile.is_cyclic() && !curve.is_cyclic();
+ const int caps = has_caps ? 2 : 0;
return tube + caps;
}