|
1 | 1 | using Test, Random, OffsetArrays
|
2 | 2 | using GeometryBasics
|
3 | 3 | using LinearAlgebra
|
4 |
| -using GeometryBasics: MetaMesh, add_meta, pop_meta |
| 4 | +using GeometryBasics: MetaMesh |
5 | 5 | using GeoInterface
|
6 | 6 | using GeoJSON
|
7 | 7 | using Extents
|
|
203 | 203 | @test m.normals == [Vec3f(0, 0, 1) for p in coordinates(m)]
|
204 | 204 | end
|
205 | 205 |
|
206 |
| -@testset "convert mesh + meta" begin |
207 |
| - m = uv_normal_mesh(Rect3f(Vec3f(-1), Vec3f(1, 2, 3))) |
208 |
| - m_normal = add_meta(m; normals = decompose_normals(m)) |
209 |
| - # make sure we don't loose the uv |
210 |
| - @test hasproperty(m_normal, :uv) |
211 |
| - # Make sure we don't create any copies |
212 |
| - @test coordinates(m) === coordinates(m_normal) |
213 |
| - @test m.normals == m_normal.normals |
214 |
| - @test m.uv === m_normal.uv |
215 |
| - |
216 |
| - m = uv_mesh(Rect3f(Vec3f(-1), Vec3f(1, 2, 3))) |
217 |
| - m_normal = add_meta(m, normals = decompose_normals(m)) |
218 |
| - @test hasproperty(m_normal, :uv) |
219 |
| - @test coordinates(m) === coordinates(m_normal) |
220 |
| - @test decompose_normals(m) == GeometryBasics.normals(m_normal) |
221 |
| - # uv stays untouched, since we don't specify the element type in normalmesh |
222 |
| - @test m.uv === m_normal.uv |
223 |
| -end |
224 |
| - |
225 |
| -@testset "modifying meta" begin |
226 |
| - xx = rand(10) |
227 |
| - points = rand(Point3f, 10) |
228 |
| - m = MetaMesh(points, GLTriangleFace[(1,2,3), (3,4,5)]; xx=xx) |
229 |
| - color = rand(10) |
230 |
| - m = add_meta(m; color=color) |
231 |
| - |
232 |
| - @test hasproperty(m, :xx) |
233 |
| - @test hasproperty(m, :color) |
234 |
| - |
235 |
| - @test m.xx === xx |
236 |
| - @test m.color === color |
237 |
| - |
238 |
| - m, colpopt = GeometryBasics.pop_meta(m, :color) |
239 |
| - m, xxpopt = GeometryBasics.pop_meta(m, :xx) |
240 |
| - |
241 |
| - @test propertynames(m) == () |
242 |
| - @test colpopt === color |
243 |
| - @test xxpopt === xx |
244 |
| -end |
245 |
| - |
246 | 206 | @testset "mesh conversion" begin
|
247 | 207 | s = Sphere(Point3(0.0), 1.0)
|
248 | 208 | m = GeometryBasics.mesh(s)
|
|
0 commit comments