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

SCM Repository

[diderot] View of /tests/vis15-bugs/pbfs1.diderot
ViewVC logotype

View of /tests/vis15-bugs/pbfs1.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5149 - (download) (annotate)
Fri Jul 21 17:11:49 2017 UTC (2 years, 1 month ago) by jhr
File size: 749 byte(s)
  simplifying bug example
#version 1

image(3)[] img = image("pbfs-vol.nrrd");

field#2(3)[] F = bspln3 ⊛ clamp(img);

vec3 cent = [0,0,0];
int sz = 10;
real width = 2;

function bool featureLost(vec3 x) {
  if (!inside(x, F)) { return true; }
  return F(x) < 10;
}

strand point (vec3 pos0)
{
  output real out = -1.0;
  vec3 pos = pos0;

  update {
    // can't proceed if outside field or have zero gradient
    if (featureLost(pos)) { die; }
    out = F (pos);
    stabilize;
  }

}

initially { point([cent[0] + width*lerp(-1, 1, 0, ii, sz-1)/2,
                   cent[1] + width*lerp(-1, 1, 0, jj, sz-1)/2,
                   cent[2] + width*lerp(-1, 1, 0, kk, sz-1)/2])
            | ii in 0 .. sz-1,
              jj in 0 .. sz-1,
              kk in 0 .. sz-1 };

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