HALFEDGE: optimize buildHeEdgeFromStr

It's faster this way than using buildHeEdge.
This commit is contained in:
hasufell 2015-02-09 16:12:19 +01:00
parent 4ebd842d2b
commit c22c00cb2d
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
1 changed files with 6 additions and 3 deletions

View File

@ -191,8 +191,11 @@ buildHeEdge pts fs
-- |Build the HeEdge data structure from the .obj mesh file contents.
buildHeEdgeFromStr :: B.ByteString -- ^ contents of an .obj mesh file
-> Maybe (HeEdge PT)
-> HeEdge PT
buildHeEdgeFromStr bmesh =
let pts = meshVertices bmesh
fs = meshFaces bmesh
in buildHeEdge pts fs
faces' = indirectHeFaces . meshFaces $ bmesh
edges = indirectHeEdges faces'
verts = indirectHeVerts pts edges
in indirectToDirect pts edges faces' verts