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

Support for IFC file that is compressed in zip #160

Open
jespa007 opened this issue Mar 25, 2023 · 6 comments
Open

Support for IFC file that is compressed in zip #160

jespa007 opened this issue Mar 25, 2023 · 6 comments

Comments

@jespa007
Copy link
Contributor

Hi,
IFC comes with plain text but sometimes IFC file can be compressed as ZIP in order to save space. The idea is detect the signature that ZIP writes at the begin of the file,decompress the file using zip third party utility and give a byte array and finally load the IFC using IFCLoader.parser that expects byte array.

@agviegas
Copy link
Collaborator

Hi, the scope of this package is to load IFC into Three.js meshes. Adding zip logic might bloat a package that we already plan to un-bloat soon. Have you tried using a library specific to uncompress zip files? 🤔

@jespa007
Copy link
Contributor Author

jespa007 commented Mar 25, 2023

Hi @agviegas ,
I was thinking about zip.js or jszip as third party libraries. Maybe I put this issue in the wrong repository. Web-ifc already takes arrayBuffer to load the model using IfcAPI.OpenModel

IfcAPI.openModel(data: Uint8Array,
                 settings: LoaderSettings): number

I think the ifcApi.openModel should be modified to check the begin of uintarray data. If the begin of the array starts with signature \x50\x4b\x01\x02 (PK♥♦ or "PK\3\4")) then can it can try to decompress.

What do you think ? As I told... may be this is issue it is more related with web-ifc rather than web-ifc-three

@beachtom
Copy link
Contributor

So I think if this belongs anywhere it is in web-ifc. However, I am on the fence at the moment web-ifc does not actually have any depdencies (typescript side) and I am not sure if we want to add one. However, most zip libraries are < 100kb so it is not big.

@jespa007
Copy link
Contributor Author

jespa007 commented Mar 27, 2023

So I think if this belongs anywhere it is in web-ifc. However, I am on the fence at the moment web-ifc does not actually have any depdencies (typescript side) and I am not sure if we want to add one. However, most zip libraries are < 100kb so it is not big.

Hi @beachtom, what do you think about including 7zip or similar as dependency of wasm? In the OpenModel (file web-ifc-api.cpp) then it can use zip library to decompress if the incoming pointer char * starts with \x50\x4b\x01\x02.

@beachtom
Copy link
Contributor

technically not an issue at all - I guess the question is more philosophical is do we want web-ifc to do that - or is it the user responisbility? @agviegas

@jespa007
Copy link
Contributor Author

technically not an issue at all - I guess the question is more philosophical is do we want web-ifc to do that - or is it the user responisbility? @agviegas

You are right @beachtom . Ifc file could be compressed with many other formats like RAR or 7zip as well as ZIP. The user can be in charge to manage this.

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

3 participants