xeokit / xeokit-sdk

Open source JavaScript SDK for viewing high-detail, full-precision 3D BIM and AEC models in the Web browser.
https://xeokit.io
Other
738 stars 291 forks source link

Extend STLLoaderPlugin to handle data directly, not only loaded from file #572

Closed MaxGeldner closed 3 years ago

MaxGeldner commented 3 years ago

Is this feature critical for your commercial enterprise? Yes, it is critical for the DBI project (we are in talks over a license agreement atm I think).

Is your feature request related to a problem? Please describe. I'd like to plug data directly into the STL loader and not go the extra way of having to write my data into a file, to use the STL loaders load() function. Assuming a part of my code generates a STL string, it would be better to have a method in the STL loader that can handle this STL string directly.

Describe the solution you'd like At the moment the STL loader uses the parse() function to actually load the STL string, taken from a file via the load() function, into Xeokit. Solutions would be:

xeolabs commented 3 years ago

Solution

If we already have our STL file in memory (perhaps pre-loaded, or even generated in-client), then we can just pass that file data straight to the STLLoaderPlugin#load method. In the example below, we'll show how it's done by pre-loading our STL file data, before passing it to that method.

xeolabs commented 3 years ago

/ping @MaxGeldner - I just released this fix in 1.7.0-alpha.4

See all changes in that pre-release here: https://github.com/xeokit/xeokit-sdk/blob/master/CHANGE_LOG.md

Everything under the "1.7.0" heading in that change log is pre-released in 1.7.0-alpha.4.

The other issue that (if I understand correctly) is important for our project is https://github.com/xeokit/xeokit-sdk/issues/579, which allows us to load STL models with double-precision global coordinates, so they properly render align with double-precision map coordinates without rounding errors.

MaxGeldner commented 3 years ago

/ping @MaxGeldner - I just released this fix in 1.7.0-alpha.4

See all changes in that pre-release here: https://github.com/xeokit/xeokit-sdk/blob/master/CHANGE_LOG.md

Everything under the "1.7.0" heading in that change log is pre-released in 1.7.0-alpha.4.

The other issue that (if I understand correctly) is important for our project is #579, which allows us to load STL models with double-precision global coordinates, so they properly render align with double-precision map coordinates without rounding errors.

@xeolabs Thank you very much :) I hope to integrate the new version before our meeting next monday and get back to you with questions on that appointment, if I have any.

Until then have a nice weekend!