Convert a path to a 3D segment with path codes.
(path, zs=0, zdir='z')
| 418 | |
| 419 | |
| 420 | def _path_to_3d_segment_with_codes(path, zs=0, zdir='z'): |
| 421 | """Convert a path to a 3D segment with path codes.""" |
| 422 | |
| 423 | zs = np.broadcast_to(zs, len(path)) |
| 424 | pathsegs = path.iter_segments(simplify=False, curves=False) |
| 425 | seg_codes = [((x, y, z), code) for ((x, y), code), z in zip(pathsegs, zs)] |
| 426 | if seg_codes: |
| 427 | seg, codes = zip(*seg_codes) |
| 428 | seg3d = [juggle_axes(x, y, z, zdir) for (x, y, z) in seg] |
| 429 | else: |
| 430 | seg3d = [] |
| 431 | codes = [] |
| 432 | return seg3d, list(codes) |
| 433 | |
| 434 | |
| 435 | def _paths_to_3d_segments_with_codes(paths, zs=0, zdir='z'): |
no test coverage detected
searching dependent graphs…