diff options
Diffstat (limited to 'layer')
-rwxr-xr-x | layer/ductusPrinter.ml | 11 |
1 files changed, 7 insertions, 4 deletions
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; |