Skip to content

Commit

Permalink
outer constructor for ConvexPolygon
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximeBouton committed Aug 17, 2018
1 parent a5e4c2d commit e9ac2bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/2d/utils/minkowski.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ end
mutable struct ConvexPolygon
pts::Vector{VecE2} # ordered counterclockwise along polygon boundary s.t. first edge has minimum polar angle in [0,2π]
npts::Int # number of pts that are currently used (since we preallocate a longer array)

ConvexPolygon(npts::Int) = new(Array{VecE2}(npts), 0)
end

ConvexPolygon(npts::Int) = ConvexPolygon(Array{VecE2}(npts), 0)

Base.start(poly::ConvexPolygon) = 1
Base.done(poly::ConvexPolygon, i::Int) = i > length(poly)
Base.next(poly::ConvexPolygon, i::Int) = (poly.pts[i], i+1)
Expand Down

0 comments on commit e9ac2bf

Please sign in to comment.