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

convert2xkt.js IFC to XKT has error web-ifc: 0.0.34 threading: 0 Error: ${err} #56

Open Moult opened 2 years ago

Moult commented 2 years ago

I'm trying this command:

$ node ./node_modules/@xeokit/xeokit-convert/convert2xkt.js -s foo.ifc -o hyd.xkt -l                                                                                           
[convert2xkt] Reading input file: foo.ifc
[convert2xkt] Input file size: 48258.68 kB
[convert2xkt] Converting...
web-ifc: 0.0.34 threading: 0
Error: ${err}

Any ideas how I can help debug?

Note: that was installed via npm i @xeokit/xeokit-convert

If I clone from main and npm install then get this instead:

$ node convert2xkt.js -s hyd.ifc -o hyd.xkt -l 
[convert2xkt] Reading input file: hyd.ifc
[convert2xkt] Input file size: 48258.68 kB
[convert2xkt] Converting...
web-ifc: 0.0.34 threading: 0
Error: TypeError: FromRawLineData[rawLineData.type] is not a function
xeolabs commented 2 years ago

See if v1.1.1 does the trick - it's working OK for me, on my Ubuntu/Thinkpad - see below.

In v1.1.1, I've updated web-ifc to 0.0.35, so that could make a difference.

Also FYI, we've had a couple of users who needed to compile the web-ifc.wasm dependency for their particular server hardware, just in case you're running on something exotic.

Here's my test:

node convert2xkt.js -s assets/models/ifc/Duplex.ifc -o Duplex.xkt -l
[convert2xkt] Running convert2xkt v1.1.1...
[convert2xkt] Reading input file: assets/models/ifc/Duplex.ifc
[convert2xkt] Input file size: 2327.79 kB
[convert2xkt] Using parser: parseIFCIntoXKTModel
web-ifc: 0.0.34 threading: 0
[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: 142.75 kB
[convert2xkt] XKT textures size: 0.01kB
[convert2xkt] Compression ratio: 16.31
[convert2xkt] Conversion time: 4.15 s
[convert2xkt] Converted metaobjects: 233
[convert2xkt] Converted property sets: 1369
[convert2xkt] Converted drawable objects: 206
[convert2xkt] Converted geometries: 405
[convert2xkt] Converted textures: 0
[convert2xkt] Converted textureSets: 0
[convert2xkt] Converted triangles: 17544
[convert2xkt] Converted vertices: 42078
[convert2xkt] Converted UVs: 0
[convert2xkt] Converted normals: 0
[convert2xkt] minTileSize: 200
[convert2xkt] Writing XKT file: Duplex.xkt
[convert2xkt] Done.
baoxiaozhi commented 2 years ago

This is my command: PS E:\code\trunk\lizheng-gdm-vue3> node ./node_modules/@xeokit/xeokit-convert/convert2xkt.js -s ./public/app/data/projects/yuxinxiaoqu/yuxinxiaoqu.ifc -o yuxinxiaoqu.xkt -l [convert2xkt] Running convert2xkt v1.1.2... [convert2xkt] Reading input file: ./public/app/data/projects/yuxinxiaoqu/yuxinxiaoqu.ifc [convert2xkt] Input file size: 4425.22 kB [convert2xkt] Using parser: parseIFCIntoXKTModel web-ifc: 0.0.34 threading: 0 [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: 178.34 kB [convert2xkt] XKT textures size: 0.01kB [convert2xkt] Compression ratio: 24.81 [convert2xkt] Conversion time: 4.52 s [convert2xkt] Converted metaobjects: 38 [convert2xkt] Converted property sets: 36 [convert2xkt] Converted drawable objects: 18 [convert2xkt] Converted geometries: 18 [convert2xkt] Converted textures: 0 [convert2xkt] Converted textureSets: 0 [convert2xkt] Converted triangles: 24339 [convert2xkt] Converted vertices: 73017 [convert2xkt] Converted UVs: 0 [convert2xkt] Converted normals: 0 [convert2xkt] minTileSize: 200 [convert2xkt] Writing XKT file: yuxinxiaoqu.xkt [convert2xkt] Done.