package tiny_appkits

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module SketchSource

Sourcetype pos = float * float
Sourcetype item =
  1. | Line of int * int
  2. | Circle of int * int
Sourcetype constr =
  1. | Horizontal of int
  2. | Vertical of int
  3. | Parallel of int * int
  4. | Perpendicular of int * int
  5. | Equal of int * int
  6. | On_line of int * int
  7. | On_circle of int * int
Sourcetype instance = {
  1. master : int;
  2. at : pos;
  3. size : float;
  4. angle : float;
}
Sourcetype sheet = {
  1. points : (int * pos) list;
  2. fixed : int list;
  3. items : (int * item) list;
  4. constraints : constr list;
  5. instances : instance list;
  6. next : int;
}
Sourceval empty : sheet
Sourceval add_point : pos -> sheet -> sheet * int
Sourceval add_item : item -> sheet -> sheet * int
Sourceval constrain : constr -> sheet -> sheet
Sourceval pos : sheet -> int -> pos
Sourceval set_pos : int -> pos -> sheet -> sheet
Sourceval toggle_fixed : int -> sheet -> sheet
Sourceval ends : sheet -> int -> (int * int) option
Sourceval points_of : sheet -> constr -> int list
Sourceval merge : drop:int -> onto:int -> sheet -> sheet
Sourceval delete : int -> sheet -> sheet
Sourcetype t = sheet list
Sourceval sheet : t -> int -> sheet
Sourceval set_sheet : int -> sheet -> t -> t
Sourceval uses : t -> int -> int -> bool
Sourceval place : int -> instance -> t -> t option
Sourcetype stroke =
  1. | Seg of pos * pos
  2. | Round of pos * float
Sourceval transform : instance -> pos -> pos
Sourceval instance_strokes : t -> instance -> stroke list
Sourceval strokes : t -> int -> stroke list
Sourcetype aim =
  1. | Nothing
  2. | At_point of int
  3. | On_item of int * pos
  4. | At_instance of int
Sourceval aim : t -> int -> tolerance:float -> ?except:int -> pos -> aim
Sourceval to_segment : pos -> pos -> pos -> float