Skip to content

Commit 992314e

Browse files
committed
try to derive eltypes
1 parent 2448713 commit 992314e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/geometry_primitives.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,13 @@ function orthogonal_vector(::Type{VT}, triangle::Triangle) where {VT <: VecTypes
162162
a, b, c = triangle
163163
return cross(to_ndim(VT, b-a, 0), to_ndim(VT, c-a, 0))
164164
end
165+
166+
# derive target type
167+
orthogonal_vector(vertices::Ngon{D, T}) where {D, T} = orthogonal_vector(Vec3{T}, vertices)
168+
function orthogonal_vector(vertices::AbstractArray{VT}) where {D, T, VT <: VecTypes{D, T}}
169+
return orthogonal_vector(Vec3{T}, vertices)
165170
end
171+
# fallback to Vec3f if vertices is something else
166172
orthogonal_vector(vertices) = orthogonal_vector(Vec3f, vertices)
167173

168174
"""

0 commit comments

Comments
 (0)