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.

[maintain] [Publish]

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


[Skip to Readme]

Properties

Versions 0.9.0.0, 0.9.0.0, 0.10.0.0, 0.11.0.0, 0.12.0.0, 0.13
Change log None available
Dependencies aeson (>=1.0), base (>=4.11 && <5), bifunctors (>=4.1), bytestring (>=0.10), colour (>=2.3.3), containers (>=0.5.5), data-clist (>=0.0.7.2), deepseq (>=1.1), dlist (>=0.7), fingertree (>=0.1), fixed-vector (>=1.0), hexpat (>=0.20.9), hgeometry (>=0.9.0.0), hgeometry-combinatorial (>=0.9.0.0), 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 (>=1.1.1.0), 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 2019-10-16T19:50:33Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for hgeometry-ipe-0.9.0.0

[back to package description]

HGeometry-ipe

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.