xeokit / xeokit-convert

Convert various AEC model formats for efficient viewing in the browser with xeokit.
https://xeokit.github.io/xeokit-convert/docs/
Other
49 stars 52 forks source link

Issues with las to xkt-conversion #30

Open steege252 opened 2 years ago

steege252 commented 2 years ago

I had several issues with converting a las-file to xkt. I'm neither an expert for node.js nor for 3d-file-formats or ifc. Our goal is to load an ifc-file and a point cloud scan of the built model into the same viewer. Unfortunately, I can't provide the raw input data. Both files are in the same coordinate system. If I open the raw data with blender both models are on top of each other and everything is fine.

I did some edits directly in dist/convert2xkt.cjs.js to get the conversion to work:

a) (see #26 ): I just added "typeof Response !== 'undefined'" to some ifs at various places. (main issue was in function validHTTPResponse(), somewhere around line 50960. Can this ever be defined within a CLI-tool?)

b) the --rotatex parameter is not used for LAS-files, only for LAZ. (there is some big switch-block with various file formats in function convert2xkt, somewhere around line 83500.) I don't know if this was intentional or just forgotten, but for my point cloud it didn't work without it. From my understanding, LAS and LAZ should be basically the same, LAZ has just better compression?

c) the entire point cloud was mirrored. To fix this I changed the coordinate shifting in function readPositions (around line 71450) to positionsValue[i + 2] = temp * -1; If this is, depending on the input-data, an issue in some cases, but not in all, maybe this should be another cli parameter?

Not sure if this is helpful, but with these changes, so far, everything seems to be working fine for me.

xeolabs commented 1 year ago

I just fixed (b) in #88 - published in xeokit-convert 1.1.5

I'm not sure what's happening with (a, #26) though - I can't reproduce this issue on my end with xeokit-convert 1.1.5.

Sounds like (c) may need a special option, yes. If that's still needed, could you open an issue for that one? Thanks