package OSCADml

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

Install

Dune Dependency

Authors

Maintainers

Sources

OSCADml-0.2.3.tbz
sha256=61bc12919734a42004f9f54bb03aa5403eac9cdd645cad1fb97ddd2eba148583
sha512=9aca48afeb2c89ace6b07110b6aadedac7d877fb9b0d1990b0c0b622829ff45ced3841fdae30b5b869293dea1b3ae39f1b00fc767c8e3f69d7e78f6412801ffb

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.