Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Commit

Permalink
actually use mesh type for polygon
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDanisch committed Dec 6, 2016
1 parent 423d1cb commit 1d2bc92
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/polygons.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function polygon2faces{P<:Point}(
)
#= allocate and initialize list of Vertices in polygon =#
result = facetype[]

# the algorithm doesn't like closed contours
if isapprox(last(contour), first(contour))
pop!(contour)
Expand Down Expand Up @@ -137,10 +137,10 @@ function topoint{T}(::Type{Point{2, T}}, p::Point{3, T})
Point{2, T}(p[1], p[2])
end

@compat function (::Type{M}){M<:AbstractMesh, P<:Point}(
@compat function (::Type{M}){M <: AbstractMesh, P <: Point}(
points::AbstractArray{P}
)
faces = polygon2faces(points, facetype(M))
VT = vertextype(M)
GLNormalMesh(faces = faces, vertices = VT[topoint(VT, p) for p in points])
M(faces = faces, vertices = VT[topoint(VT, p) for p in points])
end

0 comments on commit 1d2bc92

Please sign in to comment.