Cubic DSL for 3D printing

Latest on Hackage:0.2.0

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow to host generated Haddocks.

BSD3 licensed by Junji Hashimoto

Cube: Cubic DSL for 3D printing

Hackage version Build Status

Cube is DSL for 3D printing.

This indents to make original blocks and prototypes for hobby.

This DSL is based on mathematical algebra. Cube is the same as Quaternion. Block is set of Cube. It allows boolian operations(and, subtruct and convolution).

Getting started

Install this from Hackage.

cabal update && cabal install cube


Block is converted to STL. Block is the same as set of cube. Following example shows example of DSL generating shape of house.

import Language.Cube

house :: Block Cube
house = let house''  = (house' + square)*line
        in rfmap (12 * dz +) house''
    house' :: Block Cube
    house' = block $ [cube 1 x y| x<-[-10..10], y<-[-10..10], y < x , y < (-x)]
    square :: Block Cube
    square = rfmap ((+) (-12 * dz)) $ block $ [cube 1 x y| x<-[-5..5], y<-[-5..5]]
    line :: Block Cube
    line = block $ [cube x 0 0 | x<-[-5..5]]
main :: IO ()
main = do
  writeFileStl "house.stl" $ house



  • Fix bug of rotation
  • Add RFunctor to define Functor for Data.Set and other data.
  • Add sample in cabal


  • First Release
Depends on 7 packages:
Used by 2 packages:
comments powered byDisqus