Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/curves_geometry.cc
| Show First 20 Lines • Show All 727 Lines • ▼ Show 20 Lines | if (!bezier_mask.is_empty()) { | ||||
| threading::parallel_for(bezier_mask.index_range(), 1024, [&](IndexRange range) { | threading::parallel_for(bezier_mask.index_range(), 1024, [&](IndexRange range) { | ||||
| for (const int curve_index : bezier_mask.slice(range)) { | for (const int curve_index : bezier_mask.slice(range)) { | ||||
| if (cyclic[curve_index]) { | if (cyclic[curve_index]) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| const IndexRange points = this->points_for_curve(curve_index); | const IndexRange points = this->points_for_curve(curve_index); | ||||
| const IndexRange evaluated_points = this->evaluated_points_for_curve(curve_index); | const IndexRange evaluated_points = this->evaluated_points_for_curve(curve_index); | ||||
| if (handles_right[points.first()] != positions[points.first()]) { | const float epsilon = 1e-6f; | ||||
| if (!math::almost_equal_relative( | |||||
| handles_right[points.first()], positions[points.first()], epsilon)) { | |||||
| tangents[evaluated_points.first()] = math::normalize(handles_right[points.first()] - | tangents[evaluated_points.first()] = math::normalize(handles_right[points.first()] - | ||||
| positions[points.first()]); | positions[points.first()]); | ||||
| } | } | ||||
| if (handles_left[points.last()] != positions[points.last()]) { | if (!math::almost_equal_relative( | ||||
| handles_left[points.last()], positions[points.last()], epsilon)) { | |||||
| tangents[evaluated_points.last()] = math::normalize(positions[points.last()] - | tangents[evaluated_points.last()] = math::normalize(positions[points.last()] - | ||||
| handles_left[points.last()]); | handles_left[points.last()]); | ||||
| } | } | ||||
| } | } | ||||
| }); | }); | ||||
| } | } | ||||
| }); | }); | ||||
| ▲ Show 20 Lines • Show All 818 Lines • Show Last 20 Lines | |||||