(strand, num_strand_points=100)
| 152 | return length, delta_length |
| 153 | |
| 154 | def spline_strand(strand, num_strand_points=100): |
| 155 | num_ori_points = strand.shape[0] |
| 156 | interp_spline = splines.CatmullRom(strand) |
| 157 | interp_idx = np.arange(num_strand_points) / (num_strand_points / (num_ori_points - 1)) |
| 158 | interp_strand = interp_spline.evaluate(interp_idx) |
| 159 | assert interp_strand.shape[0] == num_strand_points, "Spline error." |
| 160 | |
| 161 | return interp_strand |
| 162 | |
| 163 | |
| 164 | def pad_strand(strand, num_strand_points=100): |