field#1(2)[] F = c4hexic ⊛ image("hand.nrrd"); input vec2 cent = [0,0]; input real hght = 2; input int size0 = 6; input int size1 = 4; input int pad = 0; real wdth = hght*size0/size1; vec2 spc = [wdth/(size0-1), hght/(size1-1)]; vec2 dir0 = [spc[0], 0.0]; vec2 dir1 = [0.0, spc[1]]; vec2 orig = cent - (dir0*(size0-1) + dir1*(size1-1))/2.0; vec2 porig = orig - pad*(dir0 + dir1); int psize0 = size0 + 2*pad; int psize1 = size1 + 2*pad; input int stepsMax = 10; real epsilon = 0.0001; input int prune = 10; strand isod(int ID, int ui, int vi) { output vec2 x = porig + ui*dir0 + vi*dir1; int steps = 0; update { if ( (ID/prune)*prune != ID ) { die; } if (0 == steps && 0 == ui && 0 == vi) { vec2 imin = orig - (dir0 + dir1)*0.5; vec2 imax = orig + dir0*(size0-0.5) + dir1*(size1-0.5); print(imin[0], " ", imin[1], " ", imax[0], " ", imax[1], "\n"); } // Stop if we're no longer inside or taken too many steps. if (!inside(x, F) || steps > stepsMax) { die; } // subsequent expressions are undefined if |∇F| is zero if (|∇F(x)| == 0.0) die; // the Newton-Raphson step vec2 delta = normalize(∇F(x)) * F(x)/|∇F(x)|; // we've converged if the change is small enough if (|delta| < epsilon) stabilize; x -= delta; steps += 1; } } collection { isod(ui + size0*vi, ui, vi) | vi in 0..(psize1-1), ui in 0..(psize0-1) }
Click to toggle
does not end with </html> tag
does not end with </body> tag
The output has ended thus: llection { isod(ui + size0*vi, ui, vi) | vi in 0..(psize1-1), ui in 0..(psize0-1) }