/* ../../../bin/diderotc detiso3d.diderot \ && ./detiso3d \ && unu dice -i detiso3d.txt -a 0 -o ./ \ && unu jhisto -i {0,1}.nrrd -b 400 400 -min -30 -30 -max 30 30 -t float | \ unu 1op log1p | \ unu quantize -b 8 -o tmp.png \ && unu jhisto -i {1,2}.nrrd -b 400 400 -min -30 -30 -max 30 30 -t float | \ unu 1op log1p | \ unu quantize -b 8 | unu join -i tmp.png - -a 0 -o detiso3d.png \ && rm -f {0,1,2}.nrrd \ && open detiso3d.png \ && unu jhisto -i detiso3d.txt -min -31 -31 -31 -max 31 31 31 -b 120 120 120 -t float \ | unu dnorm -i - \ | unu dist -th 0.5 \ | ~/hale/demo/iso -i - */ field#2(3)[3,3] V = bspln3 ⊛ image("tball.nrrd"); field#2(3)[] F = det(V) - 0.02; //field#1(3)[] V= bspln3 ⊛ image("tball-det.nrrd"); //field#1(3)[] F = V - 0.02; int grid = 30; int stepsMax = 30; real epsilon = 0.0001; strand RootFind(real xi,real xj, real xk) { output vec3 x = [xi,xj,xk]; int steps = 0; update { // Stop if we're no longer inside or taken too many steps. if (!inside(x, V) || steps >= stepsMax) stabilize; // subsequent expressions are undefined if |∇F| is zero if (|∇F(x)| == 0.0) die; // the Newton-Raphson step vec3 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; } } initially { RootFind(lerp(-30, 30, -0.5, ui, grid-0.5), lerp(-30, 30, -0.5, vi, grid-0.5), lerp(-30, 30, -0.5, wi, grid-0.5)) | wi in 0..(grid-1), vi in 0..(grid-1), ui in 0..(grid-1) };
Click to toggle
does not end with </html> tag
does not end with </body> tag
The output has ended thus: 0, 30, -0.5, wi, grid-0.5)) | wi in 0..(grid-1), vi in 0..(grid-1), ui in 0..(grid-1) };