Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def vertices(self):
"""The vertices of the asymmetric domain.
Returns
-------
Rotation
"""
normal_combinations = list(itertools.combinations(self, 3))
if len(normal_combinations) < 1:
return Rotation.empty()
c1, c2, c3 = zip(*normal_combinations)
c1, c2, c3 = (
Rotation.stack(c1).flatten(),
Rotation.stack(c2).flatten(),
Rotation.stack(c3).flatten(),
)
v = Rotation.triple_cross(c1, c2, c3)
v = v[~np.any(np.isnan(v.data), axis=-1)]
v = v[v < self].unique()
surface = np.any(np.isclose(v.dot_outer(self).data, 0), axis=1)
return v[surface]
def vertices(self):
"""The vertices of the asymmetric domain.
Returns
-------
Rotation
"""
normal_combinations = list(itertools.combinations(self, 3))
if len(normal_combinations) < 1:
return Rotation.empty()
c1, c2, c3 = zip(*normal_combinations)
c1, c2, c3 = (
Rotation.stack(c1).flatten(),
Rotation.stack(c2).flatten(),
Rotation.stack(c3).flatten(),
)
v = Rotation.triple_cross(c1, c2, c3)
v = v[~np.any(np.isnan(v.data), axis=-1)]
v = v[v < self].unique()
surface = np.any(np.isclose(v.dot_outer(self).data, 0), axis=1)
return v[surface]
def vertices(self):
"""The vertices of the asymmetric domain.
Returns
-------
Rotation
"""
normal_combinations = list(itertools.combinations(self, 3))
if len(normal_combinations) < 1:
return Rotation.empty()
c1, c2, c3 = zip(*normal_combinations)
c1, c2, c3 = (
Rotation.stack(c1).flatten(),
Rotation.stack(c2).flatten(),
Rotation.stack(c3).flatten(),
)
v = Rotation.triple_cross(c1, c2, c3)
v = v[~np.any(np.isnan(v.data), axis=-1)]
v = v[v < self].unique()
surface = np.any(np.isclose(v.dot_outer(self).data, 0), axis=1)
return v[surface]