convexHullNd-0.1.0.0: Convex hull
Copyright(c) Stéphane Laurent 2023
LicenseGPL-3
Maintainerlaurent_step@outlook.fr
Safe HaskellSafe-Inferred
LanguageHaskell2010

Geometry.ConvexHull

Description

See README for examples.

Synopsis

Documentation

class HasCenter m where Source #

Methods

_center :: m -> [Double] Source #

Instances

Instances details
HasCenter Facet Source # 
Instance details

Defined in Geometry.ConvexHull.Types

Methods

_center :: Facet -> [Double] Source #

class HasVolume m where Source #

Methods

_volume :: m -> Double Source #

Instances

Instances details
HasVolume Facet Source # 
Instance details

Defined in Geometry.ConvexHull.Types

Methods

_volume :: Facet -> Double Source #

class HasEdges m where Source #

Methods

_edges :: m -> EdgeMap Source #

Instances

Instances details
HasEdges ConvexHull Source # 
Instance details

Defined in Geometry.ConvexHull.Types

HasEdges Facet Source # 
Instance details

Defined in Geometry.ConvexHull.Types

Methods

_edges :: Facet -> EdgeMap Source #

HasEdges Ridge Source # 
Instance details

Defined in Geometry.ConvexHull.Types

Methods

_edges :: Ridge -> EdgeMap Source #

class HasVertices m where Source #

Methods

_vertices :: m -> IndexMap [Double] Source #

Instances

Instances details
HasVertices ConvexHull Source # 
Instance details

Defined in Geometry.ConvexHull.Types

HasVertices Facet Source # 
Instance details

Defined in Geometry.ConvexHull.Types

HasVertices Ridge Source # 
Instance details

Defined in Geometry.ConvexHull.Types

class HasNormal m where Source #

Methods

_normal :: m -> [Double] Source #

_offset :: m -> Double Source #

Instances

Instances details
HasNormal Facet Source # 
Instance details

Defined in Geometry.ConvexHull.Types

class HasFamily m where Source #

Methods

_family :: m -> Family Source #

Instances

Instances details
HasFamily Facet Source # 
Instance details

Defined in Geometry.ConvexHull.Types

Methods

_family :: Facet -> Family Source #

data Family Source #

Constructors

Family Int 
None 

Instances

Instances details
Read Family Source # 
Instance details

Defined in Geometry.Qhull.Types

Show Family Source # 
Instance details

Defined in Geometry.Qhull.Types

Eq Family Source # 
Instance details

Defined in Geometry.Qhull.Types

Methods

(==) :: Family -> Family -> Bool #

(/=) :: Family -> Family -> Bool #

data IndexPair Source #

Constructors

Pair Index Index 

Instances

Instances details
Read IndexPair Source # 
Instance details

Defined in Geometry.Qhull.Types

Show IndexPair Source # 
Instance details

Defined in Geometry.Qhull.Types

Eq IndexPair Source # 
Instance details

Defined in Geometry.Qhull.Types

Hashable IndexPair Source # 
Instance details

Defined in Geometry.Qhull.Types

type Index = Int Source #

verticesIds :: HasVertices a => a -> [Index] Source #

vertices ids

verticesCoordinates :: HasVertices a => a -> [[Double]] Source #

vertices coordinates

nVertices :: HasVertices a => a -> Int Source #

number of vertices

edgesIds :: HasEdges a => a -> [IndexPair] Source #

edges ids

edgesIds' :: HasEdges a => a -> [(Index, Index)] Source #

edges ids as pairs of integers

edgesCoordinates :: HasEdges a => a -> [([Double], [Double])] Source #

edges coordinates

nEdges :: HasEdges a => a -> Int Source #

number of edges

isEdge :: HasEdges a => a -> (Index, Index) -> Bool Source #

whether a pair of vertices indices form an edge; the order of the indices has no importance

toPoints :: HasEdges a => a -> (Index, Index) -> Maybe ([Double], [Double]) Source #

edge as pair of points; the order of the vertices has no importance

toPoints' :: HasEdges a => a -> (Index, Index) -> ([Double], [Double]) Source #

edge as pair of points, without checking the edge exists

data Facet Source #

Instances

Instances details
Show Facet Source # 
Instance details

Defined in Geometry.ConvexHull.Types

Methods

showsPrec :: Int -> Facet -> ShowS #

show :: Facet -> String #

showList :: [Facet] -> ShowS #

HasCenter Facet Source # 
Instance details

Defined in Geometry.ConvexHull.Types

Methods

_center :: Facet -> [Double] Source #

HasEdges Facet Source # 
Instance details

Defined in Geometry.ConvexHull.Types

Methods

_edges :: Facet -> EdgeMap Source #

HasFamily Facet Source # 
Instance details

Defined in Geometry.ConvexHull.Types

Methods

_family :: Facet -> Family Source #

HasNormal Facet Source # 
Instance details

Defined in Geometry.ConvexHull.Types

HasVertices Facet Source # 
Instance details

Defined in Geometry.ConvexHull.Types

HasVolume Facet Source # 
Instance details

Defined in Geometry.ConvexHull.Types

Methods

_volume :: Facet -> Double Source #

data Ridge Source #

Constructors

Ridge 

Instances

Instances details
Show Ridge Source # 
Instance details

Defined in Geometry.ConvexHull.Types

Methods

showsPrec :: Int -> Ridge -> ShowS #

show :: Ridge -> String #

showList :: [Ridge] -> ShowS #

HasEdges Ridge Source # 
Instance details

Defined in Geometry.ConvexHull.Types

Methods

_edges :: Ridge -> EdgeMap Source #

HasVertices Ridge Source # 
Instance details

Defined in Geometry.ConvexHull.Types

data Vertex Source #

Instances

Instances details
Show Vertex Source # 
Instance details

Defined in Geometry.ConvexHull.Types

convexHull Source #

Arguments

:: [[Double]]

vertices

-> Bool

whether to triangulate

-> Bool

whether to print output to stdout

-> Maybe FilePath

write summary to a file

-> IO ConvexHull 

hullSummary :: ConvexHull -> String Source #

convex hull summary

hullVolume :: ConvexHull -> Double Source #

volume of the convex hull (area in dimension 2, volume in dimension 3, hypervolume in higher dimension)

edgeOf :: ConvexHull -> (Index, Index) -> [Int] Source #

facets ids an edge belongs to

facetRidges :: ConvexHull -> Facet -> IntMap Ridge Source #

ridges of a facet

facetsVerticesIds :: ConvexHull -> [[Index]] Source #

vertices ids of all facets

ridgesVerticesIds :: ConvexHull -> [[Index]] Source #

vertices ids of all ridges

groupedFacets :: ConvexHull -> [(Family, [IndexMap [Double]], [EdgeMap])] Source #

group facets of the same family

groupedFacets' :: ConvexHull -> [(Family, IndexMap [Double], EdgeMap)] Source #

group facets of the same family and merge vertices and edges

facetToPolygon :: Facet -> ([(Index, [Double])], Bool) Source #

for 3D only, orders the vertices of the facet (i.e. provides a polygon); also returns a Boolean indicating the orientation of the vertices

facetToPolygon' :: Facet -> [(Index, [Double])] Source #

for 3D only, orders the vertices of the facet (i.e. provides a polygon) in anticlockwise orientation

ridgeToPolygon :: Ridge -> [(Index, [Double])] Source #

for 4D only, orders the vertices of a ridge (i.e. provides a polygon)

hullToSTL :: ConvexHull -> FilePath -> IO () Source #

for 3D only, convert the convex hull to a STL file; the STL format is valid for triangle meshes only