Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/curve_to_mesh_convert.cc
| Show First 20 Lines • Show All 180 Lines • ▼ Show 20 Lines | for (const int i_profile : IndexRange(info.profile_edge_len)) { | ||||
| loop_c.v = next_ring_vert_offset + i_next_profile; | loop_c.v = next_ring_vert_offset + i_next_profile; | ||||
| loop_c.e = next_ring_edge_offset + i_profile; | loop_c.e = next_ring_edge_offset + i_profile; | ||||
| MLoop &loop_d = r_loops[ring_segment_loop_offset + 3]; | MLoop &loop_d = r_loops[ring_segment_loop_offset + 3]; | ||||
| loop_d.v = next_ring_vert_offset + i_profile; | loop_d.v = next_ring_vert_offset + i_profile; | ||||
| loop_d.e = spline_edge_start + i_ring; | loop_d.e = spline_edge_start + i_ring; | ||||
| } | } | ||||
| } | } | ||||
| 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 poly_size = info.spline_edge_len * info.profile_edge_len; | ||||
| const int cap_loop_offset = info.loop_offset + poly_size * 4; | const int cap_loop_offset = info.loop_offset + poly_size * 4; | ||||
| const int cap_poly_offset = info.poly_offset + poly_size; | const int cap_poly_offset = info.poly_offset + poly_size; | ||||
| MPoly &poly_start = r_polys[cap_poly_offset]; | MPoly &poly_start = r_polys[cap_poly_offset]; | ||||
| poly_start.loopstart = cap_loop_offset; | poly_start.loopstart = cap_loop_offset; | ||||
| poly_start.totloop = info.profile_edge_len; | poly_start.totloop = info.profile_edge_len; | ||||
| MPoly &poly_end = r_polys[cap_poly_offset + 1]; | MPoly &poly_end = r_polys[cap_poly_offset + 1]; | ||||
| ▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | return curve.evaluated_points_size() * profile.evaluated_edges_size() + | ||||
| curve.evaluated_edges_size() * profile.evaluated_points_size(); | curve.evaluated_edges_size() * profile.evaluated_points_size(); | ||||
| } | } | ||||
| static inline int spline_extrude_loop_size(const Spline &curve, | static inline int spline_extrude_loop_size(const Spline &curve, | ||||
| const Spline &profile, | const Spline &profile, | ||||
| const bool fill_caps) | const bool fill_caps) | ||||
| { | { | ||||
| const int tube = curve.evaluated_edges_size() * profile.evaluated_edges_size() * 4; | 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; | return tube + caps; | ||||
| } | } | ||||
| static inline int spline_extrude_poly_size(const Spline &curve, | static inline int spline_extrude_poly_size(const Spline &curve, | ||||
| const Spline &profile, | const Spline &profile, | ||||
| const bool fill_caps) | const bool fill_caps) | ||||
| { | { | ||||
| const int tube = curve.evaluated_edges_size() * profile.evaluated_edges_size(); | 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; | return tube + caps; | ||||
| } | } | ||||
| struct ResultOffsets { | struct ResultOffsets { | ||||
| Array<int> vert; | Array<int> vert; | ||||
| Array<int> edge; | Array<int> edge; | ||||
| Array<int> loop; | Array<int> loop; | ||||
| Array<int> poly; | Array<int> poly; | ||||
| ▲ Show 20 Lines • Show All 490 Lines • Show Last 20 Lines | |||||