Skip to content
Browse files

Fix cabal issues.

* Add missing dependency.
* Change syntax that ghc + cabal gets angry about but ghc doens't.
  • Loading branch information...
1 parent 1843543 commit 5a265020952e70cd5de6bff12d0664c6c0287b7b @colah committed Dec 10, 2012
Showing with 29 additions and 29 deletions.
  1. +27 −28 extopenscad.hs
  2. +2 −1 implicit.cabal
View
55 extopenscad.hs
@@ -89,34 +89,33 @@ executeAndExportSpecifiedTargetType content targetname formatname = case runOpen
s@(vars, obj2s, obj3s) <- openscadProgram
let
res = getRes s
- if not (null obj2s)
- then do
- let obj = head obj2s
- putStrLn $ "Rendering 2D object to " ++ targetname
- putStrLn $ "With resolution " ++ show res
- putStrLn $ "In box " ++ show (getBox2 obj)
- putStrLn $ show obj
- case formatname of
- "svg" -> writeSVG res targetname obj
- "scad"-> writeSCAD2 res targetname obj
- "png" -> writePNG2 res targetname obj
- "ngc" -> writeGCodeHacklabLaser res targetname obj
- _ -> putStrLn $ "Unrecognized 2D format: " ++ formatname
- else if not (null obj3s)
- then do
- let obj = head obj3s
- putStrLn $ "Rendering 3D object to " ++ targetname
- putStrLn $ "With resolution " ++ show res
- putStrLn $ "In box " ++ show (getBox3 obj)
- putStrLn $ show obj
- case formatname of
- "stl" -> writeBinSTL res targetname obj
- "scad"-> writeSCAD3 res targetname obj
- "obj" -> writeOBJ res targetname obj
- "png" -> writePNG3 res targetname obj
- _ -> putStrLn $ "Unrecognized 3D format: " ++ formatname
- else
- putStrLn "Nothing to render."
+ case (obj2s, obj3s) of
+ ([], _) -> do
+ let obj = head obj2s
+ putStrLn $ "Rendering 2D object to " ++ targetname
+ putStrLn $ "With resolution " ++ show res
+ putStrLn $ "In box " ++ show (getBox2 obj)
+ putStrLn $ show obj
+ case formatname of
+ "svg" -> writeSVG res targetname obj
+ "scad"-> writeSCAD2 res targetname obj
+ "png" -> writePNG2 res targetname obj
+ "ngc" -> writeGCodeHacklabLaser res targetname obj
+ _ -> putStrLn $ "Unrecognized 2D format: " ++ formatname
+ (_, []) -> do
+ let obj = head obj3s
+ putStrLn $ "Rendering 3D object to " ++ targetname
+ putStrLn $ "With resolution " ++ show res
+ putStrLn $ "In box " ++ show (getBox3 obj)
+ putStrLn $ show obj
+ case formatname of
+ "stl" -> writeBinSTL res targetname obj
+ "scad"-> writeSCAD3 res targetname obj
+ "obj" -> writeOBJ res targetname obj
+ "png" -> writePNG3 res targetname obj
+ _ -> putStrLn $ "Unrecognized 3D format: " ++ formatname
+ _ ->
+ putStrLn "Nothing to render."
main :: IO()
View
3 implicit.cabal
@@ -26,10 +26,11 @@ Library
deepseq,
vector-space,
text,
- blaze-svg,
mtl,
bytestring,
blaze-builder,
+ blaze-markup,
+ blaze-svg,
storable-endian,
JuicyPixels

0 comments on commit 5a26502

Please sign in to comment.
Something went wrong with that request. Please try again.