Created
December 19, 2021 06:40
-
-
Save jkseppan/11f40e2866460515067bca7ebcfabb0d to your computer and use it in GitHub Desktop.
This file contains 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
import itertools as it | |
import numpy as np | |
def cube24(points): | |
points = np.asarray(points) | |
pp = [(0, 1, 2), (1, 2, 0), (2, 0, 1)] | |
sp = [(1, 1, 1), (-1, -1, 1), (-1, 1, -1), (1, -1, -1)] | |
pn = [(0, 2, 1), (1, 0, 2), (2, 1, 0)] | |
sn = [(-1, 1, 1), (1, -1, 1), (1, 1, -1), (-1, -1, -1)] | |
for perm, sign in it.chain(it.product(pp, sp), it.product(pn,sn)): | |
yield points[:,perm] * sign |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment