/webify-bim

Prepare BIM Files for the use in the Web

Primary LanguageTypeScript

WebifyBim

Prepare BIM Files for the use in the Web

Version xbim Toolkit

WebifyBim is a command line application that convert BIM Files in form of IFC files and converts them to WEXBIM, a format optimized for the web. This also generates database entries for all instances in the models

Requirements

  • Windows, this sadly only runs on Windows. This is caused by the used geometry library that converts the files to WEXBIM. See XbimGeometry#306.
  • Postgres Database, all converted data is inserted into a Postgres database. Therefore, a reachable database is necessary.

Usage

Download the latest EXE from the releases tab. Then call the EXE from a shell (like cmd or powershell).

# Options are options flags, see below
# Files are paths to IFC files 
WebifyBim.exe [Options...] [Files...]

Note Models of an entire building may take several minutes up to some hours!

Option Flags

By passing option flags you can specify the behaviour of the application.

  • -n, --name set the name of the model
  • -d, --description set the description of the model
  • -f, --force force inserting the files even if they already exist in the database
  • -e, --env pass a dotenv file to set environment variables
  • -l, --loglevel set the log level of the application, defaults to $env:LOG_LEVEL or "info"
  • -u, --user set the username for the postgres db, defaults to $env:PG_USER or "postgres"
  • -h, --host set the host name of the postgres db, defaults to $env:PG_HOST or "localhost"
  • -P, --port set the port of the postgres db, defaults to $env:PG_PORT or 5432 (the default postgres port)
  • -p, --password set the password for the postgres db user, beware of usage in CI, defaults to $env:PG_PASS
  • -D, --database set the database name for the data to insert into, defaults to $env:PG_DB or "wisdom"
  • --hash-algo set the hashing algorithm for the source files, defaults to $env:HASH_ALGO or "md5"
  • --hash_len set the length of hashes generated by the hash algo, defaults to $env:HASH_LEN or 32

Environment Variables

Most of the option flags may be set using environment variables. The order of values used is as follows:

passed flag to command > environment variable > static default

Using the flag --env you can pass a dotenv file to set environment variables.

Build from Source

This application can easily be built and bundled on your machine if you have all the necessary SDKs installed.

Requirements

Bundle the application yourself

# clone the repository
git clone https://github.com/wisdom-oss/webify-bim.git

# navigate into cloned repository
cd webify-bim

# let npm install all dependencies
npm install

# run the bundle scripts, this also builds the application
npm run bundle

After that in the dist directory you find a .exe of the application.

Technical Details

Database Usage

Upon start the application runs the create_schema.sql query to create a new schema for the bim files if not already existent.

The schema also expects the size of the hashes used to check if files are already in the database. Therefore, the hash algorithm and size should always be the same!

The entire insertion is handled within a transaction to keep the database persistent.

WEXBIM Conversion

This tool uses the XbimEssentials and the XbimGeometry packages to convert the given .ifc files to .wexbim and .xml.

Since most of this application is written in TypeScript the conversion part is just a small cli written in C# and built as a standalone .exe.

Bundling

This tool is meant to be used on devices that do not have any SDKs installed, therefore the entire application is bundled using caxa.