hgeometry-0.10.0.0: Geometric Algorithms, Data structures, and Data types.

Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageHaskell2010

Data.Geometry.PlanarSubdivision.Merge

Description

Description : Functions for merging two planar subdivisions

Synopsis

Documentation

merge :: PlanarSubdivision s v e f r -> PlanarSubdivision s v e f r -> PlanarSubdivision s v e f r Source #

Merge a pair of *disjoint* planar subdivisions, unifying their outer face. For the outerface data it simply takes the data of the first subdivision.

runningtime: \(O(n)\)

mergeWith Source #

Arguments

:: (f -> f -> f)

how to merge the data of the outer face

-> PlanarSubdivision s v e f r 
-> PlanarSubdivision s v e f r 
-> PlanarSubdivision s v e f r 

Merge a pair of *disjoint* planar subdivisions. In particular, this function unifies the structure assuming that the two subdivisions share the outer face.

runningtime: \(O(n)\)

mergeAllWith :: Foldable1 t => (f -> f -> f) -> t (PlanarSubdivision s v e f r) -> PlanarSubdivision s v e f r Source #

Merge a pair of *disjoint* planar subdivisions, unifying their outer face. The given function is used to merge the data corresponding to the outer face. The subdivisions are merged pairwise, no guarantees are given about the order in which they are merged. Hence, it is expected that f is commutative.

running time: \(O(n\log n)\), where \(n\) is the total size of the subdivisions.

embedAsHoleIn Source #

Arguments

:: PlanarSubdivision h v e f r

The hole

-> (f -> f -> f)

How to merge the face data (hole value first)

-> FaceId' s

Face in which to embed the given subdivisions

-> PlanarSubdivision s v e f r

the outer subdivision

-> PlanarSubdivision s v e f r 

embedAsHolesIn Source #

Arguments

:: (Foldable1 t, Functor t) 
=> t (PlanarSubdivision h v e f r)

The disjoint "holes"

-> (t f -> f -> f)

How to merge the face data

-> FaceId' s

Face in which to embed the given subdivisions

-> PlanarSubdivision s v e f r

the outer subdivision

-> PlanarSubdivision s v e f r