Module Solid

type pattern =
  1. | Plain
  2. | Checker of int * float
  3. | Marble of int * float
  4. | Wood of int * float
  5. | Solid_function of Vec3.t -> int
  6. | Uv_function of u:float -> v:float -> int
type surface = {
  1. color : int;
  2. pattern : pattern;
  3. material : Material.t;
}
val color_at : surface -> Vec3.t -> int
type primitive =
  1. | Ball
  2. | Cube
  3. | Cylinder
  4. | Cone
  5. | Torus of float
  6. | Half_space
type t =
  1. | Sphere of Vec3.t * float * surface
  2. | Plane of Vec3.t * float * surface
  3. | Triangle of {
    1. points : Vec3.t * Vec3.t * Vec3.t;
    2. normals : Vec3.t * Vec3.t * Vec3.t;
    3. uvs : (float * float) * (float * float) * (float * float);
    4. surface : surface;
    }
  4. | Placed of {
    1. primitive : primitive;
    2. transform : Transform.t;
    3. surface : surface;
    }
  5. | Csg of Csg.op * t * t
val csg : Csg.op -> t -> t -> t
val surface : t -> surface
val color : t -> Ray.t -> float -> int
val intervals : Ray.t -> t -> t Csg.interval list
val first_hit : ?min_t:float -> Ray.t -> t -> t Csg.boundary option
val hit : ?min_t:float -> Ray.t -> t -> float option
val normal : t -> Ray.t -> float -> Vec3.t
val contains : t -> Vec3.t -> bool
val bounds : t -> (Vec3.t * Vec3.t) option
val move : Vec3.t -> t -> t
val transform : Transform.t -> t -> t