From 06c39bbea3b7f8e6bfec88878ec80f9cc474184f Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Thu, 7 Jan 2021 00:03:03 +0100 Subject: Update --- path/fixed.ml | 6 ------ path/fixed.mli | 5 ----- path/point.ml | 17 +++++++++++++++++ path/point.mli | 5 +++++ 4 files changed, 22 insertions(+), 11 deletions(-) (limited to 'path') diff --git a/path/fixed.ml b/path/fixed.ml index 95a42d5..cb2c27f 100755 --- a/path/fixed.ml +++ b/path/fixed.ml @@ -4,13 +4,8 @@ open StdLabels module type P = sig type t - val empty : t - val get_coord : t -> Gg.v2 - (** Copy a point and all thoses properties to the given location *) - val copy : t -> Gg.v2 -> t - end module Make(Point:P) = struct @@ -185,7 +180,6 @@ module Make(Point:P) = struct | Curve bezier -> f bezier.p0 ; f bezier.p1 ) - let remove_point : t -> Point.t -> t = fun {id; path} point -> diff --git a/path/fixed.mli b/path/fixed.mli index 32f6012..f91ffc6 100755 --- a/path/fixed.mli +++ b/path/fixed.mli @@ -2,13 +2,8 @@ module type P = sig type t - val empty : t - val get_coord : t -> Gg.v2 - (** Copy a point and all thoses properties to the given location *) - val copy : t -> Gg.v2 -> t - end module Make(Point:P) : sig diff --git a/path/point.ml b/path/point.ml index 046c2e7..d49d655 100755 --- a/path/point.ml +++ b/path/point.ml @@ -45,3 +45,20 @@ let get_coord' let open Gg.V2 in let trans = of_polar @@ v t.size t.angle in t.p + trans + +let mix + : float -> Gg.v2 -> t -> t -> t + = fun f point p0 p1 -> + let angle0 = p0.angle + and angle1 = p1.angle + and width0 = get_width p0 + and width1 = get_width p1 + and stamp0 = get_stamp p0 + and stamp1 = get_stamp p1 in + let angle = angle0 +. f *. ( angle1 -. angle0 ) in + let width = width0 +. f *. ( width1 -. width0 ) in + let stamp = stamp0 +. f *. ( stamp1 -. stamp0 ) in + { p = point + ; size = width + ; angle + ; stamp } diff --git a/path/point.mli b/path/point.mli index c897195..fab42d2 100755 --- a/path/point.mli +++ b/path/point.mli @@ -22,3 +22,8 @@ val get_width: t -> float val get_coord' : t -> Gg.v2 + +(** [mix f point p0 p1] create a new point at the position point, with the + characteristics from p0 and p1 *) +val mix + : float -> Gg.v2 -> t -> t -> t -- cgit v1.2.3