diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2021-01-07 14:20:54 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2021-01-07 14:20:54 +0100 |
commit | 21c386fee208adb7b494d2677d9f49ed49a1c1ce (patch) | |
tree | b1c77a0c1870768a4876ec58cc06962768a3fe75 /path/point.ml | |
parent | 06c39bbea3b7f8e6bfec88878ec80f9cc474184f (diff) |
Local point configuration
Diffstat (limited to 'path/point.ml')
-rwxr-xr-x | path/point.ml | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/path/point.ml b/path/point.ml index d49d655..4c34899 100755 --- a/path/point.ml +++ b/path/point.ml @@ -1,8 +1,11 @@ +let internal_id = ref 0 + type t = { p: Gg.v2 ; size : float ; angle: float ; stamp : float + ; id : int } let empty = @@ -10,17 +13,23 @@ let empty = ; size = 0. ; angle = 0. ; stamp = 0. + ; id = 0 } let create ~angle ~width ~stamp ~x ~y = + + incr internal_id; { p = Gg.V2.v x y ; size = width ; angle = Gg.Float.rad_of_deg (180. -. angle ) ; stamp + ; id = !internal_id } let copy point p = - { point with p } + { point with + p + } let set_angle p angle = { p with angle = Gg.Float.rad_of_deg (180. -. angle) } @@ -49,6 +58,7 @@ let get_coord' let mix : float -> Gg.v2 -> t -> t -> t = fun f point p0 p1 -> + incr internal_id; let angle0 = p0.angle and angle1 = p1.angle and width0 = get_width p0 @@ -61,4 +71,8 @@ let mix { p = point ; size = width ; angle - ; stamp } + ; stamp + ; id = !internal_id + } + +let id { id; _} = id |