Convert paths from a collection object to 3D segments.
(paths, zs=0, zdir='z')
| 404 | |
| 405 | |
| 406 | def _paths_to_3d_segments(paths, zs=0, zdir='z'): |
| 407 | """Convert paths from a collection object to 3D segments.""" |
| 408 | |
| 409 | if not np.iterable(zs): |
| 410 | zs = np.broadcast_to(zs, len(paths)) |
| 411 | else: |
| 412 | if len(zs) != len(paths): |
| 413 | raise ValueError('Number of z-coordinates does not match paths.') |
| 414 | |
| 415 | segs = [_path_to_3d_segment(path, pathz, zdir) |
| 416 | for path, pathz in zip(paths, zs)] |
| 417 | return segs |
| 418 | |
| 419 | |
| 420 | def _path_to_3d_segment_with_codes(path, zs=0, zdir='z'): |
no test coverage detected
searching dependent graphs…