xeokit-sdk icon indicating copy to clipboard operation
xeokit-sdk copied to clipboard

las/laz colorDepth set default to auto or 16

Open DB-EC-Hamburg-BIM opened this issue 3 years ago • 2 comments

LAS specification recommends 16 bits. You wrote this even in your documentation. https://xeokit.github.io/xeokit-sdk/docs/class/src/plugins/LASLoaderPlugin/LASLoaderPlugin.js~LASLoaderPlugin.html

when I try to set the parameter colorDepth, it will be ignored, so I had to change the default in the xeokit-sdk.es.js file.

DB-EC-Hamburg-BIM avatar Jan 18 '22 14:01 DB-EC-Hamburg-BIM

PR would be welcome!

xeolabs avatar Jan 18 '22 14:01 xeolabs

Hi, I tried to make a PR but then I realized it aimed at dist. I couldn't find the function mergeNestedFields in src. I would really like to support but also don't want to push anything wrong. Here is my suggestion to consider the las options:

function mergeNestedFields(mergedOptions, options) {
    for (const key in options) {
      if (key in options) {
        const value = options[key];
        if (Object.keys(DEFAULT_LAS_OPTIONS['las']).includes(key)){
          mergedOptions['las'][key] = options[key];
        } else {
          if (isPureObject(value) && isPureObject(mergedOptions[key])) {
              mergedOptions[key] = { ...mergedOptions[key],
              ...options[key]
              };
          } else {
              mergedOptions[key] = options[key];
          }
        }
      }
    }
  }

I also tried to simply add the DEFAULT_LAS_OPTIONS to the DEFAULT_LOADER_OPTIONS but this didn't work.

DB-EC-Hamburg-BIM avatar Jan 20 '22 07:01 DB-EC-Hamburg-BIM

This should be fixed now by #959, released in xeokit-sdk v2.3.3

xeolabs avatar Dec 15 '22 13:12 xeolabs