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

SCM Repository

[diderot] Diff of /trunk/test/iso2d.diderot
ViewVC logotype

Diff of /trunk/test/iso2d.diderot

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1131, Thu May 5 18:53:48 2011 UTC revision 1134, Thu May 5 19:42:35 2011 UTC
# Line 8  Line 8 
8  // unu jhisto -i mip.txt -b 512 512 -min 0 0 -max 1 1 | unu 2op neq - 0 | unu quantize -b 8  -o iso2d.png  // unu jhisto -i mip.txt -b 512 512 -min 0 0 -max 1 1 | unu 2op neq - 0 | unu quantize -b 8  -o iso2d.png
9    
10  int gridSize = 300;  int gridSize = 300;
11  field#1(2)[] F = load("../data/ddro-80.nrrd") ⊛ ctmr;  field#1(2)[] F = ctmr ⊛ load("../data/ddro-80.nrrd");
12  int stepsMax = 10;  int stepsMax = 10;
13  real epsilon = 0.0001;  real epsilon = 0.0001;
14    
# Line 16  Line 16 
16      output vec2 pos = [lerp(0.0, 1.0, -0.5, real(ui), real(gridSize)-0.5),      output vec2 pos = [lerp(0.0, 1.0, -0.5, real(ui), real(gridSize)-0.5),
17                         lerp(0.0, 1.0, -0.5, real(vi), real(gridSize)-0.5)];                         lerp(0.0, 1.0, -0.5, real(vi), real(gridSize)-0.5)];
18      // set the isvalue to 50, 30, or 10, depending on whichever we're closest to      // set the isvalue to 50, 30, or 10, depending on whichever we're closest to
19      real isoval = 50.0 if F(pos) >= 40.0 else 30.0 if F(pos) >= 20.0 else 10.0;      real isoval = 50.0 if F(pos) >= 40.0
20                           else 30.0 if F(pos) >= 20.0
21                                     else 10.0;
22      int steps = 0;      int steps = 0;
23      update {      update {
24          // We bail if we're no longer inside or taken too many steps.          // We bail if we're no longer inside or taken too many steps.
         // We tag this strand result as garbage by setting it to a  
         // non-finite position; these will be filtered later.  
         // This is really what "die" is for, though (see below).  
25          if (!inside(pos, F) || steps > stepsMax) {          if (!inside(pos, F) || steps > stepsMax) {
26              die;              die;
27          }          }

Legend:
Removed from v.1131  
changed lines
  Added in v.1134

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