Module Dometyl.Wall

module Steps : sig ... end

Configuration type for number of steps used to draw the bezier curves that form the walls.

module Drawer : sig ... end

Type providing a means to obtain the path from a particular point on the originating face of a wall and the ground.

type config = {
  1. d1 : [ `Abs of float | `Rel of float ] option;
  2. d2 : float option;
  3. clearance : float option;
  4. n_steps : Steps.t option;
  5. min_step_dist : float option;
  6. scale : OCADml.V2.t option;
  7. scale_ez : (OCADml.V2.t * OCADml.V2.t) option;
  8. end_z : float option;
}
val default : config
type t = {
  1. scad : OSCADml.Scad.d3;
    (*

    Aggregate scad, including screw outshoot if included

    *)
  2. key : Key.t;
  3. side : [ `North | `East | `South | `West ];
  4. start : Points.t;
    (*

    Corner points of the Key.Face.t this wall emerged from

    *)
  5. cleared : Points.t;
    (*

    Corner points of the swung (vertical) and cleared start face

    *)
  6. foot : Points.t;
    (*

    Terminal points where the wall meets the XY plane.

    *)
  7. drawer : Drawer.t;
    (*

    Generate Path3.ts emerging from a point on the start face that follow along the same sweeping transforms as the wall.

    *)
  8. bounds_drawer : Drawer.t;
    (*

    Same as drawer, but operating within the unrounded bounding corners of the face instead.

    *)
}

Record representing a wall extending from a Key.Face.t to the ground.

val translate : OCADml.V3.t -> t -> t
val xtrans : float -> t -> t
val ytrans : float -> t -> t
val ztrans : float -> t -> t
val rotate : ?about:OCADml.V3.t -> OCADml.V3.t -> t -> t
val xrot : ?about:OCADml.V3.t -> float -> t -> t
val yrot : ?about:OCADml.V3.t -> float -> t -> t
val zrot : ?about:OCADml.V3.t -> float -> t -> t
val axis_rotate : ?about:OCADml.V3.t -> OCADml.V3.t -> float -> t -> t
val quaternion : ?about:OCADml.V3.t -> OCADml.Quaternion.t -> t -> t
val scale : OCADml.V3.t -> t -> t
val xscale : float -> t -> t
val yscale : float -> t -> t
val zscale : float -> t -> t
val mirror : OCADml.V3.t -> t -> t
val affine : OCADml.Affine3.t -> t -> t
val swing_face : Key.Face.t -> Key.Face.t

swing_face face

Find a rotation around faces bottom or top axis, depending on which way it is pointing in z (determined by face.normal), that brings face to a more vertical orientation, returning a pivoted Key.Face.t.

val make : ?clearance:float -> ?n_steps:[< `Flat of int | `PerZ of float Flat ] -> ?min_step_dist:float -> ?d1:[ `Abs of float | `Rel of float ] -> ?d2:float -> ?scale:OCADml.V2.t -> ?scale_ez:(OCADml.V2.t * OCADml.V2.t) -> ?end_z:float -> [ `East | `North | `South | `West ] -> Key.t -> t

make side keyhole

Generate a t using an OpenScad polyhedron, drawn from a set of bezier curves from the side facing edges of keyhole. Optional parameters influence the shape of the generated wall:

  • clearance moves the start of the wall out from the face of the keyhole
  • n_steps controls the number of points used to draw the wall (see: Steps). This impact the aeshetics of the wall, but it also determines how well the wall follows the bezier curve, which can have implications for positioning the cutouts for ports near the bottom of the case. A number of steps that is too high can sometimes cause the generated polyhedrons to fail, as points can bunch up, leading to a mesh with intersecting faces that will cause the OpenScad engine (CGAL) to fail. When this happens, either decreasing number of steps (can be done preferentially for short walls with `PerZ), or increasing d1 which will spread out the points at the beginning of the sweep (which is typically the most problematic) may help.
  • min_step_dist sets the minimum distance that each profile (step) of the walls sweep must be away from the previous. To avoid self intersecting meshes, any steps that are closer than this minimum will be skipped.
  • d1 and d2 set the distance projected outward along the orthogonal of the side of the keyhole on the xy-plane used to for the second and third quadratic bezier control points respectively.
  • scale specifies width (x), and thickness (y) scaling to apply along the sweep of the projected wall (linearly, or easing according to scale_ez)
  • end_z specifies the height above the xy plane the bezier sweep portion of the wall should end (from there dropping straight down to lie flat on the plane)
val of_config : config -> [ `East | `North | `South | `West ] -> Key.t -> t

of_config conf side key

Same as make, but parameters are passed via the config type.

val start_direction : t -> OCADml.V3.t

start_direction t

Direction vector from right to left of the wall start points.

val foot_direction : t -> OCADml.V3.t

foot_direction t

Direction vector from right to left of the wall foot points.

val to_scad : t -> OSCADml.Scad.d3