cube-0.1.0: Cubic DSL for 3D printing

Safe HaskellNone
LanguageHaskell2010

Language.Cube

Synopsis

Documentation

class ToSTL a where Source

Methods

toSTL :: a -> STL Source

Instances

data Quaternion a Source

Unit element of Cube.

This is the same as quaternion.

Constructors

Quaternion 

Fields

us :: a
 
ux :: a
 
uy :: a
 
uz :: a
 

Instances

Eq a => Eq (Quaternion a) 
Num a => Num (Quaternion a) 
Ord a => Ord (Quaternion a) 
Show a => Show (Quaternion a) 
Num a => Monoid (Quaternion a) 
ToSTL (Quaternion Int) 

data Block a Source

Set of Cube. This supports boolean operations on polygons. (+) means or. (-) means not. (*) means convolution.

Constructors

Block 

Fields

units :: Set a
 

Instances

Eq a => Eq (Block a) 
(Ord a, Eq a, Num a) => Num (Block a) 
Ord a => Ord (Block a) 
Show a => Show (Block a) 
(Ord a, Monoid a) => Monoid (Block a) 
ToSTL a => ToSTL (Block a) 

smap :: (Ord a, Ord b) => (a -> b) -> Block a -> Block b Source

map for Block.

block :: Ord a => [a] -> Block a Source

Utility function of generating Block from list of cube

cube :: Int -> Int -> Int -> Cube Source

Utility function of Cube 0 x y z

writeFileStl :: ToSTL a => String -> a -> IO () Source

Generate STL file from Block

ds :: Cube Source

Unit scalar vector

dx :: Cube Source

Unit vector of X direction

dy :: Cube Source

Unit vector of Y direction

dz :: Cube Source

Unit vector of Z direction

dr Source

Arguments

:: Float

radian

-> Cube

axes of routation

-> Cube 

Vector for generating routation vector

nCube :: Int -> Block Cube Source

This function genrates a cube of n-width.

surface' :: Block Cube -> Block Cube Source

Generate surface block. This is fast function. But shape becomes little bit bigger.

surface :: Block Cube -> Block Cube Source

Generate surface block

house :: Block Cube Source

Generate house which is for demo.