@@ -334,12 +334,28 @@ end
334334
335335@testset " orthogonal_vector" begin
336336 tri = Triangle (Point3d (0 ,0 ,0 ), Point3d (1 ,0 ,0 ), Point3d (0 ,1 ,0 ))
337- @test GeometryBasics. orthogonal_vector (tri) == Vec3d (0 ,0 ,1 )
338- @test GeometryBasics. orthogonal_vector (collect (coordinates (tri))) == Vec3d (0 ,0 ,1 )
337+ @test GeometryBasics. orthogonal_vector (tri) === Vec3d (0 ,0 ,1 )
338+ @test GeometryBasics. orthogonal_vector (collect (coordinates (tri))) === Vec3d (0 ,0 ,1 )
339+ @test GeometryBasics. orthogonal_vector (Vec3f, tri) === Vec3f (0 ,0 ,1 )
340+ @test GeometryBasics. orthogonal_vector (Vec3f, collect (coordinates (tri))) === Vec3f (0 ,0 ,1 )
339341
340342 quad = GeometryBasics. Quadrilateral (Point2i (0 ,0 ), Point2i (1 ,0 ), Point2i (1 ,1 ), Point2i (0 ,1 ))
341- @test GeometryBasics. orthogonal_vector (quad) == Vec3i (0 ,0 ,2 )
342- @test GeometryBasics. orthogonal_vector (collect (coordinates (quad))) == Vec3i (0 ,0 ,2 )
343+ @test GeometryBasics. orthogonal_vector (quad) === Vec3i (0 ,0 ,2 )
344+ @test GeometryBasics. orthogonal_vector (collect (coordinates (quad))) === Vec3i (0 ,0 ,2 )
345+ @test GeometryBasics. orthogonal_vector (Vec3d, quad) === Vec3d (0 ,0 ,2 )
346+ @test GeometryBasics. orthogonal_vector (Vec3d, collect (coordinates (quad))) === Vec3d (0 ,0 ,2 )
347+
348+ t = (Point3f (0 ), Point3f (1 ,0 ,1 ), Point3f (0 ,1 ,0 ))
349+ @test GeometryBasics. orthogonal_vector (t) == Vec3f (- 1 ,0 ,1 )
350+ @test GeometryBasics. orthogonal_vector (Vec3i, t) == Vec3i (- 1 ,0 ,1 )#
351+
352+ # Maybe the ::Any fallback is too generic...?
353+ struct TestType
354+ data:: Vector{Vec3f}
355+ end
356+ GeometryBasics. coordinates (x:: TestType ) = x. data
357+ x = TestType ([Point3f (1 ,1 ,1 ), Point3f (0 ,0 ,0 ), Point3f (0.5 ,0 ,0 )])
358+ @test GeometryBasics. orthogonal_vector (x) == Vec3f (0 , - 0.5 , 0.5 )
343359end
344360
345361@testset " Normals" begin
0 commit comments