diff --git a/README.md b/README.md index 3f8026ecf..bd67351b4 100644 --- a/README.md +++ b/README.md @@ -35,21 +35,23 @@ HGeometry Packages HGeometry is split into a few smaller packages. In particular: -- hgeometry-combinatorial : defines some non-geometric +- hgeometry : defines the actual geometric data types, data + structures, and algorithms, +- hgeometry-combinatorial : defines the non-geometric (i.e. combinatorial) data types, data structures, and algorithms. + - hgeometry-ipe : defines functions for working with [ipe](http://ipe.otfried.org) files. - hgeometry-svg : defines functions for working with svg files. - hgeometry-web : defines functions for building an interactive viewer using [miso](https://haskell-miso.org). - hgeometry-interactive : defines functions for building an - interactive viewer using [reflex-sdl2](https://hackage.haskell.org/package/reflex-sdl2). -- hgeometry : defines the actual geometric data types, data - structures, and algorithms. + interactive viewer using + [reflex-sdl2](https://hackage.haskell.org/package/reflex-sdl2). -In addition there is a [hgeometry-examples](hgeometry-examples) -package that defines some example applications, and a hgometry-test -package that contains all testcases. The latter is to work around a -bug in cabal. +In addition there are [hgeometry-examples](hgeometry-examples) and +[hgeometry-showcase](hgeometry-showcase) packages that define some +example applications, and a hgometry-test package that contains all +testcases. The latter is to work around a bug in cabal. Available Geometric Algorithms ------------------------------ @@ -79,7 +81,7 @@ polygons, distance of two sequences of points (curves) of length *n* and *m*, respectively. * an *O(n)* time single-source shortest path algorithm on triangulated polygons. -* an *O(n log n)* time algorithm for generating uniformly random convex polygons. +* an *O(n log n)* time algorithm for generating random convex polygons. * an *O(n)* time algorithm for finding the convex hull of a simple polygon. Available Geometric Data Structures @@ -91,11 +93,13 @@ structures. In particular, * A one dimensional Segment Tree. The base tree is static. * A one dimensional Interval Tree. The base tree is static. * A KD-Tree. The base tree is static. +* An *O(n log n)* size planar point location data structure supporting + *O(log n)* queries. There is also support for working with planar subdivisions. As a result, [hgeometry-combinatorial] also includes a data structure for working with planar graphs. In particular, it has an `EdgeOracle` data -structure, that can be built in \(O(n)\) time that can test if the +structure, that can be built in *O(n)* time that can test if the planar graph contains an edge in constant time. @@ -125,14 +129,11 @@ can give us. Hence, we choose to work with concrete types. To still allow for some extensibility our types will use the Ext (:+) type, as defined in the hgeometry-combinatorial package. For example, -our `Polygon` data type, has an extra type parameter `p` that allows -the vertices of the polygon to cary some extra information of type `p` -(for example a color, a size, or whatever). +our `LineSegment` data type, has an extra type parameter `p` that +allows the vertices of the line segment to carry some extra +information of type `p` (for example a color, a size, or +whatever). Polylines, Polylygons, Boxes, etc have similar such +parameters. -```haskell -data Polygon (t :: PolygonType) p r where - SimplePolygon :: CircularVector (Point 2 r :+ p) -> Polygon Simple p r - MultiPolygon :: CircularVector (Point 2 r :+ p) -> [Polygon Simple p r] -> Polygon Multi p r -``` In all places this extra data is accessable by the (:+) type in Data.Ext, which is essentially just a pair. diff --git a/hgeometry/RELEASE-0.12.md b/hgeometry/RELEASE-0.12.md index 98de737df..10a938cd0 100644 --- a/hgeometry/RELEASE-0.12.md +++ b/hgeometry/RELEASE-0.12.md @@ -1,4 +1,4 @@ -It is my great pleasure to announce version 0.12 of HGeometry! +It is our great pleasure to announce version 0.12 of HGeometry! HGeometry is a swiss army knife for computation geometry. Wondering if a point is inside a polygon? HGeometry will tell you. Looking for the shortest path @@ -35,7 +35,7 @@ Future developments: - Benchmarks to show the relative performance of HGeometry's many algorithms. Contributors: - - Frank Staals, @noita + - Frank Staals, @noinia - David Himmelstrup, @Lemmih - Hunter DeMeyer, @1ndy diff --git a/hgeometry/changelog.org b/hgeometry/changelog.org index fb9b10453..088721f11 100644 --- a/hgeometry/changelog.org +++ b/hgeometry/changelog.org @@ -9,18 +9,24 @@ - Hide polygon implementation details. - Enforce CCW polygon order by default. - Fix bug in Data.Geometry.Polygon.Convex.extremes/maxInDirection. +- Fix bug in pointInPolygon in case of degenerate situations. - Fix Read/Show instances for Point and Polygon such that 'read.show = id'. - Improved numerical robustness. - Random generation of monotone polygons. Thanks to @1ndy. - Random and uniform generation of convex polygons. -- New algorithm: Visibility polygon in O(n log n). -- New algorithm: Earclip triangulation in O(n^2) worst case, O(n) expected case. -- New algorithm: Single-source shortest path in O(n). -- New algorithm: Planar point locator in O(log n). -- New algorithm: Point set diameter in O(n log n). -- New algorithm: Convex hull of a polygon in O(n). -- New algorithm: Diameter of a convex polygon in O(n). -- New algorithm: Check if a point lies inside a convex polygon in O(n). +- More IsIntersectableWith instances +- Updated Show/Read instances for LineSegments +- New algorithm: Visibility polygon in O(n log n) time. +- New algorithm: Earclip triangulation in O(n^2) time worst case, O(n) + time expected case. +- New algorithm: Single-source shortest path in O(n) time. +- New algorithm: Planar point locator in O(log n) time. +- New algorithm: Point set diameter in O(n log n) time. +- New algorithm: Convex hull of a polygon in O(n) time. +- New algorithm: Diameter of a convex polygon in O(n) time. +- New algorithm: Check if a point lies inside a convex polygon in O(n) + time. +- New algorithm: Discrete Frechet distance in O(n^2) time. ** 0.11