Changeset View
Changeset View
Standalone View
Standalone View
source/blender/geometry/intern/subdivide_curves.cc
| Show First 20 Lines • Show All 366 Lines • ▼ Show 20 Lines | #endif | ||||
| }; | }; | ||||
| auto subdivide_bezier = [&](IndexMask selection) { | auto subdivide_bezier = [&](IndexMask selection) { | ||||
| const Span<float3> src_positions = src_curves.positions(); | const Span<float3> src_positions = src_curves.positions(); | ||||
| const VArraySpan<int8_t> src_types_l{src_curves.handle_types_left()}; | const VArraySpan<int8_t> src_types_l{src_curves.handle_types_left()}; | ||||
| const VArraySpan<int8_t> src_types_r{src_curves.handle_types_right()}; | const VArraySpan<int8_t> src_types_r{src_curves.handle_types_right()}; | ||||
| const Span<float3> src_handles_l = src_curves.handle_positions_left(); | const Span<float3> src_handles_l = src_curves.handle_positions_left(); | ||||
| const Span<float3> src_handles_r = src_curves.handle_positions_right(); | const Span<float3> src_handles_r = src_curves.handle_positions_right(); | ||||
| const OffsetIndices src_points_by_curve = src_curves.points_by_curve(); | const OffsetIndices<int> src_points_by_curve = src_curves.points_by_curve(); | ||||
| MutableSpan<float3> dst_positions = dst_curves.positions_for_write(); | MutableSpan<float3> dst_positions = dst_curves.positions_for_write(); | ||||
| MutableSpan<int8_t> dst_types_l = dst_curves.handle_types_left_for_write(); | MutableSpan<int8_t> dst_types_l = dst_curves.handle_types_left_for_write(); | ||||
| MutableSpan<int8_t> dst_types_r = dst_curves.handle_types_right_for_write(); | MutableSpan<int8_t> dst_types_r = dst_curves.handle_types_right_for_write(); | ||||
| MutableSpan<float3> dst_handles_l = dst_curves.handle_positions_left_for_write(); | MutableSpan<float3> dst_handles_l = dst_curves.handle_positions_left_for_write(); | ||||
| MutableSpan<float3> dst_handles_r = dst_curves.handle_positions_right_for_write(); | MutableSpan<float3> dst_handles_r = dst_curves.handle_positions_right_for_write(); | ||||
| const OffsetIndices dst_points_by_curve = dst_curves.points_by_curve(); | const OffsetIndices<int> dst_points_by_curve = dst_curves.points_by_curve(); | ||||
| threading::parallel_for(selection.index_range(), 512, [&](IndexRange range) { | threading::parallel_for(selection.index_range(), 512, [&](IndexRange range) { | ||||
| for (const int curve_i : selection.slice(range)) { | for (const int curve_i : selection.slice(range)) { | ||||
| const IndexRange src_points = src_points_by_curve[curve_i]; | const IndexRange src_points = src_points_by_curve[curve_i]; | ||||
| const IndexRange src_segments = curve_dst_offsets(src_points, curve_i); | const IndexRange src_segments = curve_dst_offsets(src_points, curve_i); | ||||
| const IndexRange dst_points = dst_points_by_curve[curve_i]; | const IndexRange dst_points = dst_points_by_curve[curve_i]; | ||||
| subdivide_bezier_positions(src_positions.slice(src_points), | subdivide_bezier_positions(src_positions.slice(src_points), | ||||
| ▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines | |||||