JuliaIO / MeshIO.jl

IO for Meshes
Other
79 stars 31 forks source link

getindex() methods not working #16

Closed rdeits closed 8 years ago

rdeits commented 8 years ago

I'm trying to reproduce the examples given in the Readme, but it looks like the getindex() overloads described there are not up to date:

using FileIO
mesh = load("mesh.stl")
mesh[MeshIO.Normal3{Float32}]

where "mesh.stl" is a file I've previously created, gives:

LoadError: UndefVarError: Normal3 not defined

Switching to a different parameterization of Normal, I get a bit closer:

using FileIO
mesh = load("mesh.stl")
mesh[MeshIO.Normal{3, Float32}]

gives:

LoadError: MethodError: `getindex` has no method matching getindex(::GeometryTypes.HomogenousMesh{FixedSizeArrays.Point{3,Float32},GeometryTypes.Face{3,UInt32,-1},GeometryTypes.Normal{3,Float32},Void,Void,Void,Void}, ::Type{GeometryTypes.Normal{3,Float32}})

I've tried other variations, but as far as I can tell, the getindex() overloads no longer seem to exist. Is that correct?

SimonDanisch commented 8 years ago

Sorry this indeed has changed! try:

decompose(Normal{3, Float32}, mesh)
rdeits commented 8 years ago

Ah, thanks, that worked!