-
I am working on a project in which I am hoping to serialize an IFC to GLB with the WASM wheel. How can I find documentation or instruction on the available methods? I am working with Babylon.js and have successfully converted an IFC to GLB with the python library. I am working to do that conversion process in the web browser, or load it directly to Babylon. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
The pyodide wheel offers the same functionality as regular python https://docs.ifcopenshell.org/ifcopenshell-python/geometry_processing.html https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.8.0/src/pyodide/demo-app/index.html |
Beta Was this translation helpful? Give feedback.
-
That's great to hear. So do I need to do the serializing in pyodide.runPythonAsync()? or is there syntax similar to how geom is handled, such as:
which different than the python:
|
Beta Was this translation helpful? Give feedback.
-
Yes, thank you. I do understand, but I am wanting to find out the syntax for serializing using the first example (WASM) syntax. I have the python code to do what I want, but it is python and would require pyodide.runPythonAsync(). I'd be interested in doing it using the syntax in the first example. Pyodide and Micropip are new to me. I'd like to find out what syntax the wheel uses. (I did not just learn the word 'syntax', lol) |
Beta Was this translation helpful? Give feedback.
-
Thank you! And I would also like to thank for all of the work put into this. This is making a huge leap in my application for sequencing mass timber parts and estimating. Being able to directly load, view and manipulate an IFC is such a great tool. |
Beta Was this translation helpful? Give feedback.
I didn't test the serializers in the WASM module, it's probably more efficient to just get the binary data directly from the iterator and feed it to babylon. I tbh also haven't tested all the details, the glTF serializer uses tempfiles for example to store the binary data while traversing, I don't know if that works in the emulated in-browser file system. You can initialize an
ifcopenshell.geom.serializers.buffer
and pass that to the serializer instead of the filepath when you initialize the serializer and then callget_value()
.