Skip to content

andrewisen/bim-whale

Repository files navigation


Logo

The BIM Whale Project

BIMWHALE.js | A simple client-side IFC parser
View the demo »

Explore docs · Access IFC sample files · Report Bug · Request Feature

Table of Contents
  1. About
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Extra

About

The BIM Whale (Swedish: BIM-valen) is a project about the Industry Foundation Classes (IFC) format. The aim of this project is to:

I: Introduce and explain the basics of IFC schema

II: Teach people how to parse an IFC file and retrieve basic information

In more specific terms, the goal of this project is to:

A: Provide a simple and fast IFC parser

B: Provide learning resources (documentation, videos, power points) to people within the AEC industry

Goal A has been realized as BIMWHALE.js, i.e. this repo. BIMWHALE.js is a simple client-side IFC parser built using TypeScript.

Please note that the BIMWHALE.js is NOT supposed to be an all singing, all dancing parser. This project is only looking to parse information that we know exists, so-called User Defined IFC Property Sets.

Again, the focus with The BIM Whale Project is to educate people. The code itself and its functionality are secondary.

Explore the docs for more information.

FAQ

Question: What does The BIM Whale do?

Answer: Parse so-called User Defined IFC Property Sets from an IFC file

Q: What does The BIM Whale NOT do?

A: Parse entity attributes, parse geometry, follow the EXPRESS standard, etc. etc.

Q: What is an IFC file?

A: Industry Foundation Classes (IFC) is a standardized, digital description of a BIM model. See IFC for more information.

Q: What is a STEP file?

A: A STEP-File is the format IFC uses. See ISO 10303-21 for more information

Q: Is this code "hand made"?

A: Yes, the code is hand made. The parsing is not derived from an EXPRESS definition.

Q: Is the code ready for production?

A: No, not yet. See open issues for more info

Getting Started

  1. A compiled JS bundle file is available here:

https://cdn.jsdelivr.net/gh/andrewisen/bim-whale/dist/BIMWHALE.min.js

  1. Add it to your project
<script src="https://cdn.jsdelivr.net/gh/andrewisen/bim-whale/dist/BIMWHALE.min.js"></script>
  1. Use the FileReader API and create a new IfcFile object
// The libary is called: BIMWHALE
var fileReader = new FileReader();
fileReader.onload = function (e) {
    const lines = e.target.result.split(/\r\n|\n/);
    let ifcFile = new BIMWHALE.IfcFile(lines, config);
    ifcFile.parseIfcFile();
};
fileReader.readAsText(file);
  1. See the docs for more information: docs.bimvalen.se

Local Development

These next steps will guide you to set up your own development platform.

Prerequisites

This repository uses Deno as the runtime for TypeScript.

Installation

  1. Clone the repo

    git clone https://github.com/andrewisen/bim-whale.git
  2. Replace the following files with your own content.

  • index.ts
  • src/config.ts

The easiest approach is to copy content of the example.NAME.ts file.

In other words: Replace index.ts with the content inside example.index.ts.

  1. Make sure you update src/config.ts and provide a correct filePath. You can download some sample files here: https://github.com/andrewisen/bim-whale-ifc-samples

  2. Check if Deno is working

    deno run --allow-read checkDeno.ts

Any errors until this point are likely due to Deno. Submit an issue if have any problems.

Usage

  • Run the app with:
   deno run --allow-read index.ts

SimpleWall Sample File

Download the SimpleWall Sample File here. The sample consist of:

  • A wall
  • A door

Here's a screenshot:

Screenshot

The IFC file has a Property Set called Custom_Pset. Please note that the file only contains dummy data.

Screenshot

Make sure to update src/config.ts and provide a correct filePath. You should get the following result:

{
  TypeMark: "_TYPE-MARK_",
  Keynote: "_KEYNOTE_",
  StoreyName: "Level: Level 1",
  TypeDescription: "_DESCRIPTION_",
  StatusConstruction: "New Construction",
  NetArea: "14.04739",
  Height: "4000.",
  Width: "200.",
  Length: "4000.",
  Hyperlink: "_URL_"
}
{
  TypeMark: "20",
  Keynote: "--KEYNOTE--",
  StoreyName: "Level: Level 1",
  TypeDescription: "--DESCRIPTION--",
  StatusConstruction: "New Construction",
  NetArea: "3.18957899999998",
  Height: "2134.",
  Width: "915.",
  SillHeight: "0.",
  Hyperlink: "--URL--"
}

In summary: We have performed a simple parsing.

We have only included walls and doors in our config file. See: const selectedEntities: string[] = ["IFCDOOR", "IFCWALLSTANDARDCASE"];

TODO

Roadmap

This project is still in it's early development. And yes, it still has some bugs. Please be patience!

See the open issues for a list of proposed features (and known issues).

Contributing

This project is still in it's early development. But, any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

See LICENSE for more information.

Contact

Extra

Not what you're looking for? Check out these projects instead!