Skip to content

Commit 848e281

Browse files
committed
add imports and get overload
1 parent 857ae2d commit 848e281

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/GeometryBasics.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@ export LineFace, Polytope, Line, NgonFace, convert_simplex
3030
export AbstractPolygon, Polygon
3131
export Simplex, connect, Triangle, NSimplex, Tetrahedron
3232
export QuadFace, coordinates, TetrahedronFace
33-
export TupleView, SimplexFace, Mesh
33+
export TupleView, SimplexFace
3434
export Triangle
3535
export AbstractFace, TriangleFace, QuadFace, GLTriangleFace
3636
export OffsetInteger, ZeroIndex, OneIndex, GLIndex
3737
export decompose, coordinates, faces, normals, decompose_uv, decompose_normals,
3838
texturecoordinates
3939
export Tesselation, Normal, UV, UVW
40-
export AbstractMesh, Mesh
40+
export AbstractMesh, Mesh, MetaMesh
41+
export add_meta, pop_meta
4142

4243
# all the different predefined mesh types
4344
# Note: meshes can contain arbitrary meta information,

src/meshes.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,9 @@ function pop_meta(mesh::MetaMesh, name::Symbol)
151151
new_meta, value = pop(meta(mesh), Val(name))
152152
return MetaMesh(mesh, new_meta), value
153153
end
154+
155+
156+
function Base.get(f, mesh::MetaMesh, key::Symbol)
157+
hasproperty(mesh, key) && return getproperty(mesh, key)
158+
return f()
159+
end

0 commit comments

Comments
 (0)