High-level API to load simple mesh formats

#6 · closed · 10 comments

View on GitHub ↗

juliohm

Thank you @Gnimuc for wrapping the library. Is there an easy method to load simple PLY files from disk and retrieve the coordinates and connectivities of faces? It seems that assimp has a much broader scope, but I wonder if we could have something similar to the pyassimp package? They seem to provide a `load(fname)` function which returns an object that is iterable with all meshes in the scene.

Comments

juliohm

Here is their example: https://pypi.org/project/pyassimp

Gnimuc

Hi @juliohm, those high-level iterator APIs of 3D asset libraries are all similar to each other. It's not hard to implement a high-level API for the following example in Julia, but I just don't have time at the moment. If you'd like to contribute, I would be happy to invite you as a collaborator. :) ``` scene = aiImportFile(joinpath(@__DIR__, "test.stl"), aiProcess_CalcTangentSpace | aiProcess_Triangulate | aiProcess_JoinIdenticalVertices | aiProcess_SortByPType ) if scene == C_NULL @error aiGetErrorString() |> unsafe_string @test false end scene_obj = unsafe_load(scene) num_mesh = scene_obj.mNumMeshes for i = 1:num_mesh mesh_obj = unsafe_load(unsafe_load(scene_obj.mMeshes, i)) for j = 1:mesh_obj.mNumVertices vt = unsafe_load(mesh_obj.mVertices, j) @show vt end end aiReleaseImport(scene) ```

juliohm

Thank you @Gnimuc , I will keep working on a few urgent features in Meshes.jl and then will come back when I am free. I'd be happy to help here.

Gnimuc

Maybe I should transfer this package to JuliaIO, so more people could get involved without push-privilege issues.

juliohm

That would be nice too, any organization like JuliaIO or JuliaGeometry seems like a nice fit. I am part of the latter only, but I am sure that we can contribute wherever the package is. :)

Gnimuc

OK,I'm going to tranfer this to JuliaGeometry. Perhaps also transfer GLTF.jl to there which is also a 3D asset loader.

Gnimuc

Seems like only members have authority to transfer, I've invited you as a collaborator.

juliohm

Oh thanks, let me accept the invite and if you would like I could transfer it to JuliaGeometry

juliohm

Invite accepted. I will try to find the time in the following weeks to work on the high-level API.

juliohm

We moved to GeoIO.jl, which is actively maintained and provides various backends written in Julia.