Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High-level API to load simple mesh formats #6

Closed
juliohm opened this issue May 8, 2021 · 10 comments
Closed

High-level API to load simple mesh formats #6

juliohm opened this issue May 8, 2021 · 10 comments

Comments

@juliohm
Copy link
Collaborator

juliohm commented May 8, 2021

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.

@juliohm
Copy link
Collaborator Author

juliohm commented May 8, 2021

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

@Gnimuc
Copy link
Owner

Gnimuc commented May 10, 2021

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
Copy link
Collaborator Author

juliohm commented May 10, 2021

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
Copy link
Owner

Gnimuc commented May 10, 2021

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

@juliohm
Copy link
Collaborator Author

juliohm commented May 10, 2021

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
Copy link
Owner

Gnimuc commented May 11, 2021

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

@Gnimuc
Copy link
Owner

Gnimuc commented May 12, 2021

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

@juliohm
Copy link
Collaborator Author

juliohm commented May 12, 2021

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

@juliohm
Copy link
Collaborator Author

juliohm commented May 12, 2021

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

@juliohm
Copy link
Collaborator Author

juliohm commented Apr 2, 2024

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

@juliohm juliohm closed this as completed Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants