gemini-viewer-examples
gemini-viewer-examples copied to clipboard
serialize and de-serialize dxfViewer scene
For a large dxf file, it takes about 10 seconds before user can see the model. Below is the timeline from the console log:
[DxfViewer] Initialized in 0.027s [DxfViewer] Font file(s) load time in 0.046s [DxfLoader] Loaded DxfData from indexedDb in 0.436s [DxfLoader] loadEntities() done in 4.493s [DxfViewer] Loaded 'data/Large_Model.dxf' in 4.933s, adding to scene... [DxfViewer] Activated layout 'Model' in 0.004s [DxfViewer] Added 'data/Large_Model.dxf' to scene in 5.163s
As can be seen here, the loadEntities() took ~4.5 seconds (despite the function name, I think this is the parsing step), and the adding to scene took ~5 seconds.
How can I serialize the scene in the dxfViewer and de-serialize the scene in the dxfViewer to reduce this 10 seconds to sub second? Please refer to the following discussion for what I am talking about.
https://discourse.threejs.org/t/the-best-way-to-save-and-open-three-js-scene/16158