From 731410cbf0a14a1db8bcc0763d749059951e7622 Mon Sep 17 00:00:00 2001 From: MaximeBouton Date: Fri, 17 Aug 2018 14:21:04 -0700 Subject: [PATCH] convenient constructor for convex polygon --- src/2d/utils/minkowski.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/2d/utils/minkowski.jl b/src/2d/utils/minkowski.jl index 3a16f78..45a4f94 100644 --- a/src/2d/utils/minkowski.jl +++ b/src/2d/utils/minkowski.jl @@ -62,6 +62,7 @@ mutable struct ConvexPolygon end ConvexPolygon(npts::Int) = ConvexPolygon(Array{VecE2}(npts), 0) +ConvexPolygon(pts::Vector{VecE2}) = ConvexPolygon(pts, length(pts)) Base.start(poly::ConvexPolygon) = 1 Base.done(poly::ConvexPolygon, i::Int) = i > length(poly)