package geoml

  1. Overview
  2. Docs
Geoml: 2D Geometry library for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

0.1.1.tar.gz
md5=37ca15d64a035762d12c4bd7064a1841
sha512=109d7597bd2a8d6628b4c0ee40cd94066fe09ce565bb35fe10683e5f701c1d058daaec79702b4f5f8ed68eeed444c363ca6070f854bbdfb6d0cd997db0f21408

doc/geoml/Polygon/index.html

Module PolygonSource

This module provides basic functions for any concave, convex and convex regular polygon (Does not handle complex polygon and polygon with holes)

Sourcetype t = private Point.t list
Sourcetype polygon = t
Sourceval make : Point.t list -> t
Sourceval first_point : t -> Point.t
Sourceval to_list : t -> Point.t list
Sourceval fold : ('a -> Point.t -> Point.t -> 'a) -> 'a -> t -> 'a

Same function as List.fold_left but on segments of a given polygon

Sourceval fold_filter : (Point.t -> Point.t -> bool) -> ('b -> Point.t -> Point.t -> 'b) -> 'b -> t -> 'b

Same function as fold but filters segments with the first argument

Sourceval perimeter : t -> float
Sourceval area : t -> float
Sourceval proj_x : t -> float * float
Sourceval proj_y : t -> float * float
Sourceval translate : float -> float -> t -> t
Sourceval transform : Affine.t -> t -> t
Sourceval minmax_xy : t -> float * float * float * float
Sourceval intersect_line : t -> Line.t -> Point.t list

returns the intersection point of a line and a polygon

Sourceval contains : t -> Point.t -> bool

Returns true if a polygon contains a point. Randolph Franklin code for raycasting

Sourceval segments_intersection_points : Point.t list Segment.Tbl.t -> t -> t -> Point.t list

Get a list of the intersections points of the edges of two polygons

Sourceval intersection_polygons : t -> t -> t list

Implementation of Weiler Atherton Algorithm for concave/convexe polygons clipping. Complexity is O(m*n).

Sourceval triangulation : t -> (Point.t * Point.t * Point.t) list
Sourcemodule Convex : sig ... end
OCaml

Innovation. Community. Security.