Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Point3D = (Int, Int, Int)
- newtype Vertex = Vertex {}
- newtype Edge = Edge {}
- newtype Facet = Facet {}
- newtype ConvexHull = ConvexHull {}
- data ConflictGraph
- convexHull3 :: [Point3D] -> Maybe ConvexHull
- fromConvexHull :: ConvexHull -> [Point3D]
- computeSegment :: [Point3D] -> Maybe [Point3D]
- computeTriangle :: [Point3D] -> Maybe [Point3D]
- computeTetrahedron :: [Point3D] -> Maybe [Point3D]
- fromVertices :: [Point3D] -> Facet
- isBetween3D :: [Point3D] -> Point3D -> Bool
- mergePoints :: [Point3D] -> [Point3D] -> [Point3D]
- fromFacet :: Facet -> [Point3D]
- isColinearIn3DFromList :: [Point3D] -> Bool
Data types
Edge as a pair of vertices. When constructing the initial tetrahedron, the order of the vertices must be counterclockwise.
Facet in this case is a 2-face. It is stored as a collection of edges.
newtype ConvexHull Source #
The convex hull of a set is the collection of all the facets that conform that polyhedron.
Instances
Eq ConvexHull Source # | |
Defined in Geometry.ConvexHull3 (==) :: ConvexHull -> ConvexHull -> Bool # (/=) :: ConvexHull -> ConvexHull -> Bool # | |
Show ConvexHull Source # | |
Defined in Geometry.ConvexHull3 showsPrec :: Int -> ConvexHull -> ShowS # show :: ConvexHull -> String # showList :: [ConvexHull] -> ShowS # |
data ConflictGraph Source #
The conflict graph is a data structure that stores for each point the list of facets that points views. And for every facet the list of points that facet views.
Instances
Show ConflictGraph Source # | |
Defined in Geometry.ConvexHull3 showsPrec :: Int -> ConflictGraph -> ShowS # show :: ConflictGraph -> String # showList :: [ConflictGraph] -> ShowS # |
Convex hull
convexHull3 :: [Point3D] -> Maybe ConvexHull Source #
Assume every point is different
fromConvexHull :: ConvexHull -> [Point3D] Source #
Computations of geometrical objects
fromVertices :: [Point3D] -> Facet Source #
Generates a facet from its vertices. Points must be ordered counterclockwise
Operations with points
mergePoints :: [Point3D] -> [Point3D] -> [Point3D] Source #
Merges two lists of points ensuring that the counterclockwise orientation remains.
Testing
Orphan instances
Num (Int, Int, Int) Source # | |
(+) :: (Int, Int, Int) -> (Int, Int, Int) -> (Int, Int, Int) # (-) :: (Int, Int, Int) -> (Int, Int, Int) -> (Int, Int, Int) # (*) :: (Int, Int, Int) -> (Int, Int, Int) -> (Int, Int, Int) # negate :: (Int, Int, Int) -> (Int, Int, Int) # abs :: (Int, Int, Int) -> (Int, Int, Int) # |