Module OManifold.Sdf2

2d signed-distance functions (extrudable to 3d)

type t = OCADml.v2 -> float

Shapes

val circle : float -> t
val square : ?round:float -> OCADml.v2 -> t
val rounded_box : ?tl:float -> ?tr:float -> ?bl:float -> ?br:float -> OCADml.v2 -> t
val rhombus : ?round:float -> OCADml.v2 -> t

Transformations

val translate : OCADml.v2 -> t -> t
val xtrans : float -> t -> t
val ytrans : float -> t -> t
val rotate : ?about:OCADml.v2 -> float -> t -> t
val zrot : ?about:OCADml.v2 -> float -> t -> t
val scale : float -> t -> t
val round : float -> t -> t
val onion : float -> t -> t
val elongate : OCADml.v2 -> t -> t

elongate h

Elongate the 2d sdf t by the xy distance vector h. Basically, the field is split and moved apart by h in each dimension and connected.

2d to 3d

val extrude : height:float -> t -> Sdf3.t

extrude ~height t

Extrude the 2d signed distance field t into a 3d field extending height /. 2. above and below the xy plane.

val revolve : ?offset:float -> t -> Sdf3.t

revolve ?offset t

Revolve the 2d signed distance field t around the y-axis. If provided offset translates t in x beforehand.