Convert paths from a collection object to 3D segments with path codes.
(paths, zs=0, zdir='z')
| 433 | |
| 434 | |
| 435 | def _paths_to_3d_segments_with_codes(paths, zs=0, zdir='z'): |
| 436 | """ |
| 437 | Convert paths from a collection object to 3D segments with path codes. |
| 438 | """ |
| 439 | |
| 440 | zs = np.broadcast_to(zs, len(paths)) |
| 441 | segments_codes = [_path_to_3d_segment_with_codes(path, pathz, zdir) |
| 442 | for path, pathz in zip(paths, zs)] |
| 443 | if segments_codes: |
| 444 | segments, codes = zip(*segments_codes) |
| 445 | else: |
| 446 | segments, codes = [], [] |
| 447 | return list(segments), list(codes) |
| 448 | |
| 449 | |
| 450 | class Collection3D(Collection): |
no test coverage detected
searching dependent graphs…