@@ -28,16 +28,16 @@ using Test, GeometryBasics
28
28
(7.535533905932738 , 1.4644660940672627 , 6.0 ),
29
29
(6.041241452319315 , 7.041241452319315 , 1.9175170953613705 ),
30
30
(0.46446609406726314 , 8.535533905932738 , 6.0 ),
31
- (1.9587585476806848 , 2.9587585476806857 , 10.08248290463863 ),
32
- (1 , 2 , 3 ),
31
+ (1.9587585476806848 , 2.9587585476806857 , 10.08248290463863 ),
32
+ (1 , 2 , 3 ),
33
33
(4 , 5 , 6 )
34
34
]
35
35
36
36
@test decompose (Point3{Float64}, Tessellation (s, 8 )) ≈ positions
37
37
38
38
_faces = TriangleFace[
39
- (9 , 2 , 1 ), (9 , 3 , 2 ), (9 , 4 , 3 ), (9 , 1 , 4 ), (1 , 2 , 6 ), (1 , 6 , 5 ),
40
- (2 , 3 , 7 ), (2 , 7 , 6 ), (3 , 4 , 8 ), (3 , 8 , 7 ), (4 , 1 , 5 ), (4 , 5 , 8 ),
39
+ (9 , 2 , 1 ), (9 , 3 , 2 ), (9 , 4 , 3 ), (9 , 1 , 4 ), (1 , 2 , 6 ), (1 , 6 , 5 ),
40
+ (2 , 3 , 7 ), (2 , 7 , 6 ), (3 , 4 , 8 ), (3 , 8 , 7 ), (4 , 1 , 5 ), (4 , 5 , 8 ),
41
41
(10 , 5 , 6 ), (10 , 6 , 7 ), (10 , 7 , 8 ), (10 , 8 , 5 )]
42
42
43
43
@test _faces == decompose (TriangleFace{Int}, Tessellation (s, 8 ))
@@ -46,7 +46,7 @@ using Test, GeometryBasics
46
46
@test m === triangle_mesh (m)
47
47
@test GeometryBasics. faces (m) == decompose (GLTriangleFace, _faces)
48
48
@test GeometryBasics. coordinates (m) ≈ positions
49
-
49
+
50
50
m = normal_mesh (s) # just test that it works without explicit resolution parameter
51
51
@test hasproperty (m, :position )
52
52
@test hasproperty (m, :normal )
@@ -56,15 +56,15 @@ using Test, GeometryBasics
56
56
57
57
ns = GeometryBasics. FaceView (
58
58
Vec{3 , Float32}[
59
- [0.70710677 , - 0.70710677 , 0.0 ], [0.4082483 , 0.4082483 , - 0.8164966 ],
60
- [- 0.70710677 , 0.70710677 , - 9.9991995f-17 ], [- 0.4082483 , - 0.4082483 , 0.8164966 ],
59
+ [0.70710677 , - 0.70710677 , 0.0 ], [0.4082483 , 0.4082483 , - 0.8164966 ],
60
+ [- 0.70710677 , 0.70710677 , - 9.9991995f-17 ], [- 0.4082483 , - 0.4082483 , 0.8164966 ],
61
61
[- 0.57735026 , - 0.57735026 , - 0.57735026 ], [0.57735026 , 0.57735026 , 0.57735026 ]
62
62
], [
63
- GLTriangleFace (5 , 5 , 5 ), GLTriangleFace (5 , 5 , 5 ),
64
- GLTriangleFace (5 , 5 , 5 ), GLTriangleFace (5 , 5 , 5 ),
65
- QuadFace {Int64} (1 , 2 , 2 , 1 ), QuadFace {Int64} (2 , 3 , 3 , 2 ),
66
- QuadFace {Int64} (3 , 4 , 4 , 3 ), QuadFace {Int64} (4 , 1 , 1 , 4 ),
67
- GLTriangleFace (6 , 6 , 6 ), GLTriangleFace (6 , 6 , 6 ),
63
+ GLTriangleFace (5 , 5 , 5 ), GLTriangleFace (5 , 5 , 5 ),
64
+ GLTriangleFace (5 , 5 , 5 ), GLTriangleFace (5 , 5 , 5 ),
65
+ QuadFace {Int64} (1 , 2 , 2 , 1 ), QuadFace {Int64} (2 , 3 , 3 , 2 ),
66
+ QuadFace {Int64} (3 , 4 , 4 , 3 ), QuadFace {Int64} (4 , 1 , 1 , 4 ),
67
+ GLTriangleFace (6 , 6 , 6 ), GLTriangleFace (6 , 6 , 6 ),
68
68
GLTriangleFace (6 , 6 , 6 ), GLTriangleFace (6 , 6 , 6 )
69
69
]
70
70
)
84
84
@test decompose (Point2f, mesh) == pt_expa
85
85
86
86
b = Rect (Vec (1 , 1 , 1 ), Vec (1 , 1 , 1 ))
87
- pt_expb = Point{3 ,Int64}[[1 , 1 , 1 ], [1 , 1 , 2 ], [1 , 2 , 1 ], [1 , 2 , 2 ],
88
- [2 , 1 , 1 ], [2 , 1 , 2 ], [2 , 2 , 1 ], [2 , 2 , 2 ]]
87
+ pt_expb = Point{3 ,Int64}[[1 , 1 , 1 ], [1 , 1 , 2 ], [1 , 2 , 1 ], [1 , 2 , 2 ],
88
+ [2 , 1 , 1 ], [2 , 1 , 2 ], [2 , 2 , 1 ], [2 , 2 , 2 ]]
89
89
@test decompose (Point{3 ,Int}, b) == pt_expb
90
-
91
90
92
91
mesh = normal_mesh (b)
93
92
@test faces (mesh) == GLTriangleFace[
94
- (1 , 2 , 4 ), (1 , 4 , 3 ), (7 , 8 , 6 ), (7 , 6 , 5 ), (5 , 6 , 2 ), (5 , 2 , 1 ),
93
+ (1 , 2 , 4 ), (1 , 4 , 3 ), (7 , 8 , 6 ), (7 , 6 , 5 ), (5 , 6 , 2 ), (5 , 2 , 1 ),
95
94
(3 , 4 , 8 ), (3 , 8 , 7 ), (1 , 3 , 7 ), (1 , 7 , 5 ), (6 , 8 , 4 ), (6 , 4 , 2 )]
96
95
@test normals (mesh) == GeometryBasics. FaceView (
97
- Vec{3 , Float32}[[- 1.0 , 0.0 , 0.0 ], [1.0 , 0.0 , 0.0 ], [0.0 , - 1.0 , 0.0 ], [0.0 , 1.0 , 0.0 ], [0.0 , 0.0 , - 1.0 ], [0.0 , 0.0 , 1.0 ]],
96
+ Vec{3 , Float32}[[- 1.0 , 0.0 , 0.0 ], [1.0 , 0.0 , 0.0 ], [0.0 , - 1.0 , 0.0 ], [0.0 , 1.0 , 0.0 ], [0.0 , 0.0 , - 1.0 ], [0.0 , 0.0 , 1.0 ]],
98
97
GLTriangleFace[(1 , 1 , 1 ), (1 , 1 , 1 ), (2 , 2 , 2 ), (2 , 2 , 2 ), (3 , 3 , 3 ), (3 , 3 , 3 ), (4 , 4 , 4 ), (4 , 4 , 4 ), (5 , 5 , 5 ), (5 , 5 , 5 ), (6 , 6 , 6 ), (6 , 6 , 6 )]
99
98
)
100
99
@test coordinates (mesh) == Point{3 , Float32}[
101
- [1.0 , 1.0 , 1.0 ], [1.0 , 1.0 , 2.0 ], [1.0 , 2.0 , 1.0 ], [1.0 , 2.0 , 2.0 ],
100
+ [1.0 , 1.0 , 1.0 ], [1.0 , 1.0 , 2.0 ], [1.0 , 2.0 , 1.0 ], [1.0 , 2.0 , 2.0 ],
102
101
[2.0 , 1.0 , 1.0 ], [2.0 , 1.0 , 2.0 ], [2.0 , 2.0 , 1.0 ], [2.0 , 2.0 , 2.0 ]]
103
102
104
103
@test isempty (Rect {3,Float32} ())
248
247
h1 = Rect (0.0 , 0.0 , 1.0 , 1.0 )
249
248
h2 = Rect (1.0 , 1.0 , 2.0 , 2.0 )
250
249
@test union (h1, h2) isa GeometryBasics. HyperRectangle{2 ,Float64}
251
- # @test GeometryBasics.diff(h1, h2) == h1
250
+ # @test GeometryBasics.diff(h1, h2) == h1
252
251
@test GeometryBasics. intersect (h1, h2) isa GeometryBasics. HyperRectangle{2 ,Float64}
253
252
254
253
b = Rect (0.0 , 0.0 , 1.0 , 1.0 )
0 commit comments