Skip to content

Commit

Permalink
Removed copy of inherited method get_dihedral
Browse files Browse the repository at this point in the history
  • Loading branch information
janbridley committed Dec 4, 2023
1 parent 4fe9d88 commit 778f69f
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions coxeter/shapes/convex_polyhedron.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,36 +776,6 @@ def maximal_centered_bounded_sphere(self):
min_distance = -np.max(distances)
return Sphere(min_distance, center)

def get_dihedral(self, a, b):
"""Get the dihedral angle between a pair of faces.
The dihedral is computed from the dot product of the face normals.
Args:
a (int):
The index of the first face.
b (int):
The index of the second face.
Returns
-------
float: The dihedral angle in radians.
Example:
>>> cube = coxeter.shapes.ConvexPolyhedron(
... [[1, 1, 1], [1, -1, 1], [1, 1, -1], [1, -1, -1],
... [-1, 1, 1], [-1, -1, 1], [-1, 1, -1], [-1, -1, -1]])
>>> cube = coxeter.shapes.Polyhedron(
... vertices=cube.vertices, faces=cube.faces)
>>> import numpy as np
>>> assert np.isclose(cube.get_dihedral(1, 2), np.pi / 2.)
"""
if b not in self.neighbors[a]:
raise ValueError("The two faces are not neighbors.")
n1, n2 = self._equations[[a, b], :3]
return np.arccos(np.dot(-n1, n2))

def _plato_primitive(self, backend):
return backend.ConvexPolyhedra(
positions=np.array([self.center]),
Expand Down

0 comments on commit 778f69f

Please sign in to comment.