HALFEDGE: improve pseudo-code
This commit is contained in:
parent
26e7817cfa
commit
d9e0cb8fef
@ -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
|
||||||
-- @
|
-- @
|
||||||
|
Loading…
Reference in New Issue
Block a user