HALFEDGE: add pseudo-code for 'indirectToDirect'

This commit is contained in:
hasufell 2015-02-09 18:29:40 +01:00
parent 70ce5ca511
commit d45412ca3c
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020

View File

@ -134,6 +134,33 @@ indirectHeVerts hes' = go hes' Map.empty 0
-- |Tie the knots! -- |Tie the knots!
-- It is assumed that the list of points is indexed in order of their -- It is assumed that the list of points is indexed in order of their
-- appearance in the obj mesh file. -- appearance in the obj mesh file.
--
-- pseudo-code:
--
-- @
-- indirectToDirect :: [a] -> [IndirectHeEdge] -> [IndirectHeFace]
-- -> Map.IntMap IndirectHeVert -> HeEdge a
-- indirectToDirect points edgelist facelist vertmap
-- = thisEdge (head edgelist)
-- where
-- thisEdge edge
-- = HeEdge (thisVert (vertmap ! svindex edge) $ svindex edge)
-- (getOppEdge (svindex edge) $ indexf edge)
-- (thisFace $ facelist !! indexf edge)
-- (thisEdge $ edgelist !! (edgeindex edge + offsetedge edge))
-- thisFace face = HeFace $ thisEdge (edgelist !! (snd . head $ face))
-- thisVert vertice coordindex
-- = HeVert (points !! (coordindex - 1))
-- (thisEdge $ points !! (emedgeindex vertice - 1))
-- getOppEdge startverticeindex faceindex
-- = case headMay
-- . filter ((/=) faceindex . indexf)
-- . fmap (edgelist !!)
-- . edgelist
-- $ vertmap ! startverticeindex
-- of Just x -> thisEdge x
-- Nothing -> NoEdge
-- @
indirectToDirect :: [a] -- ^ list of points indirectToDirect :: [a] -- ^ list of points
-> [IndirectHeEdge] -> [IndirectHeEdge]
-> [IndirectHeFace] -> [IndirectHeFace]