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

SCM Repository

[diderot] View of /branches/charisee/ertest/vispaper/viso3d/resamp-cnm.diderot
ViewVC logotype

View of /branches/charisee/ertest/vispaper/viso3d/resamp-cnm.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2908 - (download) (annotate)
Mon Mar 2 21:10:23 2015 UTC (4 years, 7 months ago) by glk
File size: 934 byte(s)
further work on isolating issues
/*

To run:

../../../bin/diderotc resamp-cnm.diderot \
 && ./resamp-cnm \
 && unu reshape -i resamp-cnm.txt -s 30 30 30 | \
    unu minmax -


unu minmax should report min, max values that are both ~= 1.0

*/

int sz0 = 30;
int sz1 = 30;
int sz2 = 30;
real width = 2;
vec3 spc = [width/(sz0-1), width/(sz1-1), width/(sz2-1)];

vec3 pp = [0.0,0.0,0.0];
vec3 xdir = [spc[0], 0.0, 0.0];
vec3 ydir = [0.0, spc[1], 0.0];
vec3 zdir = [0.0, 0.0, spc[2]];
vec3 orig = -(xdir*(sz0-1) + ydir*(sz1-1) + zdir*(sz2-1))/2;

field#2(3)[3] V= bspln3 ⊛ load("helix0.nrrd");

strand sample(int xi, int yi, int zi) {
  output real vv = 0;
  update {
    vec3 p  = orig + xi*xdir + yi*ydir + zi*zdir;
    vec3 crl = ∇×V(p);
    //vec3 crl = V(p); // this, however, can be correctly normalized
    vec3 crln = crl/|crl|;
    vv = |crln|;
    stabilize;
  }
}
initially [ sample(xi, yi, zi) | zi in 0..(sz2-1), yi in 0..(sz1-1), xi in 0..(sz0-1) ];

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