Skip to content

Commit

Permalink
the actual demo :)
Browse files Browse the repository at this point in the history
  • Loading branch information
noinia committed Dec 18, 2024
1 parent 4cc4635 commit 0946061
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion hgeometry-examples/triangulateWorld/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,28 @@ mainWith (Options inFile outFile) = do
mapM_ print $ take 100 $ F.toList $ intersections'
putStrLn $ "number of non-self intersecting polygons: " <> show (length polies')

mapM_ (print . numVertices) polies'
-- mapM_ (print . numVertices) polies'

putStrLn "# triangles: "
print (length $ triangles')
writeIpeFile outFile' . singlePageFromContent $ out


-- let preFile = [osp|/tmp/out.ipe|]
-- forM_ (zip [0..] polies') $ \(i,poly :+ ats) -> do
-- is <- encodeFS (show i)
-- let outFileI = [osp|/tmp/triangulatedpolies|] <> is <> [osp|.ipe|]
-- subdiv = triangulate poly :: PlaneGraph PX (Point 2 R) _ _
-- writeIpeFile preFile . singlePageFromContent $
-- mconcat [ [ iO $ ipePolygon poly ! ats ]
-- ]
-- -- print poly
-- writeIpeFile outFileI . singlePageFromContent $
-- mconcat [ [ iO $ ipePolygon poly ! ats ]
-- , [ iO $ ipePolygon tri | tri <- subdiv^..interiorFacePolygons ]
-- ]


-- forM_ (zip [0..] nonPolies) $ \(i,poly :+ ats) -> do
-- is <- encodeFS (show i)
-- let outFileI = [osp|/tmp/self_intersection|] <> is <> [osp|.ipe|]
Expand Down

0 comments on commit 0946061

Please sign in to comment.