MCPcopy Create free account
hub / github.com/Notgnoshi/generative / _isometric

Function _isometric

generative/projection.py:112–118  ·  view source on GitHub ↗

Perform an isometric projection with rotation matrices.

(tagged_points: TaggedPointSequence, dimensions, scale)

Source from the content-addressed store, hash-verified

110
111
112def _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
121def _zeropad_3d(points: Iterable[Tuple[float]]) -> Iterable[Tuple[float]]:

Callers 1

projectFunction · 0.85

Calls 4

_rot_xFunction · 0.85
_rot_yFunction · 0.85
unzipFunction · 0.85
_zeropad_3dFunction · 0.85

Tested by

no test coverage detected