aboutsummaryrefslogtreecommitdiff
path: root/layer/lineEngine.ml
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2021-02-05 09:08:39 +0100
committerSébastien Dailly <sebastien@dailly.me>2022-02-07 14:39:30 +0100
commit561d0f0155f4906d90eb7e73a3ff9cb28909126f (patch)
tree9a606c2d7832272ea33d7052512a5fa59805d582 /layer/lineEngine.ml
parent86ec559f913c389e8dc055b494630f21a45e039b (diff)
Update project structure
Diffstat (limited to 'layer/lineEngine.ml')
-rwxr-xr-xlayer/lineEngine.ml68
1 files changed, 0 insertions, 68 deletions
diff --git a/layer/lineEngine.ml b/layer/lineEngine.ml
deleted file mode 100755
index 3d15d9c..0000000
--- a/layer/lineEngine.ml
+++ /dev/null
@@ -1,68 +0,0 @@
-module Make(Layer: Repr.PRINTER) = struct
-
- type point = Path.Point.t
-
- let mark point path =
- let open Gg.V2 in
- let point = Path.Point.get_coord point in
-
- let dist = 5.
- and dist' = -5. in
-
- let path = Layer.move_to (point - (of_tuple (dist, dist))) path
- |> Layer.line_to ( point + (of_tuple (dist, dist)))
- |> Layer.move_to (point + (of_tuple (dist', dist)))
- |> Layer.line_to ( point + (of_tuple (dist, dist')))
- in
- path
-
-
- type t =
- { path: (Layer.t)
- }
-
- type repr = Layer.t
-
- let create_path
- : 'b -> t
- = fun _ ->
- { path = Layer.create ()
- }
-
- let start
- : point -> point -> t -> t
- = fun p1 _ { path } ->
- let path = mark p1 path in
- { path
- }
-
- let line_to
- : (point * point) -> (point * point) -> t -> t
- = fun (p0, p1) _ {path} ->
- let path = Layer.move_to (Path.Point.get_coord p0) path
- |> Layer.line_to (Path.Point.get_coord p1)
- |> mark p1 in
- { path
- }
-
- let quadratic_to
- : (point * Gg.v2 * Gg.v2 * point) -> (point * Gg.v2 * Gg.v2 * point) -> t -> t
- = fun (p0, ctrl0, ctrl1, p1) _ {path} ->
-
- let path = Layer.move_to (Path.Point.get_coord p0) path
- |> Layer.quadratic_to ctrl0 ctrl1 (Path.Point.get_coord p1)
- |> mark p1 in
-
- { path = path }
-
- let stop
- : t -> t
- = fun path -> path
-
-
- let get
- : t -> Layer.t
- = fun {path; _} ->
- path
-
-end