Skip to content

Commit

Permalink
fixes and tests for 2dm
Browse files Browse the repository at this point in the history
Probably incorrect, waiting for input from @michelk
  • Loading branch information
SimonDanisch committed Sep 3, 2015
1 parent f3255e9 commit 9d9f3b1
Show file tree
Hide file tree
Showing 3 changed files with 35,746 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/io/2dm.jl
Expand Up @@ -13,9 +13,9 @@ function load(st::Stream{format"2DM"}, MeshType=GLNormalMesh)
if w[1] == "ND"
push!(vertices, Point{3, Float32}(w[3:end]))
elseif w[1] == "E3T"
push!(faces, Triangle{Cuint}(w[3:end]))
push!(faces, Face{3, Cuint, 0}(w[3:5]))
elseif w[1] == "E4Q"
push!(faces, Face{4, Cuint, 0}(w[3:end]))
push!(faces, triangulate(FT, Face{4, Cuint, 0}(w[3:6]))...)
else
continue
end
Expand Down
7 changes: 7 additions & 0 deletions test/runtests.jl
Expand Up @@ -86,5 +86,12 @@ facts("MeshIO") do
@fact length(vertices(msh)) --> 2248
@fact length(normals(msh)) --> 2248
end
context("2DM") do
msh = load(joinpath(tf, "test.2dm"))
@fact typeof(msh) --> GLNormalMesh
#@fact length(faces(msh)) --> 3954
#@fact length(vertices(msh)) --> 2248
#@fact length(normals(msh)) --> 2248
end
end
end

0 comments on commit 9d9f3b1

Please sign in to comment.