Skip to content

Commit 1b42e9f

Browse files
committed
fixes
1 parent 1031be1 commit 1b42e9f

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/basic_types.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ end
362362

363363
function Base.propertynames(mesh::Mesh)
364364
names = propertynames(getfield(mesh, :simplices))
365-
if :positions in names
365+
if :position in names
366366
return names
367367
else
368368
# a mesh always has positions!

src/geometry_primitives.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,10 @@ function coordinates(s::Circle, nvertices=64)
348348
return (inner(fi) for fi in LinRange(0, 2pi, nvertices))
349349
end
350350

351+
function texturecoordinates(s::Circle, nvertices=64)
352+
return coordinates(Circle(Point2f0(0.5), 0.5f0), nvertices)
353+
end
354+
351355
function coordinates(s::Sphere, nvertices=24)
352356
θ = LinRange(0, pi, nvertices); φ = LinRange(0, 2pi, nvertices)
353357
inner(θ, φ) = Point(cos(φ)*sin(θ), sin(φ)*sin(θ), cos(θ)) .* s.r .+ s.center

src/meshes.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,12 @@ function mesh(primitive::GeometryPrimitive;
110110
attributes[:normals] = primitive_normals
111111
else
112112
# Normals not implemented for primitive, so we calculate them!
113-
attributes[:normals] = normals(positions, faces)
113+
n = normals(positions, faces)
114+
if n !== nothing # ok jeez, this is a 2d mesh which cant have normals
115+
attributes[:normals] = n
116+
end
114117
end
115118
end
116-
117119
return Mesh(meta(positions; attributes...), faces)
118120
end
119121

0 commit comments

Comments
 (0)