xeokit / xeokit-convert

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

Error converting VectorWorks 20 file #12

Open gc-snglr opened 2 years ago

gc-snglr commented 2 years ago

When converting IFC files exported from VectorWorks 20 we get the following error:

Debugger listening on ws://127.0.0.1:9229/ae17d9a7-733d-4ea3-be1f-05c87148462e
For help, see: https://nodejs.org/en/docs/inspector
web-ifc: 0.0.29 threading: 0
Error: TypeError: Cannot read property 'value' of null
    at /home/gidoca/src/third_party/xeokit/xeokit-convert/xeokit-convert/dist/convert2xkt.cjs.js:48846:81
    at Array.forEach (<anonymous>)
    at parseRelatedItemsOfType (/home/gidoca/src/third_party/xeokit/xeokit-convert/xeokit-convert/dist/convert2xkt.cjs.js:48844:25)
    at parseSpatialChildren (/home/gidoca/src/third_party/xeokit/xeokit-convert/xeokit-convert/dist/convert2xkt.cjs.js:48792:5)
    at /home/gidoca/src/third_party/xeokit/xeokit-convert/xeokit-convert/dist/convert2xkt.cjs.js:48848:21
    at Array.forEach (<anonymous>)
    at parseRelatedItemsOfType (/home/gidoca/src/third_party/xeokit/xeokit-convert/xeokit-convert/dist/convert2xkt.cjs.js:48844:25)
    at parseSpatialChildren (/home/gidoca/src/third_party/xeokit/xeokit-convert/xeokit-convert/dist/convert2xkt.cjs.js:48784:5)
    at /home/gidoca/src/third_party/xeokit/xeokit-convert/xeokit-convert/dist/convert2xkt.cjs.js:48848:21
    at Array.forEach (<anonymous>)

The reason appears to be that the file contains lines like the following:

#66033=IFCRELDEFINESBYPROPERTIES('01b$bsqtH0eBDv9j4xF5mW',#1,$,$,($),#64425);

Specifically ($) seems to cause problems here (and does not really make sense, but still ends up in real world files). This commit on my fork contains a hack that allows the file to run through.

gc-snglr commented 2 years ago

An example file to reproduce the issue can be found here.