Skip to content

Commit

Permalink
plywriter does something at least :)
Browse files Browse the repository at this point in the history
  • Loading branch information
noinia committed Nov 17, 2024
1 parent 076b7e9 commit 99176a0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
3 changes: 3 additions & 0 deletions hgeometry-examples/hgeometry-examples.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -289,5 +289,8 @@ executable hgeometry-lowerEnv
import: setup, miso-setup
hs-source-dirs: lowerEnv
main-is: Main.hs
build-depends:
hgeometry:ply-writer

-- other-modules:
-- Options
18 changes: 12 additions & 6 deletions hgeometry-examples/lowerEnv/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
module Main(main) where

import Control.Lens
import qualified Data.Foldable as F
import qualified Data.List.NonEmpty as NonEmpty
import HGeometry.Ext
import HGeometry.Number.Real.Rational
import HGeometry.Plane.LowerEnvelope
import HGeometry.PlaneGraph
import HGeometry.PlaneGraph.Instances
import HGeometry.Point
import HGeometry.Triangle
import HGeometry.VoronoiDiagram.ViaLowerEnvelope
import Ipe
import PLY.Writer
Expand All @@ -30,12 +32,16 @@ myPlanes = NonEmpty.fromList $ zipWith (\i p -> pointToPlane p :+ (i,p)) [0..]
, Point2 48 144
]

verticesOf = \case
ParallelStrips _ -> undefined
ConnectedEnvelope env -> undefined
verticesOf = NonEmpty.fromList . foldMap F.toList . trianglesOf
trianglesOf _ = [ Triangle (origin :+ 0) (Point3 10 0 1 :+ 1) (Point3 0 10 2 :+ 2) ]

trianglesOf env = []

-- \case
-- ParallelStrips _ -> undefined
-- ConnectedEnvelope env -> undefined

-- trianglesOf env = []

main :: IO ()
main = renderOutputToFile [osp|myLowerEnv|] (verticesOf $ lowerEnvelope myPlanes)
(trianglesOf $ lowerEnvelope myPlanes)
main = renderOutputToFile [osp|myLowerEnv.ply|] (verticesOf $ lowerEnvelope myPlanes)
(trianglesOf $ lowerEnvelope myPlanes)

0 comments on commit 99176a0

Please sign in to comment.