hgeometry-ipe: Reading and Writing ipe7 files.

[ bsd3, geometry, library ] [ Propose Tags ]

Reading and Writing ipe7 files and converting them to and from HGeometry types.

[Skip to Readme]
Versions [faq],,
Dependencies aeson (>=1.0), base (>=4.11 && <5), bifunctors (>=4.1), bytestring (>=0.10), colour (>=2.3.3), containers (>=0.5.5), data-clist (>=, deepseq (>=1.1), dlist (>=0.7), fingertree (>=0.1), fixed-vector (>=1.0), hexpat (>=0.20.9), hgeometry (>=, hgeometry-combinatorial (>=, lens (>=4.2), linear (>=1.10), MonadRandom (>=0.5), mtl, parsec (>=3), QuickCheck (>=2.5), quickcheck-instances (>=0.3), random, reflection (>=2.1), semigroupoids (>=5), semigroups (>=0.18), singletons (>=2.0), template-haskell, text (>=, vector (>=0.11), vinyl (>=0.10), yaml (>=0.8) [details]
License BSD-3-Clause
Author Frank Staals
Maintainer frank@fstaals.net
Category Geometry
Home page https://fstaals.net/software/hgeometry
Source repo head: git clone https://github.com/noinia/hgeometry
Uploaded by FrankStaals at 2020-07-27T19:55:51Z
Distributions NixOS:
Downloads 1610 total (120 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2020-07-27 [all 1 reports]


[Index] [Quick Jump]


Maintainer's Corner

For package maintainers and hackage trustees

Readme for hgeometry-ipe-

[back to package description]


This package provides an API for reading and writing Ipe (http://ipe.otfried.org) files. This is all very work in progress. Hence, the API is experimental and may change at any time!

Here is an example showing reading a set of points from an Ipe file, computing the DelaunayTriangulation, and writing the result again to an output file

mainWith                          :: Options -> IO ()
mainWith (Options inFile outFile) = do
    ePage <- readSinglePageFile inFile
    case ePage of
      Left err                         -> print err
      Right (page :: IpePage Rational) -> case page^..content.traverse._IpeUse of
        []         -> putStrLn "No points found"
        syms@(_:_) -> do
           let pts  = syms&traverse.core %~ (^.symbolPoint)
               pts' = NonEmpty.fromList pts
               dt   = delaunayTriangulation $ pts'
               out  = [iO $ drawTriangulation dt]
           writeIpeFile outFile . singlePageFromContent $ out

See the hgeometry-examples package for more examples.