The cube package

[Tags:bsd3, library, test]

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]

Properties

Versions 0.1.0, 0.2.0
Change log ChangeLog.md
Dependencies base (==4.*), bytestring (>=0.10.2), cereal, containers, cube, hspec, STL [details]
License BSD3
Author Junji Hashimoto
Maintainer junji.hashimoto@gmail.com
Category Language
Bug tracker https://github.com/junjihashimoto/cube/issues
Source repository head: git clone https://github.com/junjihashimoto/cube.git
Uploaded Wed Apr 15 20:42:02 UTC 2015 by junjihashimoto
Distributions NixOS:0.2.0
Downloads 301 total (5 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2015-04-18 [all 1 reports]

Modules

[Index]

Flags

NameDescriptionDefaultType
sampleBuild sample programsDisabledAutomatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for cube

Readme for cube-0.2.0

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.

import Language.Cube

house :: Block Cube
house = let house''  = (house' + square)*line
        in rfmap (12 * dz +) house''
  where
    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