| Copyright | (C) Frank Staals |
|---|---|
| License | see the LICENSE file |
| Maintainer | Frank Staals |
| Safe Haskell | None |
| Language | GHC2024 |
HGeometry.Polygon.WithHoles
Description
A simple type for representing polygonswith holes
Synopsis
- data PolygonalDomainF (h :: Type -> Type) (f :: Type -> Type) point = PolygonalDomain (SimplePolygonF f point) (h (SimplePolygonF f point))
- type PolygonalDomain point = PolygonalDomainF Vector (Cyclic NonEmptyVector) point
- asSimplePolygon :: forall (h :: Type -> Type) (f :: Type -> Type) point. (HasFromFoldable h, HoleContainer h f point) => Prism' (PolygonalDomainF h f point) (SimplePolygonF f point)
- outerBoundaryPolygon :: forall (h :: Type -> Type) (f1 :: Type -> Type) point f2. Functor f2 => (SimplePolygonF f1 point -> f2 (SimplePolygonF f1 point)) -> PolygonalDomainF h f1 point -> f2 (PolygonalDomainF h f1 point)
- theHoles :: forall h (f1 :: Type -> Type) point h' f2. Functor f2 => (h (SimplePolygonF f1 point) -> f2 (h' (SimplePolygonF f1 point))) -> PolygonalDomainF h f1 point -> f2 (PolygonalDomainF h' f1 point)
- type HoleContainer (h :: Type -> Type) (f :: Type -> Type) point = (TraversableWithIndex Int h, Index (h (SimplePolygonF f point)) ~ Int, IxValue (h (SimplePolygonF f point)) ~ SimplePolygonF f point, Ixed (h (SimplePolygonF f point)), VertexContainer f point)
Documentation
data PolygonalDomainF (h :: Type -> Type) (f :: Type -> Type) point Source #
Simple data type modelling polygons with holes
Constructors
| PolygonalDomain | |
Fields
| |
Instances
type PolygonalDomain point = PolygonalDomainF Vector (Cyclic NonEmptyVector) point Source #
Polygonal domain implemented using Vectors
asSimplePolygon :: forall (h :: Type -> Type) (f :: Type -> Type) point. (HasFromFoldable h, HoleContainer h f point) => Prism' (PolygonalDomainF h f point) (SimplePolygonF f point) Source #
interpret a simple polygon as a Polygonal domain.
outerBoundaryPolygon :: forall (h :: Type -> Type) (f1 :: Type -> Type) point f2. Functor f2 => (SimplePolygonF f1 point -> f2 (SimplePolygonF f1 point)) -> PolygonalDomainF h f1 point -> f2 (PolygonalDomainF h f1 point) Source #
The simple polygon representing the outer boundary
theHoles :: forall h (f1 :: Type -> Type) point h' f2. Functor f2 => (h (SimplePolygonF f1 point) -> f2 (h' (SimplePolygonF f1 point))) -> PolygonalDomainF h f1 point -> f2 (PolygonalDomainF h' f1 point) Source #
Lens to access the holes
type HoleContainer (h :: Type -> Type) (f :: Type -> Type) point = (TraversableWithIndex Int h, Index (h (SimplePolygonF f point)) ~ Int, IxValue (h (SimplePolygonF f point)) ~ SimplePolygonF f point, Ixed (h (SimplePolygonF f point)), VertexContainer f point) Source #
Containers that stores holes must satisfy the following constraints: