projects
/
linpy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
e8ebee6
)
Implement method Polyhedron.faces()
author
Vivien Maisonneuve
<v.maisonneuve@gmail.com>
Sat, 12 Jul 2014 07:57:20 +0000
(09:57 +0200)
committer
Vivien Maisonneuve
<v.maisonneuve@gmail.com>
Sat, 12 Jul 2014 07:57:20 +0000
(09:57 +0200)
pypol/polyhedra.py
patch
|
blob
|
history
diff --git
a/pypol/polyhedra.py
b/pypol/polyhedra.py
index
5d9c287
..
37f16e0
100644
(file)
--- a/
pypol/polyhedra.py
+++ b/
pypol/polyhedra.py
@@
-242,6
+242,17
@@
class Polyhedron(Domain):
angles[m] = angle
return sorted(points, key=angles.get)
+ def faces(self):
+ vertices = self.vertices()
+ faces = []
+ for constraint in self.constraints:
+ face = []
+ for vertex in vertices:
+ if constraint.subs(vertex.coordinates()) == 0:
+ face.append(vertex)
+ faces.append(face)
+ return faces
+
def plot(self):
import matplotlib.pyplot as plt
from matplotlib.path import Path