bldrs-ai / ifctool

Command line tools for working with IFC models
https://bldrs-ai.github.io/ifctool
16 stars 5 forks source link

v5.4.8: finish end-to-end wiring for pipeline of findLevels. #37

Closed pablo-mayrgundter closed 2 years ago

pablo-mayrgundter commented 2 years ago

Hi Mohammed,

Here's the working version. Sorry about that!

UPDATED: 5.4.2 -> 5.4.8 It's available as @bldrs-ai/ifclib@5.4.8. You should be able yarn install and import that and then like tool/src/main.js#L133:

const flags = {
  "stages": [
    {
      "name": "findLevels",
      "config": {}
    }
  ]
}
ifcProps = await processIfcBuffer(rawFileData, flags)

The flags are the same as passed in shell with the --pipeline flag. You can test ifclib by fetching this branch as well and running this locally:

pablo@top:~/c/pm/ifctool> node tool/src/main.js index.ifc --pipeline='{"stages":[{"name":"findLevels","config":{}}]}'
{
  "type": "ifcJSON",
  "version": "0.0.1",
  "schemaIdentifier": "<unknown; TODO(pablo)>",
  "originatingSystem": "IFC2JSON_js 5.4.8",
  "preprocessorVersion": "web-ifc 0.0.34",
  "timeStamp": "2022-09-02T03:38:50.923Z",
  "data": [
    {
      "findLevels": {
        "status": "ok",
        "levelHeights": [
          0.9
        ]
      }
    }
  ]
}
mkeshavarzi commented 2 years ago

Confirming it also works on my end with our developed test data:


unexpected empty ifc project
{
  "type": "ifcJSON",
  "version": "0.0.1",
  "schemaIdentifier": "<unknown; TODO(pablo)>",
  "originatingSystem": "IFC2JSON_js 5.4.2",
  "preprocessorVersion": "web-ifc 0.0.34",
  "timeStamp": "2022-09-05T05:17:38.113Z",
  "data": [
    {
      "findLevels": {
        "status": "ok",
        "levelHeights": [
          0.9,
          3.6
        ]
      }
    }
  ]
}```
mkeshavarzi commented 2 years ago

When loading ifclib in Share an impoting `import {processIfcBuffer} from '@bldrs-ai/ifclib',

I get the following:

The package "fs" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.

I've commented all functions that use fs for now, but wondering if you have the same issue?

pablo-mayrgundter commented 2 years ago

Ah, I see it too. Will fixup tomorrow. Sorry for the delay!

pablo-mayrgundter commented 2 years ago

Created new ifclib version

yarn add @bldrs-ai/ifclib@5.4.8

Tested locally and it gets past that error now. Try using the processIfcBuffer call again and see if that's all you need.

pablo-mayrgundter commented 2 years ago

PTAL

mkeshavarzi commented 2 years ago

LGTM