Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/vis12/bugs/open/bug024.diderot
ViewVC logotype

View of /branches/vis12/bugs/open/bug024.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2334 - (download) (annotate)
Thu Apr 4 16:15:56 2013 UTC (8 years, 6 months ago) by glk
File size: 1550 byte(s)
more bugs
vec2 {} x0s = load("../data/seeds.txt");
int x0num = length(x0s);
real h = 0.02;
int stepNum = 130;
input real arrow = 0.4;

field#1(2)[2] V = bspln3 ⊛ image("../data/flow.nrrd");
field#1(2)[2] ins = bspln3 ⊛ image("../data/flow-crop.nrrd");

strand sline (int ii, vec2 x0) {
  int step = 0;
  vec2 xf = x0;
/*
  vec2 b1 = x0; // BUG: had to make these strand varialbes; couldn't be local to stabilize
  vec2 b2 = x0;
*/
  output vec2{} path = {x0};
    vec2 aa = [0,0];
    vec2 bb = [0,0];

  update {
    if (inside(xf, ins))
      xf += h*V(xf + 0.5*h*V(xf));
    if (inside(xf, ins))
      path = path @ xf;
    step += 1;
    if (step == stepNum) {
      vec2 f = arrow*V(xf);
      vec2 p = 0.4*[-f[1],f[0]];
      /* BUG:  can't append an expression to a sequence:
bug024.c:460:66: error: address expression must be an lvalue or a function designator
                Diderot_DynSeqAppend(sizeof(vec2f_t), l_path_99, &(l__t_152+l_p_151)),...
                                                                 ^ ~~~~~~~~~~~~~~~~
     */
      path = path @ (xf - f + p);
      path = path @ (xf - f - p);
      path = path @ xf;
      /* and BUG: try making local variables for these, as with:
      vec2 aa = (xf - f + p);
      vec2 bb = (xf - f - p);
      path = path @ aa;
      path = path @ bb;
      path = path @ xf;
      that won't work either.  Nor can you make aa and bb local to update.
      It only works if aa and bb are strand variables */
      stabilize;
    }
  }
}

initially [ sline(ii, x0s{ii}) | ii in 0..x0num-1 ];

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0