HALFEDGE: improve pseudo-code

This commit is contained in:
hasufell 2015-02-10 04:10:14 +01:00
parent 26e7817cfa
commit d9e0cb8fef
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
1 changed files with 17 additions and 14 deletions

View File

@ -138,26 +138,29 @@ indirectHeVerts hes' = go hes' Map.empty 0
-- pseudo-code: -- pseudo-code:
-- --
-- @ -- @
-- indirectToDirect :: [a] -> [IndirectHeEdge] -> [IndirectHeFace] -- indirectToDirect :: [a] -- parsed vertices, e.g. 2d points (Double, Double)
-- -> Map.IntMap IndirectHeVert -> HeEdge a -- -> [IndirectHeEdge]
-- indirectToDirect points edgelist facelist vertmap -- -> [IndirectHeFace]
-- = thisEdge (head edgelist) -- -> [IndirectHeVert]
-- -> HeEdge a
-- indirectToDirect points edges faces vertices
-- = thisEdge (head edges)
-- where -- where
-- thisEdge edge -- thisEdge edge
-- = HeEdge (thisVert (vertmap ! svindex edge) $ svindex edge) -- = HeEdge (thisVert (vertices !! svindex edge) $ svindex edge)
-- (getOppEdge (svindex edge) $ indexf edge) -- (thisOppEdge (svindex edge) $ indexf edge)
-- (thisFace $ facelist !! indexf edge) -- (thisFace $ faces !! indexf edge)
-- (thisEdge $ edgelist !! (edgeindex edge + offsetedge edge)) -- (thisEdge $ edges !! (edgeindex edge + offsetedge edge))
-- thisFace face = HeFace $ thisEdge (edgelist !! (snd . head $ face)) -- thisFace face = HeFace $ thisEdge (edges !! (head . snd $ face))
-- thisVert vertice coordindex -- thisVert vertice coordindex
-- = HeVert (points !! (coordindex - 1)) -- = HeVert (points !! (coordindex - 1))
-- (thisEdge $ points !! (emedgeindex vertice - 1)) -- (thisEdge $ points !! (emedgeindex vertice - 1))
-- getOppEdge startverticeindex faceindex -- thisOppEdge startverticeindex faceindex
-- = case headMay -- = case headMay
-- . filter ((/=) faceindex . indexf) -- . filter ((/=) faceindex . indexf)
-- . fmap (edgelist !!) -- . fmap (edges !!)
-- . edgelist -- . edgelist -- getter
-- $ vertmap ! startverticeindex -- $ vertices !! startverticeindex
-- of Just x -> thisEdge x -- of Just x -> thisEdge x
-- Nothing -> NoEdge -- Nothing -> NoEdge
-- @ -- @