Skip to content

Polygon is sequence of segments, not points? #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
goretkin opened this issue Oct 24, 2019 · 2 comments
Closed

Polygon is sequence of segments, not points? #13

goretkin opened this issue Oct 24, 2019 · 2 comments

Comments

@goretkin
Copy link

struct Polygon{
Dim, T <: Real,
P <: AbstractPoint{Dim, T},
L <: AbstractVector{<: LineP{Dim, T, P}},
V <: AbstractVector{L}
} <: AbstractPolygon{Dim, T}
exterior::L
interiors::V
end

am I understanding correctly that the Polygon type is represented by an AbstractVector with eltype as LineP? I would have expected an eltype of <:AbstractPoint like in Ngon.

@goretkin
Copy link
Author

Same question applies to LineString:

struct LineString{
Dim, T <: Real,
P <: AbstractPoint,
V <: AbstractVector{<: LineP{Dim, T, P}}
} <: AbstractVector{LineP{Dim, T, P}}
points::V
end

@asinghvi17
Copy link
Contributor

asinghvi17 commented Dec 14, 2024

This is not to be the case anymore as of v0.5 - polygons are vectors of linestrings, and linestrings are vectors of points.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants