summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2019-03-13 02:45:51 -0400
committerAndrew Cady <d@jerkface.net>2019-03-13 02:45:51 -0400
commit9e948c3dba9124e7cef54bc64fc76038b89f45f8 (patch)
tree7dbcb8ca7b49ea97a77b6fc35248dd21a59d7a17
parentd5b97772cdc98ef90e139c1554442938dbf242a8 (diff)
reimplement genscad in terms of Graphics.OpenSCAD
-rw-r--r--shelves.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/shelves.hs b/shelves.hs
index 0484ff5..6ed051a 100644
--- a/shelves.hs
+++ b/shelves.hs
@@ -1,8 +1,13 @@
1import Control.Lens 1import Control.Lens
2import GenSCAD (genscad)
3import Graphics.OpenSCAD 2import Graphics.OpenSCAD
4import Linear.V3 3import Linear.V3
5 4
5genscad :: [(V3 Double, V3 Double)] -> String
6genscad = render . union . map transBox
7 where
8 transBox :: (V3 Double, V3 Double) -> Model3d
9 transBox (V3 x1 y1 z1, V3 x2 y2 z2) = translate (x1,y1,z1) $ box x2 y2 z2
10
6data Shelf 11data Shelf
7 12
8myShelf :: Shelf 13myShelf :: Shelf