…a tool for reproducible science.
Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do. —Donald Knuth (Literate Programming, 1984)
v = translate(v, center);
return ssub(
rounded(box(v, v3(20, 20, 20)), 5),
sphere(v, 25),
5
);
add(
sadd(
sub(
rounded(box(v, v3(5, 28, 38)), 1),
rounded(box(v, v3(6, 26, 36)), 1)
),
cylinder(translate(v, v3(0,0,-45)), 5, 12),
1
),
sintersect(
box(v, v3(5, 28, 38)),
add(
add(
box(rotate_x(v, angle), v3(10, width, 100)),
box(rotate_x(v, -angle), v3(10, width, 100))
),
add(
add(
add(
box(rotate_x(translate(v, v3(0,0,25)), angle), v3(10, width, 100)),
box(rotate_x(translate(v, v3(0,0,25)), -angle), v3(10, width, 100))
),
add(
box(rotate_x(translate(v, v3(0,0,-25)), angle), v3(10, width, 100)),
box(rotate_x(translate(v, v3(0,0,-25)), -angle), v3(10, width, 100))
)
),
add(
add(
box(rotate_x(translate(v, v3(0,0,50)), angle), v3(10, width, 100)),
box(rotate_x(translate(v, v3(0,0,50)), -angle), v3(10, width, 100))
),
add(
box(rotate_x(translate(v, v3(0,0,-50)), angle), v3(10, width, 100)),
box(rotate_x(translate(v, v3(0,0,-50)), -angle), v3(10, width, 100))
)
)
)
),
2
)
);
Color \(C\) along ray \(r\) with length \(L\) with absorption \(\mu\): \[C(r) = \int_0^L c(x) \mu(x) \exp\left(-\int_0^x \mu(t) dt\right) dx\]
Simplified for speed: \[C(r) = \sum_{i=0}^N C(i \Delta x) \alpha (i \Delta x) \prod_{j=0}^{i-1} \left(1 - \alpha(j\Delta x)\right)\]
\(n_\text{shear} = 2 D u \hat{u} - 2\left(u^T D u \hat{u} \right) \hat{u}\)