Hello there, i’m kind lost right now, so i really need you guys to help me.
So, i’m trying to load a personal IFC file on “@speckle/viewer” npm lib. This recieves data as a .obj file. So a build an AWS lambda that convert my IFC files and gives to me a zip with my .ifc converted as .obj and .mtl files. I successfully load my .obj to the viewer, however without colors from the project materials, that colors info is in the .mtl file. So, my question is how can i use my .mtl file to fix that situation? should i develop an IFC loader and not convert my files? should i develop an MTL loader, if thats the case, how connect that with the OBJ loader provided by speckle?
The easiest would be to use Speckle’s builtin IFC converter from our webapp. Just drag and drop the original IFC and you will end up with a speckle stream that can be consumed by the viewer-lib directly
The current support for .obj loading in the viewer-lib is minimalist as no materials are being parsed, however it’s piggy backing on three.js’s .obj loader which also has a .mtl loader. Here’s a usage example. Since the .mtl loader already exists, all you’d have to do is extend the default .obj loader provided with the viewer-lib to have materials loaded in. I might be able to help you with this
Make an .ifc loader. Again, because three.js already has an .ifc loader. Making a viewer loader for .ifc might not be that difficult since you are going to piggyback on three’s loader
In my opinion, the easiest would be option #1 since it involves 0 code and it’s already builtin the webapp. It also depends on how complex your original .ifc is. Do also note that the current speckle data model does not support textures (in case you have any)