xeokit / xeokit-convert

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

LAS/LAZ conversion not working #26

Open UUTek opened 2 years ago

UUTek commented 2 years ago

Im trying to convert LAS/LAZ files to xkt, but there is an error in the logs and the xkt file is wrong. Logs: issue

lukvermeulen commented 2 years ago

Having the same issue here, when using the convert2xkt function in Node.JS.

The same function works fine when uploading ifc files, but when using a .LAS/LAZ file (e.g. indoor.0.1.laz from the xkt-sdk assets), the above mentioned Error: ReferenceError: Response is not defined appears. The function still returns that it succesfully converted and the converted file can be seen in the file explorer, but it is tiny (just some kb) and can not be loaded into the viewer.

import convert2xkt from "@xeokit/xeokit-convert/dist/convert2xkt.cjs.js";

//...

convert2xkt({
      source: path,
      output: "uploads_converted/" + filename + ".xkt",
      log: (msg) => {
        console.log(msg);
      },
    }).then(
      () => {
        console.log("Converted.");
      },
      (errMsg) => {
        console.log("Conversion failed: " + errMsg);
      }
    );

//...
xeolabs commented 1 year ago

I can't currently reproduce the CLI issue with xeokit-convert 1.1.5 on Ubuntu, nodejs v16.17.1:

node convert2xkt.js -s assets/models/laz/indoor.0.1.laz -o test.laz.xkt -l
[convert2xkt] Running convert2xkt v1.1.5...
[convert2xkt] Reading input file: assets/models/laz/indoor.0.1.laz
[convert2xkt] Input file size: 1644.72 kB
[convert2xkt] Using parser: parseLASIntoXKTModel
[convert2xkt] Converting LAZ/LAS
[convert2xkt] Input file parsed OK. Building XKT document...
[convert2xkt] XKT document built OK. Writing to XKT file...
[convert2xkt] Converted to: XKT v10
[convert2xkt] XKT size: 3573.75 kB
[convert2xkt] XKT textures size: 0.01kB
[convert2xkt] Compression ratio: 0.46
[convert2xkt] Conversion time: 1.36 s
[convert2xkt] Converted metaobjects: 2
[convert2xkt] Converted property sets: 0
[convert2xkt] Converted drawable objects: 1
[convert2xkt] Converted geometries: 1
[convert2xkt] Converted textures: 0
[convert2xkt] Converted textureSets: 0
[convert2xkt] Converted triangles: 0
[convert2xkt] Converted vertices: 808042
[convert2xkt] Converted UVs: 0
[convert2xkt] Converted normals: 0
[convert2xkt] minTileSize: 200
[convert2xkt] Writing XKT file: test.laz.xkt
[convert2xkt] Done.