package OCADml

  1. Overview
  2. Docs
Types and functions for building CAD packages in OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

OCADml-0.4.1.tbz
sha256=d12ea5331bb8b0b25ca3f7e422549897d19b02d27a8d4dc0e73e610ed39004de
sha512=316783fd40d16d0a40e747d93834dcf62cdfc71ab8081fbc874ddf8e6c4e807134ac3cb7e145b21845490f9238d8e431d007cc7fbe2e6f0414a0976db6d82c04

doc/index.html

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.

API

  • OCADml -- top level library interface
  • PolyText -- point representations of text (only installed if cairo is available)

Vectors and transformations

  • V2 -- 2d vector operations
  • V3 -- 3d vector operations
  • Affine2 -- 2d affine transformation matrices
  • Affine3 -- 3d affine transformation matrices
  • Quaternion -- quaternion manipulation andl application
  • Plane -- normalized cartesian plane operations

2d paths and polygons

  • Path2 -- generation and manipulation of 2d paths
  • Bezier2 -- 2d bezier curves, patches, and splines
  • CubicSpline -- cubic spline interpolation of 2d paths
  • Poly2 -- 2d polygons (outer, and zero or more inner paths)
  • PolyText -- point representations of text (via cairo)

3d paths, coplanar polygons, and meshes

  • Path3 -- generation and manipulation of 3d paths
  • Bezier3 -- 3d bezier curves, patches, and splines
  • Poly3 -- planar 3d polygons (outer, and zero or more inner paths)
  • Mesh -- points and faces 3d mesh representation (polyhedrons)

Utilities

  • Math -- float and 2d matrix operations
  • BallTree2 -- 2d vector space partitioning search tree
  • BallTree3 -- 3d vector space partitioning search tree

Using OCaml top-level

As this library uses vector types from Gg, the associated pretty printing functionality can be unlocked in the top-level via #require "gg.top";;.

CAD Package Specific Frontends

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

OSCADml

[@@deriving cad]

There is a companion ppx, [@@deriving cad] for generating transformation functions for user-defined records and abstract types composed of types for which the basic transformation functions are defined, such as vectors (V2.t or V3.t) (and those composed of them) provided in this library.

OCaml

Innovation. Community. Security.