ImplicitCAD/Examples/example17.hs

22 lines
724 B
Haskell
Raw Normal View History

2019-06-06 09:58:14 +03:00
-- Example 17, pulled from our benchmarking suite.
import Graphics.Implicit
import Graphics.Implicit.Definitions
default (Fast, )
object2 :: SymbolicObj3
object2 = squarePipe (10,10,10) 1 100
where
squarePipe :: (,,) -> -> -> SymbolicObj3
squarePipe (x,y,z) diameter precision =
union
2019-12-26 16:03:55 +03:00
$ fmap (\start-> translate start
2019-06-06 09:58:14 +03:00
$ rect3R 0 (0,0,0) (diameter,diameter,diameter)
)
2019-12-26 16:03:55 +03:00
$ 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])
2019-06-06 09:58:14 +03:00
main = writeSTL 1 "example17.stl" object2