Cleanup: Simplify loop syntax for curve points
This commit is contained in:
parent
47c2a876bf
commit
019681b984
Notes:
blender-bot
2023-02-14 10:14:07 +01:00
Referenced by commit b215fe82e8
, Cleanup: Further simplification of loop syntax for curve segments
|
@ -381,11 +381,11 @@ struct CombOperationExecutor {
|
|||
threading::parallel_for(changed_curves.index_range(), 256, [&](const IndexRange range) {
|
||||
for (const int curve_i : changed_curves.as_span().slice(range)) {
|
||||
const IndexRange points = curves_->points_for_curve(curve_i);
|
||||
for (const int segment_i : IndexRange(points.size() - 1)) {
|
||||
const float3 &p1_cu = positions_cu[points[segment_i]];
|
||||
float3 &p2_cu = positions_cu[points[segment_i] + 1];
|
||||
for (const int segment_i : points.drop_back(1)) {
|
||||
const float3 &p1_cu = positions_cu[segment_i];
|
||||
float3 &p2_cu = positions_cu[segment_i + 1];
|
||||
const float3 direction = math::normalize(p2_cu - p1_cu);
|
||||
const float expected_length_cu = expected_lengths_cu[points[segment_i]];
|
||||
const float expected_length_cu = expected_lengths_cu[segment_i];
|
||||
p2_cu = p1_cu + direction * expected_length_cu;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -162,9 +162,9 @@ struct DeleteOperationExecutor {
|
|||
threading::parallel_for(curves_->curves_range(), 512, [&](IndexRange curve_range) {
|
||||
for (const int curve_i : curve_range) {
|
||||
const IndexRange points = curves_->points_for_curve(curve_i);
|
||||
for (const int segment_i : IndexRange(points.size() - 1)) {
|
||||
const float3 pos1_cu = brush_transform_inv * positions_cu[points[segment_i]];
|
||||
const float3 pos2_cu = brush_transform_inv * positions_cu[points[segment_i + 1]];
|
||||
for (const int segment_i : points.drop_back(1)) {
|
||||
const float3 pos1_cu = brush_transform_inv * positions_cu[segment_i];
|
||||
const float3 pos2_cu = brush_transform_inv * positions_cu[segment_i + 1];
|
||||
|
||||
float2 pos1_re, pos2_re;
|
||||
ED_view3d_project_float_v2_m4(region_, pos1_cu, pos1_re, projection.values);
|
||||
|
@ -220,9 +220,9 @@ struct DeleteOperationExecutor {
|
|||
threading::parallel_for(curves_->curves_range(), 512, [&](IndexRange curve_range) {
|
||||
for (const int curve_i : curve_range) {
|
||||
const IndexRange points = curves_->points_for_curve(curve_i);
|
||||
for (const int segment_i : IndexRange(points.size() - 1)) {
|
||||
const float3 pos1_cu = positions_cu[points[segment_i]];
|
||||
const float3 pos2_cu = positions_cu[points[segment_i] + 1];
|
||||
for (const int segment_i : points.drop_back(1)) {
|
||||
const float3 &pos1_cu = positions_cu[segment_i];
|
||||
const float3 &pos2_cu = positions_cu[segment_i + 1];
|
||||
|
||||
float3 closest_segment_cu, closest_brush_cu;
|
||||
isect_seg_seg_v3(pos1_cu,
|
||||
|
|
Loading…
Reference in New Issue