package scad_ml
All checked builds passInstall
dune-project
Dependency
Authors
Maintainers
Sources
sha256=2abd88cebe00d5b27266c303f8b913c26400a9796f29ccd51e4f2a7fbe83b114
sha512=303f837ae9790baff49f141b6915017985431855899f9963fb8bef168f497089077661e14b5431f77169cd1e98d5ecdb2e752ae1a9fac5a35b181ee685acf6f8
Description
Scad_ml is an OCaml front-end to the OpenSCAD CAD programming language.
Added to opam-repository:
README
OpenSCAD DSL for OCaml
Overview
This library provides an OCaml front-end to the OpenSCAD solid modelling language. All SCAD primitives and transformation functions are made available.
Notable differences from the OpenSCAD language
- Angles are represented in radians (and converted to degrees when compiling to OpenSCAD).
- The dimensional system (2D or 3D) each shape inhabits is tracked by the type system. This is used to restrict the operations that can be legally applied (e.g.
linear_extrudecan only be applied to 2D shapes) and enforcing non-mixing of 2D and 3D shapes during boolean operations.
Usage
open Scad_ml
let scad_logo =
let rad = 5.
and fn = 720 in
let cyl = Scad.cylinder ~fn ~center:true (rad /. 2.) (rad *. 2.3) in
let cross_cyl = Scad.rotate (0., Float.pi /. 2., 0.) cyl in
Scad.union
[ Scad.difference
(Scad.sphere ~fn rad)
[ cyl; cross_cyl; Scad.rotate (0., 0., Float.pi /. 2.) cross_cyl ]
; Scad.color ~alpha:0.25 Color.Magenta cross_cyl
]
let () =
let oc = open_out "/path/to/things/scad_logo.scad" in
Scad.write oc scad_logo;
close_out oc
Generated scads can then be viewed with the OpenSCAD viewer as you normally would.
Documentation
Online documentation is available here.
Companion PPX
There is a companion ppx, [@@deriving scad] for generating transformation functions for user-defined records and abstract types made up of the Scad.t and Vec3.t types provided in this library.
Authors
- Original author
- Overhaul and add many functions
License
BSL-1.0
Dev Dependencies (1)
-
odoc
with-doc
Optional Dependencies
None
Used by (1)
Conflicts
None
Build status
Results of building scad_ml with each compiler on check.ci.ocaml.org, run of against opam-repository 7cdc698. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| 1.1.0 (this version) | good | good | good | good | good |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure