sandbox/Antoonvh/minbwatch.c

    All bwatch sketch functions

    A minimal example

    A minimal example

    Photo by Kitty Kono via Flickr.

    #include "grid/octree.h"
    #include "bwatch.h"
    
    scalar dummy[], s[], f[], f2[];
    
    int main() {
      X0 = Y0 = Z0 = -L0/2.01;
      init_grid (32);
     foreach() 
        s[] = cube(x) + y + z;
      boundary ({s});
      fraction (f , (0.2  - sqrt((sq(x/1.2 - 0.15) + sq(y + 0.15) + sq(z - 0.15)))));
      fraction (f2, (0.15 - sqrt((sq(x + 0.3) + sq(y/1.1) + sq(z - 0.25)))));
      restriction ({f, f2});
      system ("wget -q \
    https://live.staticflickr.com/7894/45505956245_f24c178bed_b.jpg");
    
      watch (fov = 1.5, O = {-0.5, 0.2, 0}, poi = {0.05, 0.1, 0}, nx = 1000, ny = 900);
      
      image ("45505956245_f24c178bed_b.jpg",
    	 alpha = -0.2, res = 650, mat = {dull = true});
      sphere(5, mat = {dull = true});
      equiplane(f, vof = true, mat = {ind = 1.3});
      sketch_vof (f2, true);
      equiplane (s, -0.6);
      quadriangles (s, n = {1,0,0}, alpha = 0.49, mat = {map = cool_warm, linear = true});
      lattice (alpha = -0.2, width = 0.0025);
      disk (0.4, {0.3, 0.4, 0}, {-1., -1., 1.});
      sphere (C = {-0.0, 0.25, .0}, R = 0.12, mat = {s = s, linear = true, R = 0.2});
      sphere (R = 0.15, C = {-0.35, 0.45, 0.4}, mat = {T = 0.5});
      store (fopen ("min.ppm", "w"));
      plain();
      system ("convert min.ppm -resize 80% min.png"); //some MSAA
    }