kovacsv / assimpjs

The emscripten interface for the assimp library that allows you to import 40+ 3D file formats in the browser.
MIT License
110 stars 18 forks source link

Supported File Formats #5

Open Wicked-Prick opened 1 year ago

Wicked-Prick commented 1 year ago

Good day. The Readme states that only the .gltf format is currently supported. I have tried uploading .fbx and .obj files and they also work correctly. Do you plan to disable support for other formats other than .gltf in the future?

kovacsv commented 1 year ago

For import almost all assimp formats are supported, and will be in the future. The limitation is about the format you can get the result after conversion. For that only glTF and JSON is supported at the moment.

Wicked-Prick commented 1 year ago

Good afternoon. Regarding the storage of information about the structure of materials. Are there any plans in the future to bring this structure to a common one? For example, I want to get a PBR from an fbx file, for this I will have to use existing formulas to deduce the missing properties, i.e.: metalic, roughness, etc. It would be nice to be able to get these properties immediately at the output of assimp.

kovacsv commented 1 year ago

Hey, assimpjs is just an interface for assimp, it can only show you the format assimp provides the model in.

jradler65 commented 1 year ago

Hi, I'm having trouble importing a .step file using assimpjs as it throws an import_error. I have tested this using the browser_dragdrop_test.html file. I'm not sure if this error is related to the result limitations you mentioned earlier or if it is caused by assimp itself. Could you please provide some insight?

kovacsv commented 1 year ago

As far as I know assimp doesn't fully support step file import. It's somehow part of the ifc import, but the details is not very clear to me, and ifc is turned off in assimpjs since it increases the wasm size a lot.

For a fully functional step and iges importer I recommend you to take a look at occt-import-js: https://github.com/kovacsv/occt-import-js

jradler65 commented 1 year ago

Thanks for your response and the suggestion of using the occt-import-js. I actually already tried it and its STEP-importer works well in my web-application. However for larger files it takes a decent amount of time even with minimized deflection properties. I was therefore hoping for a faster solution. Nonetheless, it's good to know that assimp doesn't fully support the import of STEP-files and that ifc is currently turned off in assimpjs. Would turning it on enable the import of STEP-files?

I appreciate your insights and if you happen to have further information or resources that could help me speed up the STEP-importer, I would be really grateful for your input.

kovacsv commented 1 year ago

You can comment out this line and rebuild the package to try out IFC importer: https://github.com/kovacsv/assimpjs/blob/d626c429a46689880b9cccae97e9b0a11d472ada/CMakeLists.txt#L40

I don't have any information about the quality of it for step files, but maybe it's worth asking the assimp developers.

jradler65 commented 1 year ago

Unfortunately, commenting out this line did not fix the importer. However, I noticed that the size of the wasm file only increased by about 1MB, bringing the total size to 5.6MB. This seems unusual because you mentioned a "dramatic decrease" in the file size. I'm not certain if this is the expected result.

kovacsv commented 1 year ago

Maybe my memory failed me, I remembered the change as dramatic. 🙂

jradler65 commented 1 year ago

Thanks for letting me know. I'll continue exploring other potential solutions and if I find a fix, I'll be sure to share it with you.