package OCADml
Library
Module
Module type
Parameter
Class
Class type
Configuration module for declaring how extrusions from 2d to 3d via sweep
should be capped off.
Offset diameter d
(positive or negative), and corresponding vertical step z
(enforced positive only when consumed).
A list of offset
describing a 3d end-cap extrusion roundover. Abstracted to enforce use of constructors.
type holes = [
| `Same
(*Offset
*)d
andz
values from outer are copied.| `Flip
(*Offset
*)d
andz
values from outer are copied, butd
sign is flipped.| `Spec of offsets
(*Supplies a different set of offsets for the holes. Note that this should have the same
*)z
values, or else the roundover mesh will not be well formed.| `Mix of [ `Same | `Flip | `Spec of offsets ] list
]
Specifies how holes in the end-cap 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.
Specifies whether an end of the extrusion should be left `Empty
, sealed with a `Flat
face, or `Round
ed over with a given offset specification.
val chamf :
?angle:float ->
?cut:float ->
?width:float ->
?height:float ->
unit ->
offsets
chamf ?angle ?cut ?width ?height ()
Create offsets that will produce a chamfer roundover. One of cut
(amount of corner "cut off"), width
(horizontal distance of chamfer), or height
(vertical distance of chamfer) can be specified to be used in conjunction with angle
(default = pi / 4), or width
and height
can be provided together, in which case angle
is not used.
val circ : ?fn:int -> [< `Cut of float | `Radius of float ] -> offsets
circ ?fn roundover
Create offsets that will produce a circular roundover, according to either a given `Cut
distance, or a `Radius
, over fn
steps (default 16).
val tear : ?fn:int -> [< `Cut of float | `Radius of float ] -> offsets
tear ?fn roundover
Create offsets that will produce a teardrop rounover (circular, endind in a chamfer).
val bez :
?curv:float ->
?fn:int ->
[< `Cut of float | `Joint of float ] ->
offsets
bez ?curv ?fn spec
Create offsets that will produce a smooth bezier roundover. The amplitude of the curve can be given by `Cut
(amount of corner "cut off"), or `Joint
(distance vertically the bezier covers). curv
is the curvature smoothness parameter, ranging from gradual 0.
, to abrupt 1.
(default 0.5
).
offsets offsets
Sanitize (enforce positive and increasing z
values) and pack a list of offset
.
val round : ?mode:offset_mode -> ?holes:holes -> offsets -> [> `Round of poly ]
round ?mode ?holes offsets
Construct a roundover poly_spec
. mode
specifies the kind offset (see Path2.offset
) performed on the paths on each "vertical" step of the roundover. Roundover behaviour for inner paths are specified with holes
. This defaults to `Flip
, as for the more common positive roundovers (flaring inward), using `Same
polarity would lead to "pinching off" of the holes.
looped
Looped
, indicating that the top should loop around to the bottom of a sweep.
capped ~top ~bot
Construct a Cap.t
specifying how the top
and bot
caps of a sweep extrusion should be sealed off (or not).