[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] libvob include/vob/trans/ScalarFuncs.hxx vob/de...
From: |
Janne V. Kujala |
Subject: |
[Gzz-commits] libvob include/vob/trans/ScalarFuncs.hxx vob/de... |
Date: |
Wed, 09 Jul 2003 04:01:19 -0400 |
CVSROOT: /cvsroot/libvob
Module name: libvob
Branch:
Changes by: Janne V. Kujala <address@hidden> 03/07/09 04:01:18
Modified files:
include/vob/trans: ScalarFuncs.hxx
vob/demo/multifil: stretching.py
vob/fillet : light3d.py
Log message:
angle and thickness scaling
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/trans/ScalarFuncs.hxx.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/demo/multifil/stretching.py.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/fillet/light3d.py.diff?tr1=1.31&tr2=1.32&r1=text&r2=text
Patches:
Index: libvob/include/vob/trans/ScalarFuncs.hxx
diff -u libvob/include/vob/trans/ScalarFuncs.hxx:1.2
libvob/include/vob/trans/ScalarFuncs.hxx:1.3
--- libvob/include/vob/trans/ScalarFuncs.hxx:1.2 Wed Jun 11 13:41:56 2003
+++ libvob/include/vob/trans/ScalarFuncs.hxx Wed Jul 9 04:01:17 2003
@@ -67,6 +67,66 @@
};
VOB_PRIMITIVETRANS_DEFINED(Rational1D_2_2_Explicit, "rational1D22");
+
+
+ /** A 1-dimensional power function a x^b
+ */
+ class Power1D :
+ public PrimitiveTransform
+ {
+ public:
+ float a, b;
+ void tr(const ZPt &from, ZPt &to) const {
+ to.y = 0; to.z = 0;
+ to.x = a * pow(from.x, b);
+ }
+
+ };
+
+ class Power1D_Explicit :
+ public Power1D,
+ public ParametrizedPrimitiveTransform,
+ public NonInvertiblePrimitiveTransform {
+ public:
+ enum { NParams = 2 };
+ template<class Ptr> void setParams(Ptr p) {
+ a = p[0];
+ b = p[1];
+ }
+ };
+
+ VOB_PRIMITIVETRANS_DEFINED(Power1D_Explicit, "power1D");
+
+
+ /** A sum of 1-dimensional power functions: a x^b + c x^d
+ */
+ class Power1D_2 :
+ public PrimitiveTransform
+ {
+ public:
+ float a, b, c, d;
+ void tr(const ZPt &from, ZPt &to) const {
+ to.y = 0; to.z = 0;
+ to.x = a * pow(from.x, b) + c * pow(from.x, d);
+ }
+
+ };
+
+ class Power1D_2_Explicit :
+ public Power1D_2,
+ public ParametrizedPrimitiveTransform,
+ public NonInvertiblePrimitiveTransform {
+ public:
+ enum { NParams = 4 };
+ template<class Ptr> void setParams(Ptr p) {
+ a = p[0];
+ b = p[1];
+ c = p[2];
+ d = p[3];
+ }
+ };
+
+ VOB_PRIMITIVETRANS_DEFINED(Power1D_2_Explicit, "power1D2");
}
}
Index: libvob/vob/demo/multifil/stretching.py
diff -u libvob/vob/demo/multifil/stretching.py:1.5
libvob/vob/demo/multifil/stretching.py:1.6
--- libvob/vob/demo/multifil/stretching.py:1.5 Sat Jul 5 09:13:03 2003
+++ libvob/vob/demo/multifil/stretching.py Wed Jul 9 04:01:17 2003
@@ -39,7 +39,6 @@
self,
SlideLin("x", 0, 20, "x", "Left", "Right"),
SlideLin("y", 0, 20, "y", "Down", "Up"),
- SlideLin("angle", .15, .05, "angle scaling constant", "+", "-"),
*light3d.commonkeys
)
def scene(self, vs):
@@ -52,8 +51,14 @@
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);
+ thick = vs.coords.power1D(0, self.thick, -1/2.);
+
+ t = 1
+ m = self.thick
+ thick = vs.coords.rational1D22(0, 2*m, t*m, 0, 2, t, 1);
angle = vs.coords.rational1D22(0, 1, 0, self.angle, 0, 1, 0);
+ angle = vs.coords.rational1D22(0, 1, self.angle, 0, 1, 0, 0);
+ angle = vs.coords.power1D2(0, self.angle, 1/3., 1, -1);
vs.matcher.add(thick, "Thi2")
vs.matcher.add(angle, "Ang2")
@@ -62,7 +67,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, self.y, 150+50*i+self.x, 100+100*i,
+ b = [vs.orthoBoxCS(0, "B%s" % i, self.y, 180+80*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.31 libvob/vob/fillet/light3d.py:1.32
--- libvob/vob/fillet/light3d.py:1.31 Sat Jul 5 09:13:03 2003
+++ libvob/vob/fillet/light3d.py Wed Jul 9 04:01:18 2003
@@ -288,6 +288,10 @@
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);
+
+ thick = vs.coords.rational1D22(0, 2*self.thick, self.thick, 0, 2, 1,
1);
+ angle = vs.coords.power1D2(0, self.angle, 1/3., 1, -1);
+
vs.matcher.add(thick, "Thi")
vs.matcher.add(angle, "Ang")
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] libvob include/vob/trans/ScalarFuncs.hxx vob/de...,
Janne V. Kujala <=