projects
/
linpy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix error message
[linpy.git]
/
examples
/
tesseract.py
diff --git
a/examples/tesseract.py
b/examples/tesseract.py
index
383d7bd
..
d692e37
100755
(executable)
--- a/
examples/tesseract.py
+++ b/
examples/tesseract.py
@@
-5,19
+5,22
@@
# the cube consists of 6 square faces, the hypersurface of the tesseract
# consists of 8 cubical cells.
# the cube consists of 6 square faces, the hypersurface of the tesseract
# consists of 8 cubical cells.
-from linpy import
*
+from linpy import
Le, symbols
x, y, z, t = symbols('x y z t')
tesseract = Le(0, x, 1) & Le(0, y, 1) & Le(0, z, 1) & Le(0, t, 1)
x, y, z, t = symbols('x y z t')
tesseract = Le(0, x, 1) & Le(0, y, 1) & Le(0, z, 1) & Le(0, t, 1)
+
def faces(polyhedron):
for points in polyhedron.faces():
face = points[0].aspolyhedron()
def faces(polyhedron):
for points in polyhedron.faces():
face = points[0].aspolyhedron()
- face = face.convex_union(*[point.aspolyhedron() for point in points[1:]])
+ face = face.convex_union(*[point.aspolyhedron()
+ for point in points[1:]])
yield face
yield face
+
if __name__ == '__main__':
print('Faces of tesseract\n\n {}\n\nare:\n'.format(tesseract))
for face in faces(tesseract):
if __name__ == '__main__':
print('Faces of tesseract\n\n {}\n\nare:\n'.format(tesseract))
for face in faces(tesseract):