aboutsummaryrefslogtreecommitdiff
path: root/path/fixed.ml
diff options
context:
space:
mode:
Diffstat (limited to 'path/fixed.ml')
-rwxr-xr-xpath/fixed.ml24
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