|
52 | 52 | end |
53 | 53 |
|
54 | 54 | @testset "Primitives" begin |
55 | | - # issue #16 |
56 | | - #m = HomogenousMesh{Point{3,Float64},Face{3, Int}}(Sphere(Point(0,0,0), 1)) |
57 | | - #@fact length(vertices(m)) --> 145 |
58 | | - #@fact length(faces(m)) --> 288 |
| 55 | + m = GLNormalMesh(Sphere(Point3f0(0), 1f0)) |
| 56 | + @test length(vertices(m)) == 145 |
| 57 | + @test length(faces(m)) == 288 |
| 58 | + |
59 | 59 | end |
60 | 60 |
|
61 | 61 |
|
@@ -173,23 +173,15 @@ end |
173 | 173 | mesh = PlainMesh{eltype(VT), FT}(vertices=vs, faces=fs) |
174 | 174 | @test convert(GLNormalMesh, mesh) == GLNormalMesh(vs, fs) |
175 | 175 | end |
| 176 | +@testset "construction" begin |
| 177 | + VT = vertextype(GLNormalMesh) |
| 178 | + FT = facetype(GLNormalMesh) |
| 179 | + vs = [VT(0., 0, 0), VT(1., 0, 0), VT(0., 1, 0)] |
| 180 | + fs = [FT(1, 2, 3)] |
176 | 181 |
|
| 182 | + # test for https://github.com/JuliaGeometry/GeometryTypes.jl/issues/92 |
| 183 | + m = HomogenousMesh(vs, fs) |
| 184 | + @test HomogenousMesh(m) == m |
177 | 185 | end |
178 | 186 |
|
179 | | - |
180 | | -using GeometryTypes |
181 | | -attributes = Dict{Symbol, Any}() |
182 | | -attributes[:faces] = GLTriangle[(1,2,3), (3, 2, 1)] |
183 | | -attributes[:vertices] = rand(Point3f0, 3) |
184 | | -attributes[:normals] = rand(Normal{3, Float32}, 3) |
185 | | -@which HomogenousMesh(attributes) |
186 | | -# M = HomogenousMesh |
187 | | -# attribs = attributes |
188 | | -# newfields = map(fieldnames(HomogenousMesh)) do field |
189 | | -# target_type = fieldtype(M, field) |
190 | | -# default = fieldtype(HomogenousMesh, field) <: Vector ? Void[] : nothing |
191 | | -# get(attribs, field, default) |
192 | | -# end |
193 | | - |
194 | | -x = GeometryTypes.homogenousmesh(attributes) |
195 | | -GLNormalMesh(x) |
| 187 | +end |
0 commit comments