@@ -202,10 +202,36 @@ end
202202 points = decompose (Point2f0, circle, 20 )
203203 @test length (points) == 20
204204
205- # TODO circle mesh cant be 1:1 assembled from vertices + faces,
206- # since middle point is missing...
207- # mesh = triangle_mesh(circle, nvertices=32)
208- # # end-1, since we add a middle point for the mesh!
209- # @test decompose(Point2f0, mesh)[1:end-1] ≈ decompose(Point2f0, circle, 32)
205+ mesh = triangle_mesh (circle, nvertices= 32 )
206+ @test decompose (Point2f0, mesh)[1 : end ] ≈ decompose (Point2f0, circle, 32 )
207+ end
208+
209+
210+ @testset " Rectangles" begin
211+ rect = FRect2D (0 , 7 , 20 , 3 )
212+ @test (rect + 4 ) == FRect2D (4 , 11 , 20 , 3 )
213+ @test (rect + Vec (2 , - 2 )) == FRect2D (2 , 5 , 20 , 3 )
214+
215+ @test (rect - 4 ) == FRect2D (- 4 , 3 , 20 , 3 )
216+ @test (rect - Vec (2 , - 2 )) == FRect2D (- 2 , 9 , 20 , 3 )
217+
218+ base = Vec3f0 (1 , 2 , 3 )
219+ wxyz = Vec3f0 (- 2 , 4 , 2 )
220+ rect = FRect3D (base, wxyz)
221+ @test (rect + 4 ) == FRect3D (base .+ 4 , wxyz)
222+ @test (rect + Vec (2 , - 2 , 3 )) == FRect3D (base .+ Vec (2 , - 2 , 3 ), wxyz)
223+
224+ @test (rect - 4 ) == FRect3D (base .- 4 , wxyz)
225+ @test (rect - Vec (2 , - 2 , 7 )) == FRect3D (base .- Vec (2 , - 2 , 7 ), wxyz)
226+
227+
228+ rect = FRect2D (0 , 7 , 20 , 3 )
229+ @test (rect * 4 ) == FRect2D (0 , 7 * 4 , 20 * 4 , 3 * 4 )
230+ @test (rect * Vec (2 , - 2 )) == FRect2D (0 , - 7 * 2 , 20 * 2 , - 3 * 2 )
210231
232+ base = Vec3f0 (1 , 2 , 3 )
233+ wxyz = Vec3f0 (- 2 , 4 , 2 )
234+ rect = FRect3D (base, wxyz)
235+ @test (rect * 4 ) == FRect3D (base .* 4 , wxyz .* 4 )
236+ @test (rect * Vec (2 , - 2 , 3 )) == FRect3D (base .* Vec (2 , - 2 , 3 ), wxyz .* Vec (2 , - 2 , 3 ))
211237end
0 commit comments