package OCADml

  1. Overview
  2. Docs

Rounded prism configuration module.

type spec = {
  1. k : float;
    (*

    default curvature used if specific curvatures are None

    *)
  2. k_bot : float option;
    (*

    curvature smoothness of bottom edges

    *)
  3. k_top : float option;
    (*

    curvature smoothness of bottom top

    *)
  4. k_sides : [ `Flat of float | `Mix of float list ] option;
    (*

    smoothness to be applied flatly to all side edges, or a list specifying a smoothness for each edge (must be same length as corresponding paths)

    *)
  5. joint_bot : float * float;
    (*

    pair of inwards (into bottom face) and upwards (towards top) joint distances

    *)
  6. joint_top : float * float;
    (*

    pair of inwards (into top face) and downwards (towards bottom) joint distances

    *)
  7. joint_sides : [ `Flat of float * float | `Mix of (float * float) list ];
    (*

    pair of backwards and forwards joint distances to be applied flatly to all side edges, or a list specifying joints for each edge (must be same length as corresponding paths)

    *)
}

Rounded prism joint and curvature specification.

In general, joint_ parameters are pairs determine the distance away from the edge that curvature begins, and k parameters set the smoothness of the curvature.

type holes = [
  1. | `Same
    (*

    the outer path spec should be used for the holes

    *)
  2. | `Flip
    (*

    the outer path spec should be used for the holes, but with the top and bottom inward joint directions flipped (see flip)

    *)
  3. | `Spec of spec
    (*

    one spec to use for all holes

    *)
  4. | `Mix of [ `Spec of spec | `Flip | `Same ] list
]

Specifies how holes in the prism should be treated, either relative to the outer shape, or independantly. When multiple holes are present, `Mix allows each one to be specified separately, to treat all the same, use the other variants directly. Defaults to `Flip for the prism and linear_prism functions.

val flip : spec -> spec

flip spec

Negate the top and bottom inwards joints (firsts of the joint_bot and joint_top pairs) of caps. These values govern whether the roundover flare inwards (positive when shape is CCW) or outwards (negative when shape is CCW). Since holes (inner paths) have reverse winding compared the outer path, you'll often want to use opposite polarity inward joints.

val spec : ?k:float -> ?k_bot:float -> ?k_top:float -> ?k_sides:[ `Flat of float | `Mix of float list ] -> ?joint_bot:(float * float) -> ?joint_top:(float * float) -> ?joint_sides:[ `Flat of float * float | `Mix of (float * float) list ] -> unit -> spec

spec ?k ?k_bot ?k_top ?k_sides ?joint_bot ?joint_top ?joint_sides ()

Construct a spec with joint distances set to 0. by default (no rounding), and a default curvature smoothess k = 0.5.

OCaml

Innovation. Community. Security.