visgl / loaders.gl

Loaders for big data visualization. Website:
https://loaders.gl
Other
702 stars 192 forks source link

Can't load Las, Laz models from Xeokit based Electron app #2998

Open intrida-dev opened 5 months ago

intrida-dev commented 5 months ago

We have an application which is built only to run in ElectronJS. We use Xeokit sdk for 3D visualization. Recently we implemented Las/Laz loading capability and found that it doesn't work in ElectronJS App. We get following error:

329126363-8d346b5e-3a54-4d33-a234-c33e3b85c2e4

But we can load the same model with same code when it is viewed in browser. I have attached a video explaining this issue.

https://github.com/visgl/loaders.gl/assets/73640257/aa7d255b-9d36-47ee-9268-37b838cdef0c

We debugged a little and found an issue in canParseWithWorker function. If statement at line number 108996 evaluates to true, when it is from Electron. 329127015-145ae717-b6a1-4890-8d0e-62d59e06c015

Also I have attached a sample code in zip. sample.zip

To Reproduce Steps to reproduce the behavior:

  1. First place 'autzen.laz' sample model in models directory
  2. Open the attached sample code in VS code and go to terminal
  3. Execute 'npm install electron'
  4. Run command 'npm start' to launch electronjs app.
  5. See error on console

We reported this to Xeokit earlier. They suggested us to report here loaders.gl library to load Las/laz models.

intrida-dev commented 1 month ago

Can anyone please help us on this?

ibgreen commented 1 month ago

@intrida-dev Thanks for reporting.

There is an isElectron function in the companion @probe.gl/env module that could perhaps be used here to disambiguate: https://github.com/visgl/probe.gl/blob/master/modules/env/src/lib/is-electron.ts

As the maintainers are not electron users we don't actively support that environment, nor can we test that things work, but we do accept small PRs with fixes