summaryrefslogtreecommitdiff
path: root/layer
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2021-01-07 14:20:54 +0100
committerSébastien Dailly <sebastien@chimrod.com>2021-01-07 14:20:54 +0100
commit21c386fee208adb7b494d2677d9f49ed49a1c1ce (patch)
treeb1c77a0c1870768a4876ec58cc06962768a3fe75 /layer
parent06c39bbea3b7f8e6bfec88878ec80f9cc474184f (diff)
Local point configuration
Diffstat (limited to 'layer')
-rwxr-xr-xlayer/ductusPrinter.ml11
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;