(hair_data_dict, nr_verts_per_strand=256)
| 350 | |
| 351 | |
| 352 | def diff_spline(hair_data_dict, nr_verts_per_strand=256): |
| 353 | points = hair_data_dict["points"].cuda() |
| 354 | times = hair_data_dict["times"].cuda() |
| 355 | # print(points.shape[:]) |
| 356 | # print('p:',points[0]) |
| 357 | # print('t:',times) |
| 358 | coeffs = natural_cubic_spline_coeffs(times, points) |
| 359 | spline = NaturalCubicSpline(coeffs) |
| 360 | time_pts = torch.arange(nr_verts_per_strand).cuda() / (nr_verts_per_strand - 1) |
| 361 | # print(time_pts) |
| 362 | time_pts = time_pts.repeat(points.shape[0], 1) |
| 363 | |
| 364 | splined_points = spline.evaluate(time_pts) |
| 365 | # print('sp:',self.splined_points) |
| 366 | splined_points = splined_points.detach() |
| 367 | return splined_points |
| 368 | |
| 369 | |
| 370 | #assumes the input is (Batch,Time,dim) or (Batch,Time) |
nothing calls this directly
no test coverage detected