-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTryFsharpUtilities.fs
More file actions
36 lines (29 loc) · 1.16 KB
/
TryFsharpUtilities.fs
File metadata and controls
36 lines (29 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
module TryFsharpUtilities
open Functional3D
open System.Drawing
module TryFs =
let showIt shapeFun = shapeFun()
let rec showEm shapes =
match shapes with
| h::t when t.Length = 0 -> showIt h
| h::t -> (showIt h) $ (showEm t)
let cuboid x y z length height depth colour =
fun () ->
Fun.cube
|> Fun.color colour
|> Fun.translate (x, y, z)
|> Fun.scale (length, height, depth)
|> Fun.rotate (90., 0., 0.)
let cube x y z height colour = cuboid x y z height height height colour
let cylinder x y z height radius colour =
fun () -> Fun.cylinder
|> Fun.scale (radius, radius, height)
|> Fun.color colour
|> Fun.translate (x, y, z)
|> Fun.rotate (90., 0., 0.)
let cone x y z height radius colour =
fun () -> Fun.cone
|> Fun.scale (radius, radius, height)
|> Fun.color colour
|> Fun.translate (x, y, z)
|> Fun.rotate (90., 0., 0.)