Git Product home page Git Product logo

OCADml

OCADml is a collection of types and functions built on top of Gg facilitating Computer Aided Design (CAD) in OCaml. In particular, the style of design currently supported is that of 2D drawing and mesh generation via sweeping/extrusion.

Usage

  open OCADml

  let () =
    let fn = 128 in
    let base =
      let sq = Path3.square ~center:true (v2 2. 4.) in
      Path3.(roundover ~fn (Round.flat ~corner:(Round.circ (`Radius 0.5)) sq))
    and c r h = Path3.ztrans h @@ Path3.circle ~fn r in
    let cones = List.map (fun h -> [ c 0.6 h; c 0.5 (h +. 1.) ]) [ 4.; 5.; 6. ] in
    List.flatten ([ base; Path3.ztrans 2. base; c 0.5 3.; c 0.5 4. ] :: cones)
    |> Mesh.skin ~slices:(`Flat 0)
    |> Mesh.to_stl "vacuum_connector.stl"

vacuum connector

Documentation

Documentation is available online, covering the API. As this library is not associated with any CAD backend, it is a bit dry on it's own and replete of examples. To get a better idea of what can be done with the tools provided it may be helpful to check out a library utilizing them.

CAD Package Specific Frontends

This library only provides a means to generate point and face based geometries, in order to perform boolean operations and validation of properties such as manifoldness you'll need to work with a particular CAD package.

OSCADml

OManifold

Companion PPX

There is a companion ppx, [@@deriving cad] for generating transformation functions for user-defined records and abstract types made up of CAD specific types such as OSCADml's Scad.t, along with their corresponding vector (V2.t or V3.t) types (and those composed of them) provided in this library.

Inspiration

This effort began as an extension of the Scad_ml OpenSCAD DSL, but grew to the point where it seemed prudent to break out into a "backend" agnostic format so as to be more generally useful.

Module organization and implementations borrow heavily from existing libraries in the OpenSCAD community:

ocadml's Projects

ocadml icon ocadml

Computer Aided Design (CAD) in OCaml

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.