|
206 | 206 | @test widths(r) == Vec2(0)
|
207 | 207 | @test area(r) == 0
|
208 | 208 | @test volume(r) == 0
|
| 209 | + @test union(r, Rect2f(1,1,2,2)) == Rect2f(1,1,2,2) |
| 210 | + @test union(Rect2f(1,1,2,2), r) == Rect2f(1,1,2,2) |
| 211 | + @test update(r, Vec2f(1,1)) == Rect2f(1,1,0,0) |
209 | 212 |
|
210 | 213 | a = Rect(Vec(0, 1), Vec(2, 3))
|
211 | 214 | pt_expa = Point{2,Int}[(0, 1), (2, 1), (2, 4), (0, 4)]
|
|
221 | 224 | @test widths(a) == Vec(2,3)
|
222 | 225 | @test area(a) == 2*3
|
223 | 226 | @test volume(a) == 2*3
|
| 227 | + @test union(a, Rect2f(1,1,2,2)) == Rect2f(0,1,3,3) |
| 228 | + @test union(Rect2f(1,1,2,2), a) == Rect2f(0,1,3,3) |
| 229 | + @test update(a, Vec2f(0,0)) == Rect2f(0,0,2,4) |
224 | 230 |
|
225 | 231 | b = Rect(Vec(1, 2, 3), Vec(4, 5, 6))
|
226 | 232 | pt_expb = Point{3, Int64}[[1, 2, 3], [1, 2, 9], [1, 7, 3], [1, 7, 9],
|
|
235 | 241 | @test widths(b) == Vec(4,5,6)
|
236 | 242 | @test_throws MethodError area(b)
|
237 | 243 | @test volume(b) == 4*5*6
|
| 244 | + @test union(b, Rect3f(1,1,1,2,2,2)) == Rect3f(1,1,1, 4,6,8) |
| 245 | + @test union(Rect3f(1,1,1,2,2,2), b) == Rect3f(1,1,1, 4,6,8) |
| 246 | + @test update(b, Vec3f(0)) == Rect3f(0,0,0,5,7,9) |
| 247 | + |
238 | 248 |
|
239 | 249 | mesh = normal_mesh(b)
|
240 | 250 | @test faces(mesh) == GLTriangleFace[
|
|
0 commit comments