From 8528cc416f8e90007e947fed896803e822f97683 Mon Sep 17 00:00:00 2001 From: Julia Longtin Date: Tue, 31 Dec 2019 15:44:22 +0000 Subject: [PATCH] be a little more explicit, and use applicative more. --- Examples/example17.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Examples/example17.hs b/Examples/example17.hs index b010074..49a53f5 100644 --- a/Examples/example17.hs +++ b/Examples/example17.hs @@ -1,7 +1,9 @@ -- Example 17, pulled from our benchmarking suite. +import Prelude ((<$>), ($), zip3, fmap, fromIntegral, (*), (/)) import Graphics.Implicit (union, translate, rect3R, writeSTL) import Graphics.Implicit.Definitions (Fastℕ, ℝ, ℝ3, SymbolicObj3) + default (Fastℕ, ℝ) object2 :: SymbolicObj3 @@ -10,12 +12,13 @@ object2 = squarePipe (10,10,10) 1 100 squarePipe :: ℝ3 -> ℝ -> ℝ -> SymbolicObj3 squarePipe (x,y,z) diameter precision = union - $ fmap (\start-> translate start + $ ((\start-> translate start $ rect3R 0 (0,0,0) (diameter,diameter,diameter) ) - $ zip3 (fmap (\n->(fromIntegral n/precision)*x) [0..100]) + <$> + zip3 (fmap (\n->(fromIntegral n/precision)*x) [0..100]) (fmap (\n->(fromIntegral n/precision)*y) [0..100]) - (fmap (\n->(fromIntegral n/precision)*z) [0..100]) + (fmap (\n->(fromIntegral n/precision)*z) [0..100])) main = writeSTL 1 "example17.stl" object2