aboutsummaryrefslogtreecommitdiff
path: root/layer/fillPrinter.ml
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2021-01-11 11:33:32 +0100
committerSébastien Dailly <sebastien@chimrod.com>2021-01-11 13:55:43 +0100
commit42c3c122c4f53dd68bcdd89411835887c3ae0af9 (patch)
tree856a54955c4bf1648e7f5f1cea809e5601b60c7d /layer/fillPrinter.ml
parent979be5f588a1ffd6e1d060cd794e87526d517b7a (diff)
Outline module
Diffstat (limited to 'layer/fillPrinter.ml')
-rwxr-xr-xlayer/fillPrinter.ml89
1 files changed, 0 insertions, 89 deletions
diff --git a/layer/fillPrinter.ml b/layer/fillPrinter.ml
deleted file mode 100755
index f3717c2..0000000
--- a/layer/fillPrinter.ml
+++ /dev/null
@@ -1,89 +0,0 @@
-module Make(Repr: Repr.PRINTER) = struct
-
- type point = Path.Point.t
-
- type repr = Repr.t
-
- type t =
- { path: Repr.t
- ; close : Repr.t -> Repr.t
- }
-
- let create_path
- : (Repr.t -> Repr.t) -> t
- = fun f ->
- { close = f
- ; path = Repr.create ()
- }
-
- (* Start a new path. *)
-
- let start
- : point -> point -> t -> t
- = fun p1 _ {close ; path } ->
- let path = Repr.move_to (Path.Point.get_coord p1) path in
- { close
- ; path
- }
-
- let line_to
- : (point * point) -> (point * point) -> t -> t
- = fun (p0, p1) (p0', p1') t ->
-
- let p0 = Path.Point.get_coord p0
- and p1 = Path.Point.get_coord p1
- and p0' = Path.Point.get_coord p0'
- and p1' = Path.Point.get_coord p1' in
-
- let path =
- Repr.move_to p1 t.path
- |> Repr.line_to p1'
- |> Repr.line_to p0'
- |> Repr.line_to p0
- |> Repr.line_to p1
- |> Repr.close in
- let path = t.close path in
- { t with path}
-
- let quadratic_to
- : (point * Gg.v2 * Gg.v2 * point) -> (point * Gg.v2 * Gg.v2 * point) -> t -> t
- = fun (p0, ctrl0, ctrl1, p1) (p0', ctrl0', ctrl1', p1') t ->
-
- let p0 = Path.Point.get_coord p0
- and p1 = Path.Point.get_coord p1
- and p0' = Path.Point.get_coord p0'
- and p1' = Path.Point.get_coord p1'
- in
-
- let path =
- Repr.move_to p1 t.path
- |> Repr.line_to p1'
-
- (* Backward *)
- |> Repr.quadratic_to
- ctrl1'
- ctrl0'
- p0'
- |> Repr.line_to p0
-
- (* Forward *)
- |> Repr.quadratic_to
- ctrl0
- ctrl1
- p1
- |> Repr.close
- |> t.close in
-
-
- { t with path }
-
- let stop
- : t -> t
- = fun t ->
- t
-
- let get
- : t -> Repr.t
- = fun t ->
- t.path
-end