Skip to content

Commit 39d0711

Browse files
committed
add MultiPoint meta
1 parent 6ae29e9 commit 39d0711

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

src/GeometryBasics.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ module GeometryBasics
2929
export OffsetInteger, ZeroIndex, OneIndex, GLIndex
3030
export FaceView, SimpleFaceView
3131
export AbstractPoint, PointMeta, PointWithUV
32+
export PolygonMeta, MultiPointMeta
3233
export decompose, coordinates, faces, normals, decompose_uv, decompose_normals, texturecoordinates
3334
export Tesselation, pointmeta, Normal, UV, UVW
3435
export GLTriangleFace, GLNormalMesh3D, GLPlainTriangleMesh, GLUVMesh3D, GLUVNormalMesh3D

src/basic_types.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,17 @@ end
307307
Base.getindex(ms::MultiLineString, i) = ms.linestrings[i]
308308
Base.size(ms::MultiLineString) = size(ms.linestrings)
309309

310+
311+
"""
312+
MultiPoint(points::AbstractVector{AbstractPoint})
313+
314+
A collection of points
315+
"""
310316
struct MultiPoint{
311317
Dim, T <: Real,
312-
Element <: AbstractPoint{Dim, T},
313-
A <: AbstractVector{Element}
314-
} <: AbstractVector{Element}
318+
P <: AbstractPoint{Dim, T},
319+
A <: AbstractVector{P}
320+
} <: AbstractVector{P}
315321

316322
points::A
317323
end

src/metadata.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,7 @@ Base.getindex(x::NgonFaceMeta, idx::Int) = getindex(metafree(x), idx)
137137
Base.getindex(x::SimplexFaceMeta, idx::Int) = getindex(metafree(x), idx)
138138

139139
@meta_type(Polygon, polygon, AbstractPolygon, N, T)
140+
141+
@meta_type(MultiPoint, points, AbstractVector, P)
142+
Base.getindex(x::MultiPointMeta, idx::Int) = getindex(metafree(x), idx)
143+
Base.size(x::MultiPointMeta) = size(metafree(x))

0 commit comments

Comments
 (0)