|
192 | 192 | @test widths(r) == Vec(-Inf, -Inf)
|
193 | 193 | @test area(r) == Inf
|
194 | 194 | @test volume(r) == Inf
|
| 195 | + # TODO: broken? returns NaN widths |
| 196 | + # @test union(r, Rect2f(1,1,2,2)) == Rect2f(1,1,2,2) |
| 197 | + # @test union(Rect2f(1,1,2,2), r) == Rect2f(1,1,2,2) |
| 198 | + @test update(r, Vec2f(1,1)) == Rect2f(1,1,0,0) |
195 | 199 |
|
196 | 200 | a = Rect(Vec(0, 1), Vec(2, 3))
|
197 | 201 | pt_expa = Point{2,Int}[(0, 1), (2, 1), (2, 4), (0, 4)]
|
|
207 | 211 | @test widths(a) == Vec(2,3)
|
208 | 212 | @test area(a) == 2*3
|
209 | 213 | @test volume(a) == 2*3
|
| 214 | + @test union(a, Rect2f(1,1,2,2)) == Rect2f(0,1,3,3) |
| 215 | + @test union(Rect2f(1,1,2,2), a) == Rect2f(0,1,3,3) |
| 216 | + @test update(a, Vec2f(0,0)) == Rect2f(0,0,2,4) |
210 | 217 |
|
211 | 218 | b = Rect(Vec(1, 2, 3), Vec(4, 5, 6))
|
212 | 219 | pt_expb = Point{3, Int64}[[1, 2, 3], [1, 2, 9], [1, 7, 3], [1, 7, 9],
|
|
221 | 228 | @test widths(b) == Vec(4,5,6)
|
222 | 229 | @test_throws MethodError area(b)
|
223 | 230 | @test volume(b) == 4*5*6
|
| 231 | + @test union(b, Rect3f(1,1,1,2,2,2)) == Rect3f(1,1,1, 4,6,8) |
| 232 | + @test union(Rect3f(1,1,1,2,2,2), b) == Rect3f(1,1,1, 4,6,8) |
| 233 | + @test update(b, Vec3f(0)) == Rect3f(0,0,0,5,7,9) |
| 234 | + |
224 | 235 |
|
225 | 236 | mesh = normal_mesh(b)
|
226 | 237 | @test faces(mesh) == GLTriangleFace[
|
|
0 commit comments