aboutsummaryrefslogtreecommitdiff
path: root/path/builder.ml
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2021-01-11 13:51:21 +0100
committerSébastien Dailly <sebastien@chimrod.com>2021-01-11 13:55:43 +0100
commit1aa90219e3e74bac3afbde0ec120e098b50bd0c5 (patch)
tree50613ecc6f1984b9a9824fc347d064df38f33cf0 /path/builder.ml
parent42c3c122c4f53dd68bcdd89411835887c3ae0af9 (diff)
Interior curve evaluation
Diffstat (limited to 'path/builder.ml')
-rwxr-xr-xpath/builder.ml18
1 files changed, 18 insertions, 0 deletions
diff --git a/path/builder.ml b/path/builder.ml
index 166c073..4403599 100755
--- a/path/builder.ml
+++ b/path/builder.ml
@@ -203,4 +203,22 @@ module Make(Point:P) = struct
path
)
+ let map
+ : t -> (Point.t -> Point.t) -> t
+ = fun (points, beziers) f ->
+ let points = List.map
+ points
+ ~f
+ and beziers = List.map
+ beziers
+ ~f:(fun bezier ->
+
+ { p0 = f bezier.p0
+ ; p1 = f bezier.p1
+ ; ctrl0 = Point.(get_coord (f ( copy bezier.p0 bezier.ctrl0)))
+ ; ctrl1 = Point.(get_coord (f ( copy bezier.p1 bezier.ctrl1)))
+ }
+ ) in
+ points, beziers
+
end