diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2021-01-09 11:35:40 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2021-01-09 11:35:40 +0100 |
commit | 329b774e315b41bc0d5b7daf8737222768c8d1f3 (patch) | |
tree | 94464c12dfa48d5fdb1508b9e8a115b4596d0e34 /path/fixed.ml | |
parent | c734c1b30fd1c58a0d42020859be31d89b92bcd0 (diff) |
Formalized exchanges between worker and app
Diffstat (limited to 'path/fixed.ml')
-rwxr-xr-x | path/fixed.ml | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/path/fixed.ml b/path/fixed.ml index 812dd3b..d9abcb5 100755 --- a/path/fixed.ml +++ b/path/fixed.ml @@ -14,6 +14,12 @@ end module Make(Point:P) = struct + type bezier = + { p0:Point.t (* The starting point *) + ; p1:Point.t (* The end point *) + ; ctrl0:Gg.v2 (* The control point *) + ; ctrl1:Gg.v2 } (* The control point *) + module type BUILDER = sig type t @@ -21,12 +27,6 @@ module Make(Point:P) = struct : t -> (module Repr.M with type t = Point.t and type repr = 's) -> 's -> 's end - type bezier = - { p0:Point.t (* The starting point *) - ; p1:Point.t (* The end point *) - ; ctrl0:Gg.v2 (* The control point *) - ; ctrl1:Gg.v2 } (* The control point *) - type path = | Line of Point.t * Point.t | Curve of bezier @@ -58,8 +58,8 @@ module Make(Point:P) = struct , Line (p1, p2)::t) let quadratic_to - : t -> Gg.v2 -> Gg.v2 -> t -> repr -> repr - = fun p0 ctrl0 ctrl1 p1 (i, t) -> + : (t * Gg.v2 * Gg.v2 * t) -> repr -> repr + = fun (p0, ctrl0, ctrl1, p1) (i, t) -> let curve = Curve { p0 ; ctrl0 @@ -99,10 +99,10 @@ module Make(Point:P) = struct = fun (type s) {path; _} (module Repr : Repr.M with type t = Point.t and type repr = s) repr -> let repr_bezier p bezier = Repr.quadratic_to - bezier.p0 - bezier.ctrl0 - bezier.ctrl1 - bezier.p1 + ( bezier.p0 + , bezier.ctrl0 + , bezier.ctrl1 + , bezier.p1 ) p in let _, repr = Array.fold_left path |