Skip to content

Commit 2313fc1

Browse files
committed
yo fix that fix this
1 parent d202841 commit 2313fc1

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/geometry_primitives.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ function widths(x::AbstractRange)
66
return maxi - mini
77
end
88

9-
109
##
1110
# conversion & decompose
1211

src/meshes.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ function mesh(primitive::Meshable;
129129
attrs[:normals] = decompose(normaltype, primitive_normals)
130130
else
131131
# Normals not implemented for primitive, so we calculate them!
132-
n = normals(positions, faces)
132+
n = normals(positions, faces; normaltype=normaltype)
133133
if n !== nothing # ok jeez, this is a 2d mesh which cant have normals
134134
attrs[:normals] = n
135135
end
@@ -238,7 +238,7 @@ Attaches metadata to the coordinates of a mesh
238238
"""
239239
function pointmeta(mesh::Mesh; meta_data...)
240240
points = coordinates(mesh)
241-
attr = GeometryBasics.attributes(points)
241+
attr = attributes(points)
242242
delete!(attr, :position) # position == metafree(points)
243243
# delete overlapping attributes so we can replace with `meta_data`
244244
foreach(k-> delete!(attr, k), keys(meta_data))
@@ -260,7 +260,7 @@ Returns the new mesh, and the property!
260260
"""
261261
function pop_pointmeta(mesh::Mesh, property::Symbol)
262262
points = coordinates(mesh)
263-
attr = GeometryBasics.attributes(points)
263+
attr = attributes(points)
264264
delete!(attr, :position) # position == metafree(points)
265265
# delete overlapping attributes so we can replace with `meta_data`
266266
m = pop!(attr, property)
@@ -277,5 +277,5 @@ function facemeta(mesh::Mesh; meta_data...)
277277
end
278278

279279
function attributes(hasmeta::Mesh)
280-
return Dict((name => getproperty(hasmeta, name) for name in propertynames(hasmeta)))
280+
return Dict{Symbol, Any}((name => getproperty(hasmeta, name) for name in propertynames(hasmeta)))
281281
end

src/metadata.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ function attributes(hasmeta)
1414
return Dict{Symbol, Any}()
1515
end
1616

17+
function attributes(hasmeta::StructArray)
18+
return Dict{Symbol, Any}((name => getproperty(hasmeta, name) for name in propertynames(hasmeta)))
19+
end
20+
1721
"""
1822
getcolumns(t, colnames::Symbol...)
1923
@@ -95,7 +99,7 @@ macro meta_type(name, mainfield, supertype, params...)
9599
end
96100

97101
function GeometryBasics.attributes(hasmeta::$MetaName)
98-
return Dict((name => getproperty(hasmeta, name) for name in propertynames(hasmeta)))
102+
return Dict{Symbol, Any}((name => getproperty(hasmeta, name) for name in propertynames(hasmeta)))
99103
end
100104

101105
function GeometryBasics.meta(elements::AbstractVector{T}; meta...) where T <: $supertype

0 commit comments

Comments
 (0)