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

SCM Repository

[diderot] Diff of /branches/pure-cfg/test/iso2d.diderot
ViewVC logotype

Diff of /branches/pure-cfg/test/iso2d.diderot

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

revision 994, Wed Apr 27 13:40:40 2011 UTC revision 995, Wed Apr 27 17:05:41 2011 UTC
# Line 5  Line 5 
5  // step of Newton-Raphson.  // step of Newton-Raphson.
6  //  //
7  // Process output with:  // Process output with:
8  // unu jhisto -i mip.txt -b 512 512 -min 0 0 -max 63 63 | 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 = 100;  int gridSize = 300;
11  real isoval = 30.0;  image(2)[] img = load("../data/ddro-80.nrrd");
 image(2)[] img = load("../data/ddro-64-unit.nrrd");  
12  field#1(2)[] F = img ⊛ ctmr;  field#1(2)[] F = img ⊛ ctmr;
13  int stepsMax = 10;  int stepsMax = 10;
14  real epsilon = 0.001;  real epsilon = 0.0001;
15    
16  strand sample (int ui, int vi) {  strand sample (int ui, int vi) {
17      output vec2 pos = [lerp(1.0, 62.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),
18                         lerp(1.0, 62.0, -0.5, real(vi), real(gridSize)-0.5)];                         lerp(0.0, 1.0, -0.5, real(vi), real(gridSize)-0.5)];
19        // set the isvalue to 50, 30, or 10, depending on whichever we're closest to
20        real isoval = 50.0 if F(pos) >= 40.0 else 30.0 if F(pos) >= 20.0 else 10.0;
21      int steps = 0;      int steps = 0;
22      update {      update {
23          // 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.

Legend:
Removed from v.994  
changed lines
  Added in v.995

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