(strand_dirs, append_last_curv=True)
| 518 | |
| 519 | #strand positions should be [nr_strands,nr_verts,3] |
| 520 | def compute_curv(strand_dirs, append_last_curv=True): |
| 521 | nr_verts_per_strand=strand_dirs.shape[1] |
| 522 | cur_dirs = strand_dirs[:, 0:nr_verts_per_strand - 1, :] |
| 523 | next_dirs = strand_dirs[:, 1:nr_verts_per_strand, :] |
| 524 | curvs = next_dirs - cur_dirs |
| 525 | |
| 526 | #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 |
| 527 | if append_last_curv: |
| 528 | last_curv=curvs[:,-1:,:] |
| 529 | curvs = torch.cat([curvs, last_curv],1) # make the direction nr_strands, 100, 3 |
| 530 | |
| 531 | return curvs |
| 532 | |
| 533 | |
| 534 |
no outgoing calls
no test coverage detected