cube: Cubic DSL for 3D printing

[ bsd3, language, library ] [ Propose Tags ]

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 boolean operations(and, subtruct and convolution).


[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0, 0.2.0
Change log ChangeLog.md
Dependencies base (>=4 && <5), bytestring, cereal, containers, STL [details]
License BSD-3-Clause
Author Junji Hashimoto
Maintainer junji.hashimoto@gmail.com
Category Language
Bug tracker https://github.com/junjihashimoto/cube/issues
Source repo head: git clone https://github.com/junjihashimoto/cube.git
Uploaded by junjihashimoto at 2015-04-07T04:09:56Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 1612 total (7 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-04-07 [all 1 reports]

Readme for cube-0.1.0

[back to package description]

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

Example

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

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