Module Dometyl.Curvature

type well

Description of a keywell column (distributed along circle on the yz-plane)

type fan

Description of a fanned column (distributed along circle on the xy-plane)

type t

Column curvature to be applied to Key.t's via apply.

val well : ?tilt:float -> ?tilt_correction:(xrot:float -> tilt:float -> float) -> radius:float -> float -> well

well ?tilt ?tilt_correction ~radius angle

Describe a column of keys distributed in increments of angle radians along a circle of the given radius on the yz-plane. If provided tilt will apply a y-axis rotation to the key before the x-axis rotation of the well curvature, effectively tilting inwards. This combination of rotations creates gaps between the keys, so by default, some counter z-axis rotation is applied. The default counter transformation can be overidden by tilt_correction (function from xrot and tilt radians to the radians to rotate around the z-axis).

val fan : ?tilt:float -> radius:float -> float -> fan

fan ?tilt ~radius angle

Describe a column of keys distributed in increments of angle radians along a circle of the given radius on the xy-plane. If provided tilt will apply a y-axis rotation to the key before the z-axis rotation of the fan curvature, effectively tilting inwards.

val curve : ?well:well -> ?fan:fan -> unit -> t

curve ?well ?fan ()

Create a curvature t with an (optional) combination of well and fan curvatures (see well and fan).

val custom : (int -> Key.t -> Key.t) -> t

custom f

Create a curvature t with an arbitrary function f that transforms a Key.t to its desired placement along the column depending on the given row index.

val pre_tweak : ?well:well -> ?fan:fan -> (int -> Key.t -> Key.t) -> t

pre_tweak ?well ?fan custom

Compose a curvature t that will sequentialy apply and arbitrary function (see custom) followed by standard well/fan curve.

val post_tweak : ?well:well -> ?fan:fan -> (int -> Key.t -> Key.t) -> t

post_tweak ?well ?fan custom

Compose a curvature t that will sequentialy apply a standardy well/fan curve followed by an arbitrary function (see custom).

val mix : (int -> t) -> t

mix f

Lift a function from row index to curvature t into a t. Useful for describing a column which follows a more/less extreme curvature on either side of the central row.

val apply : centre_idx:float -> t -> int -> Key.t -> Key.t

apply ~centre_idx t idx key

Apply the column curvature t to the key at row idx, around the centre_idx of the column (given as a float, such that it can lie between rows).