From 09460618de02e003e1908cf8d289de88429dc96a Mon Sep 17 00:00:00 2001 From: Frank Staals Date: Wed, 18 Dec 2024 23:17:28 +0100 Subject: [PATCH] the actual demo :) --- hgeometry-examples/triangulateWorld/Main.hs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/hgeometry-examples/triangulateWorld/Main.hs b/hgeometry-examples/triangulateWorld/Main.hs index 37eae7234..a220ad52a 100644 --- a/hgeometry-examples/triangulateWorld/Main.hs +++ b/hgeometry-examples/triangulateWorld/Main.hs @@ -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|]