hgeometry-ipe: Reading and Writing ipe7 files.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.


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

[Skip to ReadMe]


Change logNone available
Dependenciesaeson (>=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]
AuthorFrank Staals
Home pagehttps://fstaals.net/software/hgeometry
Source repositoryhead: git clone https://github.com/noinia/hgeometry
UploadedWed Oct 16 19:50:33 UTC 2019 by FrankStaals




Maintainers' 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.