diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2020-12-19 19:59:17 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2020-12-19 19:59:17 +0100 |
commit | 0faaa5fda396f0eca6bebf69f3624a344278fa6e (patch) | |
tree | cbca5d2f306506c0896f83b8bdd45b777c78aa35 /path/builder.mli | |
parent | e5c2a971644746818f8764481c60c4c5cf1a80c4 (diff) |
First commit
Diffstat (limited to 'path/builder.mli')
-rwxr-xr-x | path/builder.mli | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/path/builder.mli b/path/builder.mli index d99e0b2..64617fa 100755 --- a/path/builder.mli +++ b/path/builder.mli @@ -2,12 +2,40 @@ module type P = sig type t + val empty : t + val get_coord : t -> Gg.v2 + + val copy : t -> Gg.v2 -> t + + type 'a repr + + val create_path + : unit -> 'a repr + + (* Start a new path. *) + val start + : t -> 'a repr -> 'a repr + + val line_to + : t -> 'a repr -> 'a repr + + val quadratic_to + : t -> t -> t -> t -> 'a repr -> 'a repr + + val stop + : 'a repr -> 'a repr end module Make(P:P) : sig + type bezier = + { p0:P.t (* The starting point *) + ; p1:P.t (* The end point *) + ; ctrl0:Gg.v2 (* The control point *) + ; ctrl1:Gg.v2 } (* The control point *) + type t (** Create an empty path *) @@ -29,5 +57,11 @@ module Make(P:P) : sig : t -> (P.t * P.t) option val get - : t -> P.t list * Shapes.Bezier.t list + : t -> P.t list * bezier list + + val points_to_beziers + : P.t list -> Shapes.Bezier.t array -> bezier array + + val draw + : t -> 'a P.repr end |