1lib: a hierarchical module namespace for the standard library
2=============================================================
3Curv is meant to have a large standard library that provides a rich set
4of primitives for constructing shapes. The new `lib` feature allows these
5primitives to be organized into a hierarchical module namespace, with modules
6that are only loaded into memory on first reference.
7
8Currently defined library modules:
9* lib.web_colour : defines all of the standard CSS colour names
10
11Here is how you can use lib.web_colour:
12
13    lib.web_colour.peach_puff
14
15    let
16        include lib.web_colour;
17    in
18        peach_puff
19
20    let
21        wc = lib.web_colour;
22    in
23        wc.peach_puff
24
25The source code for library modules is found in lib/curv, and these files
26are installed in /usr/local/lib/curv by `make install`.
27
28Here are some ideas for new library modules.
29
30blend
31    A richer set of blending primitives, pulled from multiple sources.
32    @gsohler is working on a pull request to add the Mercury blend primitives
33    from http://mercury.sexy/hg_sdf/
34noise
35    Math functions that hash their arguments to generate pseudo-random numbers
36    that represent different kinds of visual noise patterns. Eg,
37    * white noise (uniformly distributed random numbers).
38    * value noise.
39    * gradient noise.
40    * fractal noise (fractal brownian motion). Useful for smoke, clouds,
41      mountains, procedural textures.
42    * cellular noise, aka Worley noise, aka Voronoi noise.
43    This is a foundation for other library modules, such as fractal and texture.
44    Resources:
45    * http://github.com/ashima/webgl-noise
46    * https://gist.github.com/patriciogonzalezvivo/670c22f3966e662d2f83
47    * https://www.shadertoy.com/results?query=tag%3Dnoise
48fractal
49    Primitives for making fractals, perhaps based on Mandelbulber
50    and the example code in Fragmentarium.
51texture
52    Primitives for making 2D and 3D procedural textures.
53sculpt
54    Engraving & embossing primitives. Modify or deform the surface of an object,
55    in order to apply a decorative pattern.
56lattice
57    Regular lattices, like cubic and tetrahedron/octahedron.
58    Individually construct the vertices, edges and faces of such lattices.
59    A "Voronoi" lattice based on cellular noise.
60polyhedron
61    Construct regular polyhedra, such as platonic, archimedean, catalan,
62    and their derivatives.
63    Individually construct the vertices, edges and faces of such polyhedra.
64    * Investigate Knighty's "fold and cut polyhedra" technique.
65      Example GLSL code can be found in Fragmentarium.
66      I've tried it in Curv and it works.
67      See also: https://syntopia.github.io/Polytopia/polytopes.html
68    * Is the Wythoff Construction relevant?
69      See: https://en.wikipedia.org/wiki/Wythoff_construction
70    Transform polyhedra into new polyhedra using Conway polyhedron notation.
71symmetry (repetition & space folding)
72    Eg, the Mercury space folding operators from http://mercury.sexy/hg_sdf/
73    There might be overlap with the lattice and polyhedron modules:
74    consider if APIs should be be integrated.
75
76Additional resources:
77Look at the examples in Fragmentarium, or perhaps shadertoy.com, and recreate
78interesting models using high level library primitives, inventing new
79primitives as necessary.
80