'How to convert Point Cloud Library meshes to GLTF file in iOS

We try develop an app just like 3d Scanner and use Point Cloud Library (PCL) to generate mesh.

We want to export result mesh to GLTF (GLB) file, but PCL only supported obj, pcd, ply, stl.

How can I export GLTF (GLB) on device?



Solution 1:[1]

Finally we use ASSIMP as library in our app, when PCL export obj file, use ASSIMP convert the obj file to GLB file, document about exporting models.

Here is steps how to use ASSIMP in Xcode:

  1. git clone https://github.com/assimp/assimp.git
  2. cd assimp/port/iOS/
  3. ./build.sh
  4. after that, you have "libassimp.a" in assimp/lib/iOS/arm64(we preferred arm64)
  5. create folder named "assimpLib" in Xcode and copy libassimp.a and assimp/include folder(header files) in it.
  6. add path for the assimpLib in Header Search Path in Xcode Build setting, just like $(PROJECT_DIR)/MY_PROJECT/assimpLib
  7. setting all done, now you can write a c++ wrapper file call ASSIMP function via swift.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1