Perform an isometric projection with rotation matrices.
(tagged_points: TaggedPointSequence, dimensions, scale)
| 110 | |
| 111 | |
| 112 | def _isometric(tagged_points: TaggedPointSequence, dimensions, scale) -> TaggedPointSequence: |
| 113 | """Perform an isometric projection with rotation matrices.""" |
| 114 | # TODO: This isometric projection hasn't given very good results so far. It needs more work. |
| 115 | rotation = _rot_x(radians(35.264)) @ _rot_y(radians(45)) |
| 116 | points, tags = unzip(tagged_points) |
| 117 | for point, tag in zip(_zeropad_3d(points), tags): |
| 118 | yield (scale * np.array(point) @ rotation)[:dimensions], tag |
| 119 | |
| 120 | |
| 121 | def _zeropad_3d(points: Iterable[Tuple[float]]) -> Iterable[Tuple[float]]: |
no test coverage detected