Code

bug fix (was broken since 2geom sbasis refactor).
authorjfbarraud <jfbarraud@users.sourceforge.net>
Fri, 20 Mar 2009 22:15:13 +0000 (22:15 +0000)
committerjfbarraud <jfbarraud@users.sourceforge.net>
Fri, 20 Mar 2009 22:15:13 +0000 (22:15 +0000)
src/live_effects/lpe-sketch.cpp

index 97bd8a49df709384b2c7d0f38729de8c8f6e1d2e..22c758d1035057539c53ddd2931696d74b0ba6eb 100644 (file)
@@ -151,16 +151,17 @@ LPESketch::computePerturbation (double s0, double s1){
     //compute howmany deg 3 sbasis to concat according to frequency.
     unsigned count = unsigned((s1-s0)/strokelength*tremble_frequency)+1; 
     for (unsigned i=0; i<count; i++){
-        D2<SBasis> perturb = D2<SBasis>(SBasis(2*count, Linear()), SBasis(2*count, Linear()));
+        D2<SBasis> perturb = D2<SBasis>(SBasis(2, Linear()), SBasis(2, Linear()));
         for (unsigned dim=0; dim<2; dim++){
             B[dim] = offset[dim] + 2*tremble_size-tremble_size.get_value();
-            perturb[dim][2*i] = Linear(A[dim],B[dim]);
+            perturb[dim][0] = Linear(A[dim],B[dim]);
             dA[dim] = dA[dim]-B[dim]+A[dim];
-            dB[dim] = 2*tremble_size-tremble_size.get_value();
-            perturb[dim][2*i+1] = Linear(dA[dim],dB[dim]);
+            dB[dim] = -(2*tremble_size-tremble_size.get_value())-B[dim]+A[dim];
+            perturb[dim][1] = Linear(dA[dim],dB[dim]);
         }
-        A = B;
         dA = B-A-dB;
+        A = B;
+        //dA = B-A-dB;
         res.concat(Piecewise<D2<SBasis> >(perturb));
     }
     res.setDomain(Interval(s0,s0+count*strokelength/tremble_frequency));