(strand_positions, append_last_dir=True)
| 504 | |
| 505 | #strand positions should be [nr_strands,nr_verts,3] |
| 506 | def compute_dirs(strand_positions, append_last_dir=True): |
| 507 | nr_verts_per_strand=strand_positions.shape[1] |
| 508 | cur_points = strand_positions[:, 0:nr_verts_per_strand - 1, :] |
| 509 | next_points = strand_positions[:, 1:nr_verts_per_strand, :] |
| 510 | dirs = next_points - cur_points |
| 511 | |
| 512 | #dirs have nr_verts-1 because the last point doesn-t have a direction. To get the same nr_verts we duplicate the last dir |
| 513 | if append_last_dir: |
| 514 | last_dir=dirs[:,-1:,:] |
| 515 | dirs = torch.cat([dirs, last_dir],1) # make the direction nr_strands, 100, 3 |
| 516 | |
| 517 | return dirs |
| 518 | |
| 519 | #strand positions should be [nr_strands,nr_verts,3] |
| 520 | def compute_curv(strand_dirs, append_last_curv=True): |
no outgoing calls
no test coverage detected