Skip to content

Commit

Permalink
convenient constructor for convex polygon
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximeBouton committed Aug 17, 2018
1 parent e9ac2bf commit 731410c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/2d/utils/minkowski.jl
Expand Up @@ -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)
Expand Down

0 comments on commit 731410c

Please sign in to comment.