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

SCM Repository

[diderot] View of /tests/vis12-bugs/src/bug036.diderot
ViewVC logotype

View of /tests/vis12-bugs/src/bug036.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4640 - (download) (annotate)
Tue Sep 27 20:54:47 2016 UTC (2 years, 10 months ago) by glk
File size: 1105 byte(s)
initial result of svn export --username anonsvn --password=anonsvn https://svn.smlnj-gforge.cs.uchicago.edu/svn/diderot/branches/vis15/src/tests/
/*
bug036.c:42:24: error: duplicate member 'gv__t'
    Diderot_image2D_t *gv__t;
                       ^
bug036.c:41:24: note: previous declaration is here
    Diderot_image2D_t *gv__t;
*/

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;
  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]];
      path = path @ (xf - f + p);
      path = path @ (xf - f - p);
      path = path @ xf;
      vec2 aa = (xf - f + p);
      vec2 bb = (xf - f - p);
      path = path @ aa;
      path = bb @ path;
      path = path @ xf;
      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