diff --git a/src/GeometricalPredicates.jl b/src/GeometricalPredicates.jl index 718017b..f47f356 100644 --- a/src/GeometricalPredicates.jl +++ b/src/GeometricalPredicates.jl @@ -165,8 +165,9 @@ struct Polygon2D{T<:AbstractPoint2D} <: AbstractPolygon2D _p::Vector{T} _l::Vector{AbstractLine2D} function Polygon2D{T}(p::T...) where {T<:AbstractPoint2D} - l = map(1:length(p)-1) do i - Line(p[i], p[i+1]) + l = [] + for i in range(1, stop=length(p)-1) + push!(l, Line(p[i], p[i+1])) end push!(l, Line(p[end], p[1])) new([p...;], l)