[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] libvob include/vob/geom/Fillets2.hxx include/vo...
From: |
Janne V. Kujala |
Subject: |
[Gzz-commits] libvob include/vob/geom/Fillets2.hxx include/vo... |
Date: |
Sat, 05 Jul 2003 09:13:03 -0400 |
CVSROOT: /cvsroot/libvob
Module name: libvob
Branch:
Changes by: Janne V. Kujala <address@hidden> 03/07/05 09:13:03
Modified files:
include/vob/geom: Fillets2.hxx
include/vob/vobs: Fillet.hxx
vob/demo/multifil: stretching.py
vob/fillet : light3d.py
Log message:
twids
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/geom/Fillets2.hxx.diff?tr1=1.31&tr2=1.32&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/vobs/Fillet.hxx.diff?tr1=1.47&tr2=1.48&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/demo/multifil/stretching.py.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/fillet/light3d.py.diff?tr1=1.30&tr2=1.31&r1=text&r2=text
Patches:
Index: libvob/include/vob/geom/Fillets2.hxx
diff -u libvob/include/vob/geom/Fillets2.hxx:1.31
libvob/include/vob/geom/Fillets2.hxx:1.32
--- libvob/include/vob/geom/Fillets2.hxx:1.31 Sat Jul 5 07:55:57 2003
+++ libvob/include/vob/geom/Fillets2.hxx Sat Jul 5 09:13:03 2003
@@ -88,7 +88,7 @@
/** The distance from the center to the middle of the connection.
*/
float d;
- /** The thickness of the connection at the middle.
+ /** The thickness(radius) of the connection at the middle.
*/
float t;
/** Whether we're looking at the clockwise (+1) or counterclockwise
(-1) side.
@@ -129,7 +129,7 @@
z(z) {
dir = dirVec(a);
norm = dir.cw90() * sign;
- endPoint = node.ctr + d * dir + t/2 * norm;
+ endPoint = node.ctr + d * dir + t * norm;
}
/** Project a given point to the connecting line.
@@ -189,7 +189,7 @@
const LinearConnectionHalf &conn,
float ta
) : node(node), conn(conn), tangentAngle(ta) {
- r1 = (.5*conn.t - sin(ta) * node.r) / (sin(ta) - 1);
+ r1 = (conn.t - sin(ta) * node.r) / (sin(ta) - 1);
x0 = cos(ta) * node.r;
@@ -207,7 +207,7 @@
ZVec point(float fract, ZVec *intern = 0) const {
float angle = lerp(0, cutangle, fract);
- float y = (1-cos(angle)) * r1 + conn.t / 2;
+ float y = (1-cos(angle)) * r1 + conn.t;
float x = x1 - sin(angle) * r1 - x0;
@@ -344,7 +344,7 @@
) : node(node), conn(conn), tangentAngle(ta)
{
eno = Vec(-cos(tangentAngle), sin(tangentAngle));
- ept = Vec(conn.d, -conn.t/2) + node.r * eno;
+ ept = Vec(conn.d, -conn.t) + node.r * eno;
elli = Geom::symmellipse__point_norm(ept, eno);
@@ -762,7 +762,7 @@
void compute_rtbl(int n) {
rtbl.resize(n + 1);
- a0 = atan(0.5 * c.t / c.d);
+ a0 = atan(c.t / c.d);
for (int i = 1; i < n; i++) {
float t = i * (1.0 / n);
Index: libvob/include/vob/vobs/Fillet.hxx
diff -u libvob/include/vob/vobs/Fillet.hxx:1.47
libvob/include/vob/vobs/Fillet.hxx:1.48
--- libvob/include/vob/vobs/Fillet.hxx:1.47 Sat Jul 5 07:55:57 2003
+++ libvob/include/vob/vobs/Fillet.hxx Sat Jul 5 09:13:03 2003
@@ -187,20 +187,18 @@
a = atan(angle_t.transform(ZVec(d / r, 0, 0)).x);
// XXX: prevent the connection from being thicker than the node
- //if (th > 2 * r0) th = 2 * r0;
-
- float t = 0.5 * th;
+ //if (th > r0) th = r0;
// XXX: prevent the middle of the connection from being
// thicker than the start by adjusting the "tangent"
// angle if necessary
- float aw = asin(t / r0);
+ float aw = asin(th / r0);
if (a < aw) a = aw;
// XXX: prevent negative stretching by adjusting the "tangent"
// angle, if necessary
- float r2 = (d*d+t*t-r0*r0) / (2*r0 - 2*t);
- float at = asin((t + r2) / (r0 + r2));
+ float r2 = (d*d + th*th - r0*r0) / (2*r0 - 2*th);
+ float at = asin((th + r2) / (r0 + r2));
if (a > at) a = at;
// XXX: interpolate the "tangent" angle to zero from the point of
@@ -1082,7 +1080,7 @@
// Add the vertices of the diced midsections of the connectors
for (i = 0; i < N; i++) {
- float t = 0.5 * conns[i]->c.t;
+ float t = conns[i]->c.t;
float d = conns[i]->c.d;
ZVec ref = t0.transform(ZVec(0,0,1)) - t0.transform(ZVec(0,0,0));
Index: libvob/vob/demo/multifil/stretching.py
diff -u libvob/vob/demo/multifil/stretching.py:1.4
libvob/vob/demo/multifil/stretching.py:1.5
--- libvob/vob/demo/multifil/stretching.py:1.4 Sun Jun 29 07:22:07 2003
+++ libvob/vob/demo/multifil/stretching.py Sat Jul 5 09:13:03 2003
@@ -38,6 +38,7 @@
self.key = KeyPresses(
self,
SlideLin("x", 0, 20, "x", "Left", "Right"),
+ SlideLin("y", 0, 20, "y", "Down", "Up"),
SlideLin("angle", .15, .05, "angle scaling constant", "+", "-"),
*light3d.commonkeys
)
@@ -50,6 +51,7 @@
#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, 1, 1, 0);
+ thick = vs.coords.rational1D22(0, 4 * self.thick, self.thick, 0, 4, 1,
1);
angle = vs.coords.rational1D22(0, self.angle, 0, 0, 1, 0, 0);
angle = vs.coords.rational1D22(0, 1, 0, self.angle, 0, 1, 0);
vs.matcher.add(thick, "Thi2")
@@ -60,7 +62,7 @@
a = [vs.orthoBoxCS(0, "A%s" % i, 0, 100, 100+100*i,
1, 1, self.size, self.size)
for i in range(0, N)]
- b = [vs.orthoBoxCS(0, "B%s" % i, 800, 150+50*i+self.x, 100+100*i,
+ b = [vs.orthoBoxCS(0, "B%s" % i, self.y, 150+50*i+self.x, 100+100*i,
1, 1, self.size, self.size)
for i in range(0, N)]
Index: libvob/vob/fillet/light3d.py
diff -u libvob/vob/fillet/light3d.py:1.30 libvob/vob/fillet/light3d.py:1.31
--- libvob/vob/fillet/light3d.py:1.30 Fri Jul 4 09:57:31 2003
+++ libvob/vob/fillet/light3d.py Sat Jul 5 09:13:03 2003
@@ -286,7 +286,7 @@
conns3dblend = GLRen.createFillet3DBlend(self.dice, self.dicelen,
self.tblsize, self.mode);
- thick = vs.coords.rational1D22(0, self.thick, 0, 0, 1, 1, 0);
+ thick = vs.coords.rational1D22(0, .5 * self.thick, 0, 0, 1, 1, 0);
angle = vs.coords.rational1D22(0, self.angle, 0, 0, 1, 0, 0);
vs.matcher.add(thick, "Thi")
vs.matcher.add(angle, "Ang")