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:
ba56751
)
Minor improvements in diamonds.py example
author
Vivien Maisonneuve
<v.maisonneuve@gmail.com>
Wed, 16 Jul 2014 09:47:10 +0000
(11:47 +0200)
committer
Vivien Maisonneuve
<v.maisonneuve@gmail.com>
Wed, 16 Jul 2014 09:50:43 +0000
(11:50 +0200)
examples/diamonds.py
patch
|
blob
|
history
diff --git
a/examples/diamonds.py
b/examples/diamonds.py
index
1bbfc2d
..
572a870
100755
(executable)
--- a/
examples/diamonds.py
+++ b/
examples/diamonds.py
@@
-9,14
+9,14
@@
from pypol import *
x, y, z = symbols('x y z')
x, y, z = symbols('x y z')
-fig = plt.figure()
+fig = plt.figure(
facecolor='white'
)
-diam_plot = fig.add_subplot(2, 2, 1)
+diam_plot = fig.add_subplot(2, 2, 1
, aspect='equal'
)
diam_plot.set_title('Diamond')
diam = Ge(y, x - 1) & Le(y, x + 1) & Ge(y, -x - 1) & Le(y, -x + 1)
diam.plot(diam_plot, fill=True, edgecolor='red', facecolor='yellow')
diam_plot.set_title('Diamond')
diam = Ge(y, x - 1) & Le(y, x + 1) & Ge(y, -x - 1) & Le(y, -x + 1)
diam.plot(diam_plot, fill=True, edgecolor='red', facecolor='yellow')
-cham_plot = fig.add_subplot(2, 2, 2, projection='3d')
+cham_plot = fig.add_subplot(2, 2, 2, projection='3d'
, aspect='equal'
)
cham_plot.set_title('Chamfered cube')
cham = Le(0, x) & Le(x, 3) & Le(0, y) & Le(y, 3) & Le(0, z) & Le(z, 3) & \
Le(z - 2, x) & Le(x, z + 2) & Le(1 - z, x) & Le(x, 5 - z) & \
cham_plot.set_title('Chamfered cube')
cham = Le(0, x) & Le(x, 3) & Le(0, y) & Le(y, 3) & Le(0, z) & Le(z, 3) & \
Le(z - 2, x) & Le(x, z + 2) & Le(1 - z, x) & Le(x, 5 - z) & \
@@
-24,7
+24,7
@@
cham = Le(0, x) & Le(x, 3) & Le(0, y) & Le(y, 3) & Le(0, z) & Le(z, 3) & \
Le(y - 2, x) & Le(x, y + 2) & Le(1 - y, x) & Le(x, 5 - y)
cham.plot(cham_plot, facecolors=(1, 0, 0, 0.75))
Le(y - 2, x) & Le(x, y + 2) & Le(1 - y, x) & Le(x, 5 - y)
cham.plot(cham_plot, facecolors=(1, 0, 0, 0.75))
-rhom_plot = fig.add_subplot(2, 2, 3, projection='3d')
+rhom_plot = fig.add_subplot(2, 2, 3, projection='3d'
, aspect='equal'
)
rhom_plot.set_title('Rhombicuboctahedron')
rhom = cham & \
Le(x + y + z, 7) & Ge(-2, -x - y - z) & \
rhom_plot.set_title('Rhombicuboctahedron')
rhom = cham & \
Le(x + y + z, 7) & Ge(-2, -x - y - z) & \
@@
-33,7
+33,7
@@
rhom = cham & \
Le(-1, -x + y + z) & Le(-x + y + z, 4)
rhom.plot(rhom_plot, facecolors=(0, 1, 0, 0.75))
Le(-1, -x + y + z) & Le(-x + y + z, 4)
rhom.plot(rhom_plot, facecolors=(0, 1, 0, 0.75))
-cubo_plot = fig.add_subplot(2, 2, 4, projection='3d')
+cubo_plot = fig.add_subplot(2, 2, 4, projection='3d'
, aspect='equal'
)
cubo_plot.set_title('Truncated cuboctahedron')
cubo = Le(0, x) & Le(x, 5) & Le(0, y) & Le(y, 5) & Le(0, z) & Le(z, 5) & \
Le(x -4, y) & Le(y, x + 4) & Le(-x + 1, y) & Le(y, -x + 9) & \
cubo_plot.set_title('Truncated cuboctahedron')
cubo = Le(0, x) & Le(x, 5) & Le(0, y) & Le(y, 5) & Le(0, z) & Le(z, 5) & \
Le(x -4, y) & Le(y, x + 4) & Le(-x + 1, y) & Le(y, -x + 9) & \