Giter Site home page Giter Site logo

dotbim's Introduction

dotbim header

dotbim (Schema version 1.1.0)

Release .NET Standard 2.0 .NET Framework 4.0

AddOnIcon_154x154

Introduction

Introducing an open-source and minimalist file format for BIM. Built to be easy to read and write.

Created by BIM developers for BIM developers.

An idiot admires complexity, while a genius appreciates simplicity - Terry Davis

Website: https://www.dotbim.net

Quick introduction video: https://www.youtube.com/watch?v=RSV-0-UrzhQ

BIM vs IFC comparison

.bim .ifc
Is it open? Yes Yes
Is it free? Yes Yes
Type Text file Text file
What it contains Geometry + data attached Geometry + data attached in a standardized way
Types of geometries allowed Triangulated meshes only A lot of different types: meshes, extrusions, b-reps etc.
Pages of documentation 1 100+

To see much more extended comparison check out Dion's comparison here: #8

Guide for developers

If you're a developer, check out this document: https://github.com/paireks/dotbim/blob/master/DeveloperTips.md

Apps supporting .bim

(alphabetical order)

Apps that support .bim files

Name Purpose Link Author
FacadeOption Facade modelling https://app.facadeoption.com FacadeOption
kolega.space Fully automated volume studies in a flash https://www.kolega.space/ Designbotic
Spacio Lets you design, analyse, and bring to life properly structured building proposals – all within the same day. https://spacio.ai/ Spacio
topologicpy An Advanced Spatial Modelling and Analysis Software Library for Architecture, Engineering, and Construction https://topologic.app/ Wassim Jabi
T-Rex Reinforcement modelling https://www.food4rhino.com/en/app/t-rex Wojciech Radaczyński

Viewers that support .bim files

Name Purpose Link Author
dotbim.three.js Viewer Viewer from dotbim.three.js Click Luiz Henrique Cassettari
Online 3d Viewer 3d viewer in browser https://3dviewer.net/ Viktor Kovacs, Agnes Gaschitz
STEP Viewer 3d viewer in browser Click GitHubDragonFly
xeokit Web Programming Toolkit for AEC Graphics https://xeokit.io/ Lindsay Kay

Connectors - plugins that allow to export and/or import of .bim files to other software

Name Link Author
dotbim-archicad Click Viktor Kovacs
dotbim-blender Click Nathan Hild
DotBimConvert/RevitExporter Click Ryuga Ryuzaki
dotbimGH Click Wojciech Radaczyński
dotbimRH Click Seghier Mohamed Abdelaziz
dotbim.three.js Click Luiz Henrique Cassettari
import_dotbim Click Mattia Bressanelli

Libraries for developers

Name Purpose Link Author
dotbim C# library you're looking at it right now ;) Wojciech Radaczyński
dotbimpy Python library https://github.com/paireks/dotbimpy Wojciech Radaczyński
dotbim_rust Rust library https://github.com/paireks/dotbim_rust Wojciech Radaczyński
dotbim-ts Typescript library https://github.com/baid-group/dotbim-ts Maciej Lutostański

Converters - programs that allow to convert to/from .bim files

Name Purpose Link Author
DotBimConvert/IFC Converts from IFC https://github.com/RyugaRyuzaki/DotBimConvert/tree/main/Ifc Ryuga Ryuzaki
dotbim-ifc Converts to and from IFC and dotbim https://github.com/Moult/dotbim-ifc Dion Moult
dotbim-io-dxf Converts to and from 3d DXF and dotbim https://github.com/Gorgious56/dotbim_io_dxf Nathan Hild
mesh2mesh Mac application with ability to convert from .dae, .obj, .ply, .scn, .stl, .usd, .usda, .usdz https://apps.apple.com/us/app/mesh2mesh/id1672770477 fluthaus
Online 3d Viewer 3d viewer with ability of conversion from .obj, .3ds, .stl, .ply, .gltf, .glb, .off, .3dm, .fbx, .dae, .wrl, .3mf, .amf, .ifc, .brep, .step, .iges, .fcstd. https://3dviewer.net/ Viktor Kovacs, Agnes Gaschitz

Other projects related to .bim

Name Purpose Link Author
DotBimConvert/Compress Compress and decompress .bim files Click Ryuga Ryuzaki
ICEBridge Blender plugin to send BIM data to IDA ICE Click Max Tillberg
os4bim/dotbim Converts Revit's detailed MEP to schematic 3d model Click Yoann Obry
three.model.bim 3d modelling in browser https://github.com/RyugaRyuzaki/three.model.bim Ryuga Ryuzaki

If you're building any app that will use .bim - let me know, I'll post it here :)

NuGet package

https://www.nuget.org/packages/dotbim/

It may require importing another nuget for Newtonsoft.Json library.

Structure

BIM_Structure_01

Documentation

Main information

  • .bim
  • License: MIT
  • JSON structure
  • x, y, z coordinates should be in meters
  • Decimal point should be used
  • JSON objects and properties should start with lowercase and with underscore as a seperator between words, e.g. schema_version

file

File contains 4 properties:

BIM_file_01

schema_version is the version of schema used in this file as string.

mesh

BIM_Mesh_01

mesh_id is integer >= 0 to reference this mesh later in the element.

coordinates

It is a big array of all coordinates of a mesh. It is structured in this way:

[X0, Y0, Z0, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3, ..., XN, YN, ZN]

Let's say our mesh is defined by 3 vertices: (0.0, 0.0, 0.0), (10.0, 0.0, 0.0) and (10.0, 5.0, 0.0), then your vertices_coordinates will look like this:

[0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 10.0, 5.0, 0.0]

Later in faces_ids we refer to these vertices by their order.

indices

It is a big array of ids (integers) that define all faces in a mesh. It is structured in this way:

[Face1_Id1, Face1_Id2, Face1_Id3, Face2_Id1, Face2_Id2, Face3_Id3, Face3_Id1, Face3_Id2, Face3_Id3, ..., FaceN_Id1, FaceN_Id2, FaceN_Id3]

If we'd like to create one-face mesh using vertices_coordinates from an example above, then it will look like this:

[0, 1, 2]

Pyramid example:

  "coordinates": [
    0.0,
    0.0,
    0.0,
    10.0,
    0.0,
    0.0,
    10.0,
    10.0,
    0.0,
    0.0,
    10.0,
    0.0,
    5.0,
    5.0,
    4.0
  ],
  "indices": [
    0,
    1,
    2,
    0,
    2,
    3,
    0,
    1,
    4,
    1,
    2,
    4,
    2,
    3,
    4,
    3,
    0,
    4
  ]

element

BIM_Element_01 guid is a string that can be used for comparison of different elements.

"guid": "76e051c1-1bd7-44fc-8e2e-db2b64055068"

vector

Vector places referenced mesh where it should be placed as an element. It should have 3 properties:

  1. x (value)
  2. y (value)
  3. z (value)
  "vector": {
    "x": 9.9266016462536122,
    "y": 3.3910972817343494,
    "z": 52.239445879618685
  }

rotation

Rotation rotates referenced mesh how it should be rotated as element. It is a quaternion. It should have 4 properties:

  1. qx (value) - first imaginary coefficient of the quaternion
  2. qy (value) - second imaginary coefficient of the quaternion
  3. qz (value) - third imaginary coefficient of the quaternion
  4. qw (value) - real part of the quaternion
  "rotation": {
    "qx": 0.63979295771454925,
    "qy": 0.10626982147910254,
    "qz": -0.12472093047736807,
    "qw": -0.7508770776915008
  }

color and face_colors

From schema_version 1.1.0 if face_colors tag is applied, then we color element using face_colors, if there is no face_colors - we use color tag to color an element.

color should have 3 properties:

  1. r (integer between 0-255) - red
  2. g (integer between 0-255) - green
  3. b (integer between 0-255) - blue
  4. a (integer between 0-255) - alpha
  "color": {
    "r": 255,
    "g": 255,
    "b": 0,
    "a": 255
  }

To color single element with multiple colors add "face_colors" tag inside an element. "face_colors" is a simple list of integers (integers should be between 0-255) organised in that way:

[r1, g1, b1, a1, r2, g2, b2, a2, r3, g3, b3, a3, ... rn, gn, bn, an]

It should match each face of the mesh.

So let's say you have 3 faces inside one mesh, and wanted to color first face (triangle) as red (255,0,0,255), second as skyblue (135,206,235,255), third as white (255,255,255,255). Then you will have:

"face_colors" : [ 255, 0, 0, 255, 135, 206, 235, 255, 255, 255, 255, 255 ]

type

Element type. It is a string that specifies what mesh represents. E.g. "Beam", "Plate".

"type": "Beam"

info

info is just a dictionary with string as key and value.

  "info": {
    "Name": "Teapot",
    "Price": "2.50$"
  }

.bim file format encourages users to link their data by attaching URLs inside properties of file or specific elements. E.g.:

  "info": {
    "Name": "Metal sheet roofing",
    "Catalogue": "https://pruszynski.com.pl/t-20-roof,prod,99,2294.php"
  }

Such functionality allows also to link one model with another as well. If you're interested in this kind of linking, check this separate document about it: https://github.com/paireks/dotbim/blob/master/LinkingData.md

Tell me more

If you'd like to read more details about this project, a bit background + line-by-line explanation, you might find this article on BIM Corner interesting: https://bimcorner.com/a-new-bim-file-format/

Authors

  • Wojciech Radaczyński
  • Viktor Kovacs

Advisors

  • Tom Van Diggelen
  • Harry Collin
  • Marios Messios

dotbim's People

Contributors

chuongmep avatar harrycollin avatar messiosmarios avatar paireks avatar ricaun avatar rojus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dotbim's Issues

Feature suggestion: Support multiple meshes per element

Would it be possible to allow an element to use multiple meshes, as a feature in a future schema version? This would enhance geometry reuse in combination with #38, allowing primitive shapes to be reused as parts of different elements.

Creating a UI in the 3d viewer for writing and changing the data in the schema

Would be great to add an option for the 3dViewer for editing the data in the schema so in such way the viewer could be used for managing information.

In this example: https://3dviewer.net/#model=https://raw.githubusercontent.com/IliyaMuzychuk/Dotbim/main/studios.bim I modeled a few of artists' studios for my friend as an idea to manage it online through dotbim. If we could add or edit the information of each mesh in the viewer, it can turn into a powerful tool for studio management (And perhaps and other asset management) that doesn't require expensive proprietary software and is accessible by everyone and anywhere. Conceptually it can bring the digital twin world to many other markets and be much more user friendly than BIM360 and similar products.

Would love to contribute, just I don't have the best skillsets for UI, but in any other way.

Thanks, and excited to see dotbim! I really think it could turn into amazing project with much more use cases than just the AEC!

File format change recommendations

I like the idea to have a new BIM file format that is easy to read and write. I also understand that the file format is intended to be really simple, but I think it has some limitations that should be addressed to make it more usable. I've collected my thoughts.

Recommendations for version 1.1.0

These are backward compatible changes.

  1. Introduce a name attribute for elements. It would be a big help in an application that lists all elements. Now only the type parameter can be used, so for example you will see "Wall, Wall, Wall, Slab, Wall, ...".

Recommendations for version 2.0.0

These are incompatible changes, but I think they would make a big difference in usability.

  1. One color per element is a big limitation. Just think about a window element. You probably would like to use different colors for the frame, glass, and handle. I would assign the color to the mesh object, and would allow multiple meshes for one element.
  2. There is no need for mesh_id in the mesh object. Meshes could be referenced by their index in the meshes array. Now an importer should build up a map to access meshes, because the mesh id can be any number. You can't be sure that the n th mesh has the id n.
  3. String info types are easy to handle, but doesn't allow real collaboration. For example if an exporter uses fractional inches, it will write a value like 2′–6″. If I would like to display it in meters I have to detect the unit, and then do the conversion during import, which is not a trivial thing to do.
  4. Hierarchical elements are missing. For example a stair can have multiple subelements (maybe with different metadata), but sometimes you would like to handle them all together. It would make harder to write an importer, but easier to use the end result.
  5. Normal vectors are missing. For curved elements it would be great to have normal vectors optionally.
  6. I would rename vector to position. 🙂

Hope that helps, keep up the good work.

Feature suggestion: Add 'scale' property to Elements?

Hi again, would it be possible to add a scale property on elements as a feature? This way, it would be possible, for example, to reuse the same cube-shaped mesh by elements with various box shapes. I think this feature would be important for when saving a .bim from a model representation that relies on scaling as part of geometry instancing, because otherwise such an application would then need to bake the scale into each instance, then save each instance to .bim as a separate mesh.

File / schema checker

Suggestion by Kevin was to provide a tool which will allow to upload a file and help to check if something is wrong with it.

Probably it would be good to use Typescript if there would be a browser app or Python for such script tool.

Introducing face colors

Problem statement

Right now that is a big limitation that one element can have only one color. It can be workarounded if you create multiple elements sorted by color, but that causes illogical separation of the element, and it's also not clear where metadata should be stored.

In most of the cases it's not possible to simplify an element to use only one color. For example the outside and inside color of a wall is often different. This limitation is even more serious in case of doors or windows, because these elements usually have different color for frame and glass, and the latter is usually transparent.

Proposed solution

I'd like to propose the following solution:

  • Bump the version to 1.1.0 signaling that the new version is backward compatible.
  • Add a new key to elements called face_colors. This can be an array integer of values that will contain r, g, b, a values for each face, int the same order as faces listed in the indices array.

The color should still remain mandatory, so viewers and importers that not yet support face colors will work without a problem. This solution is still very easy to parse, but I think it adds great value to the format.

Example

{
-  "schema_version": "1.0.0",
+  "schema_version": "1.1.0",
  "meshes": [
    {
      "mesh_id": 0,
      "coordinates": [ 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0 ],
      "indices": [ 0, 1, 2, 0, 2, 3 ]
    }
  ],
  "elements": [
    {
      "mesh_id": 0,
      "vector": { "x": 0.0, "y": 0.0, "z": 0.0},
      "rotation": { "qx": 0.0, "qy": 0.0, "qz": 0.0, "qw": 1.0 },
      "guid": "9f61b565-06a2-4bef-8b72-f37091ab54d6",
      "type": "Brick",
      "color": { "r": 255, "g": 0, "b": 0, "a": 255 },
+      "face_colors" : [ 255, 0, 0, 255, 0, 255, 0, 255 ]
      "info": {
        "Name": "Colored Element"
      }
    }
  ],
  "info": {
    "Author": "Viktor Kovacs"
  }
}

Question: possible to infer aggregation hierarchy from dotbim file?

Hi @paireks, I'm working on a dotbim importer for xeokit SDK, which likes to organize elements in an aggregation hierarchy for our explorer tree etc. We have three modes: "Containment", "Storeys" and "Types".

Apologies if I'm missing something, a question: the dotbim schema seems to have no explicit relationships (eg. containment/aggregation) between the elements, unless I'm missing something. Is there a way to get or infer that hierarchy (IfcSite, IfcBuildingStorey etc), or is dotbim more like a flattened container of graphical "leaf" elements?

We should be able to support "Types" in our tree at least though.

Thanks!

Support for BREP geometry

This format is really interesting for several reasons, mainly its simplicity and its easy compatibility with IFC. I will write importers/exporters for FreeCAD. (issue).

However, FreeCAD, as many other BiM applications, can work with higher-level geometry types than mesh, for ex. solids, NURBS curves and surfaces, or B-Rep geometry. These geometry types can for example represent curves in a much more precise and parametric way than triangle meshes.

So this issue is more to start a brainstorming: Could we support NURBS/BRep geometry in dotbim? And how?

I know ofseveral open formats available for Brep: opencascade's native brep format, opennurbs (rhino), there is ACiS too which has open implementations (but almost never used anymore in favor of autodesk's closed ACIS version), and IFC itself, with IfcAdvancedBrep.

All these formats could either be represented as a string or (to be investigated), probably as a json structure. Speckle has json-like support for openNURBS brep, that could be an easy path.

Last question about implementation, would a brep geometry replace the mesh, or come alongside? Keeping always a mesh representation, even if there is brep too, could be interesting as it would allow non-brep apps to open the file too. But it would inflate the file size. Best path maybe, let it optional? Mesh, Brep, or Mesh+Brep?

I'm willing to explore this topic further, if there is interest

dotbim and stl

This is a very interesting project. I am very interested in how this can be taken forward in context of 3d model to simulations. Therefore my question is are there converters for dotbim to stl or something which can be used for meshing in fem solver? I can imagine this could be straightforward as both format stores meshes

BIM and IFC comparison

Hey guys! I just want to start by saying that your work is awesome! However (here it comes!) I think it is important to have a more comprehensive comparison of dotbim and IFC so that people understand the strengths of each and know which to use for their purpose. The table seemed a little simplistic right now. Would you be interested in updating the README comparison table with some of these differences?

  1. Serialisation. dotbim is JSON only. IFC is serialisation agnostic, including SPF, JSON, XML, HDF5, TTL, SQLITE, ZIP. Obviously the latter adds complexity (both docs and implementation) in exchange for portability.
  2. Schema definition. dotbim seems to be described with C#. This is great for those in the C# ecosystem and comes with the lib prepackaged. Outside, especially on Linux, perhaps not so fun. IFC is defined in EXPRESS, UML, and OWL, but actual language classes/bindings are provided by third party library developers. Again, a tradeoff in a rapid hello world in a language and tech stack flexibility.
  3. Scope. dotbim seems to optimise simplicity: meshes with key value pairs. IFC is designed for more domains: structural analysis, profile libraries, energy analysis, tasks and sequencing, textures, facility management, building operations, events, procedures, lifecycle flows, cost databases and schedules, and so on. These primarily non-geometric usecases are what make IFC cool, but as a trade off, comes with an extra 99 pages of docs :)
  4. Classification. dotbim seems to be classification agnostic, this is pretty awesome! IFC comes built-in with an implicit classification system (though it can be ignored) which is sometimes a requirement of other standards (e.g. COBie). This difference makes dotbim far easier to use as you don't need to learn another vocabulary, but can be harder to collaborate if people use different classifications.
  5. Ecosystem. Early days, but exciting days, for dotbim! Obviously with a 25 year headstart and a ton of funding IFC has its creepers everywhere for better or for worse and the apps and developer libraries that exist are more mature.
  6. Standardisation. dotbim is not an ISO standard. IFC is. This means dotbim is much more nimble and can adapt to user needs faster. However, it also means that governments and neutral parties or those who need stability are more likely to prescribe IFC. As an ISO standard, it also integrates other standards: gbXML explicitly references IFC for energy analysis, Brickschema has a two-way IFC integration for building management systems, IFC textures and shaders are compatible with X3D and glTF, and so on. So whereas dotbim can translate to other things, it probably won't quite get the "native" integration that ISO standards do.

It's probably good to have IFC on the comparison table because IFC is stupidly popular, but at the same time has such a strikingly different audience: things like ISO, tech agnosticism, and an appetite for building scope that is downright scary - but many people either don't know what IFC can do, or they do, but they legitimately want a more lightweight solution.

To emphasize what makes dotbim truly awesome, it'd be good to perhaps add some other libraries that have a similar scope to dotbim (as opposed to IFC which is at the other end of the spectrum). Maybe https://hypar-io.github.io/Elements/index.html Hypar Elements or Speckle Objects https://speckle.guide/dev/objects.html comes to mind.

Keep up the great work! I've added dotbim to https://wiki.osarch.org/index.php?title=AEC_Open_Data_Standards_Directory :)

Provide test files for conformance testing

It would be much easier to write an importer if there would be some test files available with different important scenarios (like transformations or reusing a mesh with different colors).

Exporting BIM to GLB format with DRACO compression

@paireks here is something that you might eventually find interesting since it seems to have a high potential when it comes to the sizes of the models.

This all relates to exporting BIM files to GLB format with DRACO compression and has been implemented in my STEP Viewer.
I did make some additional updates to BIM Loader on my end and the exported GLB file should have meshes names but not material names.

EDIT: Material names have been fixed and should show as either Default or Default Material or the name provided by the model.

The exported file is rather small when compared to the original BIM file and you could test run some of your examples and then compare it to the Online 3D Viewer.

Since this is not an issue it can be closed at any time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.