package archimedes
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=6c27810ecc964480a95584bdab10c5fd2784d530395c1a464f43be18f6f363be
md5=7f3bd1771751a074e4b4d2ccc5213260
doc/archimedes/Archimedes/Path/index.html
Module Archimedes.Path
Creating abstract paths.
Registering backends
val make : unit -> tmake () creates a new empty path.
val is_empty : t -> boolTells whether the path is empty.
val clear : t -> unitclear p clears the path (removes all operations).
val extents : t -> Matrix.rectangleextents p returns the path's extents.
val move_to : t -> x:float -> y:float -> unitmove_to p x y moves the path current point to (x, y) if both x and y are finite. Otherwise, does nothing.
val rel_move_to : t -> x:float -> y:float -> unitrel_move_to p x y shifts the path's current point of x horizontally and y vertically, provided both x and y are finite. Otherwise does nothing.
val line_to : t -> x:float -> y:float -> unitline_to p x y draws a line from the path's current point to (x, y) and sets the current point to (x, y), provided both x and y are finite. Otherwise does nothing.
val rel_line_to : t -> x:float -> y:float -> unitrel_line_to p x y shifts the path's current point of x horizontally and y vertically and draws a line between the current and the new point, provided both x and y are finite. Otherwise does nothing.
val line_of_array :
t ->
?i0:int ->
?i1:int ->
?const_x:bool ->
float array ->
?const_y:bool ->
float array ->
unitline_of_array p x y continue the current line (or start a new one) with the line formed by joining the points x.(i), y.(i), i=i0,...,i1 (with possibly i0 > i1 to indicate that the indices must be followed in decreasing order). Points with at least one NaN or infinite coordinate are skipped when they are at the beginning or the end and result in a move_to when separating finite points.
type vec =
(float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Array1.tSame as line_of_array but for FORTRAN bigarrays.
type cvec = (float, Bigarray.float64_elt, Bigarray.c_layout) Bigarray.Array1.tval line_of_cvec :
t ->
?i0:int ->
?i1:int ->
?const_x:bool ->
cvec ->
?const_y:bool ->
cvec ->
unitSame as line_of_array but for C bigarrays.
val rectangle : t -> x:float -> y:float -> w:float -> h:float -> unitrectangle p x y w h draws a rectangle specified by (x, y, w, h) if all four quantities x, y, w and h are finite. Does nothing otherwise.
val curve_to :
t ->
x1:float ->
y1:float ->
x2:float ->
y2:float ->
x3:float ->
y3:float ->
unitcurve_to p x1 y1 x2 y2 x3 y3 draws a cubic Bezier curve using the path's current point as first point (x0, y0) if it is set, else (x1, y1). Sets the path's current point to (x3, y3). The above holds provided all values x1, y1, x2, y2, x3, and y3 are finite. The function does nothing otherwise.
val arc : t -> r:float -> a1:float -> a2:float -> unitarc p r a1 a2 draws an arc starting at the path's current point. The starting angle is a1, the radius r and the arc is drawn clockwise to the angle a2. The angles are given in radians. The above holds provided the three values r, a1, and a2 are finite. The function does nothing otherwise.
val arc_center : t -> r:float -> a1:float -> a2:float -> unitarc p r a1 a2 same as arc but the current point defines the arc center of radius instead of start point
val circle : t -> r:float -> unitcircle p r draws a circle of radius r with its center on the path's current point.
val close : t -> unitclose p Closes the path. It is usually not required to close a path, this is useful only to ensure the path won't be extended.
val current_point : t -> float * floatcurrent_point p returns the current point of the path.
append p1 p2 append the path p2 to the end of p1 and clear p2. The current point of p1 becomes the one of p2.