From 21c386fee208adb7b494d2677d9f49ed49a1c1ce Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Thu, 7 Jan 2021 14:20:54 +0100 Subject: Local point configuration --- layer/ductusPrinter.ml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'layer/ductusPrinter.ml') diff --git a/layer/ductusPrinter.ml b/layer/ductusPrinter.ml index 3ed1c3c..2ee96e4 100755 --- a/layer/ductusPrinter.ml +++ b/layer/ductusPrinter.ml @@ -46,11 +46,14 @@ module Make(Repr: Repr.PRINTER) = struct recent point *) let delay = ((Path.Point.get_stamp p0) -. (Path.Point.get_stamp p1)) - *. 100. /. 3. + *. 20. in - for i = 0 to (Int.of_float delay) do - let bezier', _ = Shapes.Bezier.slice (0.1 *. (Float.of_int i)) bezier in - let point = Path.Point.copy p1 bezier'.Shapes.Bezier.p1 in + for i = 0 to ((Int.of_float delay) -1) do + let ratio = (Float.of_int i) /. delay in + let bezier', _ = Shapes.Bezier.slice ratio bezier in + + let point = Path.Point.mix ratio bezier'.Shapes.Bezier.p1 p0 p1 in + path := Repr.move_to (Path.Point.get_coord point) !path; path := Repr.line_to (Path.Point.get_coord' point) !path; done; -- cgit v1.2.3