package OSCADml

  1. Overview
  2. Docs
OCaml DSL for 3D solid modelling in OpenSCAD

Install

Dune Dependency

Authors

Maintainers

Sources

OSCADml-0.2.2.tbz
sha256=8c0eeb5055dd16bb0f9b25b4d21d5312c431969fd0871fc045df2f93147ae39a
sha512=b28bd304ef3196193ba6fe33f51f0f1e2c6bb3cd41c47335a513d9fb4b1f5eca8bcbabcf8683d9b35e3cbd4f3dabe2c7bcc8f5c4b087f96a7ac70117fc4babfa

doc/rounded_text.html

Rounded text extrusion

open OCADml
open OSCADml

Generate a list of Poly2.t spelling out Hello World!. At the moment, PolyText.text is not as flexible and feature rich as Scad.text (OpenSCADs text shape function), but this gives up point representations that be can work with directly.

let hello = PolyText.text ~center:true ~fn:5 ~size:5. ~font:"Ubuntu" "Hello!"

Circular roundovers with fn steps, specified by a distance to be `Cut off of the corners. You can expect some finickiness with applying roundovers to the polygons produced by PolyText.text, as the paths coming from Cairo may have some points quite close together, and sharp corners, leading to illegal paths when further roundover operations are applied.

let caps =
  let spec = Mesh.Cap.(round ~mode:Delta @@ circ ~fn:5 (`Cut 0.025)) in
  Mesh.Cap.capped ~top:spec ~bot:spec

Map over the character polys in hello with a rounded extrusion funcion specified by caps, and convert into Scad.ts that we can union to create our final model.

let extruder poly = Scad.of_mesh @@ Mesh.extrude ~caps ~height:0.5 poly
let () = List.map extruder hello |> Scad.union |> Scad.to_file "rounded_text.scad"

OCaml

Innovation. Community. Security.