Project the given 3D geometry objects onto one of the standard 2D bases.
(tagged_points: TaggedPointSequence, basis: str, scale)
| 124 | |
| 125 | |
| 126 | def _drop_coord(tagged_points: TaggedPointSequence, basis: str, scale) -> TaggedPointSequence: |
| 127 | """Project the given 3D geometry objects onto one of the standard 2D bases.""" |
| 128 | # Do not allow flips. That is, you cannot reorder coordinates, only drop. |
| 129 | if basis == "xy": |
| 130 | coord = 2 |
| 131 | elif basis == "xz": |
| 132 | coord = 1 |
| 133 | elif basis == "yz": |
| 134 | coord = 0 |
| 135 | else: |
| 136 | raise ValueError(f"Unsupported basis for dropping coordinates '{basis=}'") |
| 137 | points, tags = unzip(tagged_points) |
| 138 | for point, tag in zip(_zeropad_3d(points), tags): |
| 139 | point = (*point[:coord], *point[coord + 1 :]) |
| 140 | point = tuple(scale * c for c in point) |
| 141 | yield point, tag |
no test coverage detected