aboutsummaryrefslogtreecommitdiff
path: root/layer/wireFramePrinter.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/wireFramePrinter.ml
parent86ec559f913c389e8dc055b494630f21a45e039b (diff)
Update project structure
Diffstat (limited to 'layer/wireFramePrinter.ml')
-rwxr-xr-xlayer/wireFramePrinter.ml80
1 files changed, 0 insertions, 80 deletions
diff --git a/layer/wireFramePrinter.ml b/layer/wireFramePrinter.ml
deleted file mode 100755
index 81ab271..0000000
--- a/layer/wireFramePrinter.ml
+++ /dev/null
@@ -1,80 +0,0 @@
-module Point = Path.Point
-
-module Make(Repr: Repr.PRINTER) = struct
- type t = Point.t
-
- type repr =
- { back: (Repr.t -> Repr.t)
- ; path: (Repr.t)
- ; last_point : Point.t option
- }
-
- let create_path
- : 'b -> repr
- = fun _ ->
- { back = Repr.close
- ; path = Repr.create ()
- ; last_point = None
- }
-
- (* Start a new path. *)
- let start
- : Point.t -> repr -> repr
- = fun t {back; path; _} ->
- let path = Repr.move_to (Point.get_coord t) path in
- let line' = Repr.line_to (Point.get_coord' t) in
- { back = (fun p -> back @@ line' p)
- ; path
- ; last_point = Some t
- }
-
- let line_to
- : Point.t -> Point.t -> repr -> repr
- = fun _ t {back; path; _} ->
- let line' = Repr.line_to (Point.get_coord' t) in
- { back = (fun t -> back @@ line' t)
- ; path = Repr.line_to (Point.get_coord t) path
- ; last_point = Some t
- }
-
- let quadratic_to
- : Point.t -> Gg.v2 -> Gg.v2 -> Point.t -> repr -> repr
- = fun p0 ctrl0 ctrl1 p1 t ->
-
- let ctrl0' = Point.copy p1 ctrl0
- and ctrl1' = Point.copy p1 ctrl1 in
-
- let line' path =
- Repr.quadratic_to
- (Point.get_coord' @@ ctrl1')
- (Point.get_coord' ctrl0')
- (Point.get_coord' p0) path in
-
- let path = Repr.quadratic_to
- (Point.get_coord ctrl0')
- (Point.get_coord ctrl1')
- (Point.get_coord p1)
- t.path in
- { back = (fun p -> t.back @@ line' p)
- ; path
- ; last_point = Some p1
- }
-
- let stop
- : repr -> repr
- = fun {back; path; last_point} ->
-
- let path =
- match last_point with
- | Some point -> Repr.line_to (Point.get_coord' point) path
- | None -> path in
-
- { back = (fun x -> x)
- ; path = back path
- ; last_point = None }
-
- let get
- : repr -> Repr.t
- = fun {back; path; _} ->
- back path
-end