MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / diff_spline

Function diff_spline

utils/strand_util.py:352–367  ·  view source on GitHub ↗
(hair_data_dict, nr_verts_per_strand=256)

Source from the content-addressed store, hash-verified

350
351
352def 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)

Callers

nothing calls this directly

Calls 3

evaluateMethod · 0.95
NaturalCubicSplineClass · 0.85

Tested by

no test coverage detected