[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] libvob/vob/demo/multifil multifil.py randgraph.py
From: |
Janne V. Kujala |
Subject: |
[Gzz-commits] libvob/vob/demo/multifil multifil.py randgraph.py |
Date: |
Thu, 12 Jun 2003 09:29:57 -0400 |
CVSROOT: /cvsroot/libvob
Module name: libvob
Branch:
Changes by: Janne V. Kujala <address@hidden> 03/06/12 09:29:57
Modified files:
vob/demo/multifil: multifil.py randgraph.py
Log message:
multifil scenes
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/demo/multifil/multifil.py.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/demo/multifil/randgraph.py.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
Patches:
Index: libvob/vob/demo/multifil/multifil.py
diff -u libvob/vob/demo/multifil/multifil.py:1.13
libvob/vob/demo/multifil/multifil.py:1.14
--- libvob/vob/demo/multifil/multifil.py:1.13 Wed Jun 11 13:49:03 2003
+++ libvob/vob/demo/multifil/multifil.py Thu Jun 12 09:29:57 2003
@@ -64,9 +64,15 @@
if self.lines:
vs.put(getDListNocoords("PolygonMode FRONT_AND_BACK LINE"))
- angle = vs.orthoCS(0, "Ang", 0, self.angle, 0, 0, 0);
+ #angle = vs.orthoCS(0, "Ang", 0, self.angle, 0, 0, 0);
- thick = vs.orthoCS(0, "Thi", 0, self.thick, 0, 0, 0);
+ #thick = vs.orthoCS(0, "Thi", 0, self.thick, 0, 0, 0);
+ #thick = vs.orthoCS(0, "Thi", 0, 100*(self.thick / (math.hypot(self.x
- 500, self.y - 500)+50)), 0, 0, 0);
+
+ thick = vs.coords.rational1D22(0, self.thick, 0, 0, 0, 1, 0);
+ angle = vs.coords.rational1D22(0, self.angle, 0, 0, 1, 0, 0);
+ vs.matcher.add(thick, "Thi")
+ vs.matcher.add(angle, "Ang")
border = 2
conns = GLRen.createSortedConnections(
@@ -95,11 +101,12 @@
# vs.put(conns, [d, a, b]);
vs.put(conns, [thick, angle, b, e]);
+ vs.put(conns, [thick, angle, c, e]);
# vs.put(GLRen.createDebugSwitch("Fillets", 1));
# vs.put(GLRen.createDebugSwitch("VFillets", 1));
#vs.put(GLRen.createDebugSwitch("Quadrics", 1));
- vs.put(conns, [thick, angle, e, b]);
+ vs.put(conns, [thick, angle, e, b, c]);
# vs.put(GLRen.createDebugSwitch("Fillets", 0));
# vs.put(GLRen.createDebugSwitch("VFillets", 0));
#vs.put(GLRen.createDebugSwitch("Quadrics", 0));
Index: libvob/vob/demo/multifil/randgraph.py
diff -u libvob/vob/demo/multifil/randgraph.py:1.11
libvob/vob/demo/multifil/randgraph.py:1.12
--- libvob/vob/demo/multifil/randgraph.py:1.11 Wed Jun 11 13:49:03 2003
+++ libvob/vob/demo/multifil/randgraph.py Thu Jun 12 09:29:57 2003
@@ -38,14 +38,21 @@
self,
SlideLin("x", 200, 20, "x", "Left", "Right"),
SlideLin("y", 300, 20, "y", "Up", "Down"),
+ SlideLin("angle", math.pi/4, .05, "meet angle", "+", "-"),
+ SlideLin("thick", .1, .01, "thickness", "T", "t"),
Toggle("drawEdge", 1, "Draw edge", "e"),
Toggle("drawInside", 1, "Draw inside", "i"),
Toggle("depthColor", 0, "Color from depth", "d"),
Toggle("lines", 0, "Toggle showing lines", "l"),
- SlideLin("N", 21, 3, "N", "-", "+"),
+ Toggle("ellipses", 1, "Toggle ellipses", "s"),
+ Toggle("stretched", 1, "Toggle stretched", "v"),
+ Toggle("curvature", 1, "Show curvature", "c"),
+ SlideLin("N", 21, 3, "N", "N", "n"),
SlideLin("ang", 21, 3, "Rotation angle", "Prior", "Next"),
Toggle("fillets", 1, "Toggle filleting", "f"),
- SlideLin("seed", 42, 1, "seed number", "S", "s"),
+ SlideLin("seed", 42, 1, "seed number", "A", "a"),
+ SlideLin("size", 50, 5, "Node size", "K", "k"),
+ SlideLin("dice", 20, 1, "Dice factor", "P", "p"),
)
def scene(self, vs):
vs.put( background((.5,1,.2)))
@@ -61,13 +68,22 @@
if self.lines:
vs.put(getDListNocoords("PolygonMode FRONT_AND_BACK LINE"))
- dice = 200
+ border = 2
conns = GLRen.createSortedConnections(
- GLRen.createFilletSpan1(dice, 1 + 4*self.depthColor +
8*(1-self.fillets)))
+ GLRen.createFilletSpan2(border, self.dice,
+ 1 +
+ 4 * self.depthColor +
+ 8 * (1-self.fillets) +
+ 16 * self.ellipses +
+ 64 * self.stretched), 2)
+
conns_l = GLRen.createSortedConnections(
- GLRen.createFilletSpan1(dice, 2 + 4*self.depthColor +
8*(1-self.fillets)))
-
- size = 10
+ GLRen.createFilletSpan2(border, self.dice,
+ 2 +
+ 4 * self.depthColor +
+ 8 * (1-self.fillets) +
+ 16 * self.ellipses +
+ 64 * self.stretched), 2)
rng = Random(self.seed)
N2 = 2*self.N/3
@@ -78,11 +94,17 @@
cs = vs.scaleCS(0, "cs", 1, 1, .15)
+ thick = vs.coords.rational1D22(0, self.thick, 0, 0, 0, 1, 0);
+ angle = vs.coords.rational1D22(0, self.angle, 0, 0, 1, 0, 0);
+ vs.matcher.add(thick, "Thi")
+ vs.matcher.add(angle, "Ang")
+
+
nodes = [ {
"cs" : vs.orthoBoxCS(cs, "node%s" % i,
rng.random() * box,
rng.random() * box,
- rng.random() * box, 1, 1, size, size),
+ rng.random() * box, 1, 1, self.size,
self.size),
"conns" : [ ],
} for i in range(0,self.N) ]
@@ -101,7 +123,7 @@
def pc(conns):
for node in nodes:
if node["conns"]:
- vs.put(conns, [node["cs"]] + node["conns"])
+ vs.put(conns, [thick, angle, node["cs"]] + node["conns"])
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] libvob/vob/demo/multifil multifil.py randgraph.py,
Janne V. Kujala <=