@@ -62,7 +62,7 @@ pub fn sample_points_on_bezpath(bezpath: BezPath, spacing: f64, start_offset: f6
62
62
let mut next_length = length_up_to_next_sample_point - length_up_to_previous_segment;
63
63
let mut next_segment_length = segments_length[ next_segment_index] ;
64
64
65
- // Keep moving to the next segment while the next sample point length is less or equals to the length up to that segment.
65
+ // Keep moving to the next segment while the length up to the next sample point is less or equals to the length up to the segment.
66
66
while next_length > next_segment_length {
67
67
if next_segment_index == segments_length. len ( ) - 1 {
68
68
break ;
@@ -100,12 +100,12 @@ pub fn t_value_to_parametric(bezpath: &BezPath, t: f64, euclidian: bool, segment
100
100
101
101
/// Finds the t value of point on the given path segment i.e fractional distance along the segment's total length.
102
102
/// It uses a binary search to find the value `t` such that the ratio `length_up_to_t / total_length` approximates the input `distance`.
103
- pub fn eval_pathseg_euclidean ( path : kurbo:: PathSeg , distance : f64 , accuracy : f64 ) -> f64 {
103
+ pub fn eval_pathseg_euclidean ( path_segment : kurbo:: PathSeg , distance : f64 , accuracy : f64 ) -> f64 {
104
104
let mut low_t = 0. ;
105
105
let mut mid_t = 0.5 ;
106
106
let mut high_t = 1. ;
107
107
108
- let total_length = path . perimeter ( accuracy) ;
108
+ let total_length = path_segment . perimeter ( accuracy) ;
109
109
110
110
if !total_length. is_finite ( ) || total_length <= f64:: EPSILON {
111
111
return 0. ;
@@ -114,7 +114,7 @@ pub fn eval_pathseg_euclidean(path: kurbo::PathSeg, distance: f64, accuracy: f64
114
114
let distance = distance. clamp ( 0. , 1. ) ;
115
115
116
116
while high_t - low_t > accuracy {
117
- let current_length = path . subsegment ( 0.0 ..mid_t) . perimeter ( accuracy) ;
117
+ let current_length = path_segment . subsegment ( 0.0 ..mid_t) . perimeter ( accuracy) ;
118
118
let current_distance = current_length / total_length;
119
119
120
120
if current_distance > distance {
0 commit comments