This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
coords = [ | |
(-4.76519775390625, -2.480715036392212, -1.0), | |
(-4.76519775390625, -2.480715036392212, 2.3569369316101074), | |
(-4.76519775390625, 1.0000009536743164, 2.3569369316101074), | |
(-4.76519775390625, 1.0000009536743164, -1.0), | |
(2.8928911685943604, -2.480715036392212, -1.0), | |
(2.8928911685943604, -2.480715036392212, 2.3569369316101074), | |
(2.8928911685943604, 1.0000009536743164, 2.3569369316101074), | |
(2.8928911685943604, 1.0000009536743164, -1.0) | |
] | |
def p(num): print("method", num) | |
p(1) | |
# rotate first | |
rotated = zip(*coords[::-1]) | |
for (axis, _list) in zip('xyz', rotated): | |
print(axis, 'min', min(_list), 'max', max(_list)) | |
p(2) | |
# not rotated | |
def extreme(func, i): return func(coords, key=lambda k: k[i])[i] | |
for i in range(3): | |
print('xyz'[i], 'min', extreme(min, i), 'max', extreme(max, i)) |