|
1 | 1 | IfcDiff |
2 | 2 | ======= |
3 | 3 |
|
4 | | -This documentation is free software! You are free to contribute and help write |
5 | | -this document. |
| 4 | +IfcDiff is both a CLI utility and library that lets you compare the changes |
| 5 | +between two IFC models. Changes are made on the assumption that the GlobalId of |
| 6 | +an element in one model is consistent with the same element in another model. |
| 7 | +You may compare geometric changes, and changes in various IFC relationships and |
| 8 | +properties. IfcDiff supports comparing across different IFC schema versions. |
6 | 9 |
|
7 | | -.. toctree:: |
8 | | - :maxdepth: 1 |
9 | | - :caption: Contents: |
| 10 | +Changes will be sorted into three lists: |
10 | 11 |
|
11 | | -Indices and tables |
12 | | ------------------- |
| 12 | +- **Added**: a list of GlobalIds of elements present in the new file but not |
| 13 | + present in the old file. |
| 14 | +- **Deleted**: a list of GlobalIds of elements present in the old file but not |
| 15 | + present in the new file. |
| 16 | +- **Changed**: A list of GlobalIds of elements present in both the old and new |
| 17 | + file, but changes were detected. A list of changes are provided. |
13 | 18 |
|
14 | | -* :ref:`genindex` |
15 | | -* :ref:`modindex` |
16 | | -* :ref:`search` |
| 19 | +There are different methods of installation, depending on your situation. |
| 20 | + |
| 21 | +1. **Source installation** is recommended for users wanting to use the latest |
| 22 | + code as a library or a CLI utility. |
| 23 | +2. **Using the BlenderBIM Add-on** is recommended for non-developers wanting a |
| 24 | + graphical interface. |
| 25 | + |
| 26 | +Source installation |
| 27 | +------------------- |
| 28 | + |
| 29 | +1. :doc:`Install IfcOpenShell <ifcopenshell-python/installation>` |
| 30 | +2. `Clone the source code <https://github.com/IfcOpenShell/IfcOpenShell/tree/v0.7.0/src/ifcdiff>`_. |
| 31 | +3. ``pip install -r requirements.txt`` |
| 32 | + |
| 33 | +Here is a minimal example of how to use IfcDiff as a Python module or CLI |
| 34 | +utility: |
| 35 | + |
| 36 | +:: |
| 37 | + |
| 38 | + $ python -m ifcdiff -h |
| 39 | + usage: ifcdiff.py [-h] [-o OUTPUT] [-r RELATIONSHIPS] old new |
| 40 | + |
| 41 | + Show the difference between two IFC files |
| 42 | + |
| 43 | + positional arguments: |
| 44 | + old The old IFC file |
| 45 | + new The new IFC file |
| 46 | + |
| 47 | + options: |
| 48 | + -h, --help show this help message and exit |
| 49 | + -o OUTPUT, --output OUTPUT |
| 50 | + The JSON diff file to output. Defaults to diff.json |
| 51 | + -r RELATIONSHIPS, --relationships RELATIONSHIPS |
| 52 | + A list of space-separated relationships, chosen from "type", "property", "container", "aggregate", "classification" |
| 53 | + $ python -m ifcdiff old.ifc new.ifc |
| 54 | + $ cat diff.json |
| 55 | + |
| 56 | +Here is a minimal example of how to use IfcDiff as a library: |
| 57 | + |
| 58 | +.. code-block:: python |
| 59 | +
|
| 60 | + from ifcdiff import IfcDiff |
| 61 | +
|
| 62 | + ifc_diff = IfcDiff("/path/to/old.ifc", "/path/to/new.ifc", "/path/to/diff.json") |
| 63 | + ifc_diff.diff() |
| 64 | + print(ifc_diff.change_register) |
| 65 | + ifc_diff.export() |
| 66 | +
|
| 67 | +.. seealso:: |
| 68 | + |
| 69 | + For more information on how to use IfcDiff as a library, check out the :doc:`API |
| 70 | + reference <autoapi/ifcdiff/index>`. |
| 71 | + |
| 72 | + |
| 73 | +Using the BlenderBIM Add-on |
| 74 | +--------------------------- |
| 75 | + |
| 76 | +The BlenderBIM Add-on is a Blender based graphical interface to IfcOpenShell. |
| 77 | +Other than providing a graphical IFC authoring platform, it also comes with |
| 78 | +IfcOpenShell, its utilities, and a Python shell built-in. This means you don't |
| 79 | +need to install Python first, and you also can compare your IfcOpenShell |
| 80 | +scripting to what you see with a visual model viewer, or use a graphical |
| 81 | +interface to access the IfcOpenShell utilities. |
| 82 | + |
| 83 | +1. Install the BlenderBIM Add-on by following the `BlenderBIM Add-on |
| 84 | + installation documentation |
| 85 | + <https://blenderbim.org/docs/users/installation.html>`_. |
| 86 | + |
| 87 | +2. Launch Blender. Change to the **Scene Properties** tab in the **Properties |
| 88 | + Panel**. Scroll down to the **IFC Quality Control > IFC Diff** panel. |
| 89 | + |
| 90 | +3. Browse to your old IFC file, new IFC file. |
| 91 | + |
| 92 | +4. Optionally add any relationships you want to check. |
| 93 | + |
| 94 | +5. Optionally type in a filter query. |
| 95 | + |
| 96 | +6. Press **Execute IFC Diff** |
| 97 | + |
| 98 | +TODO: add pictures and make this clearer for non-developers. |
| 99 | + |
| 100 | +Geometry changes |
| 101 | +---------------- |
| 102 | + |
| 103 | +IfcDiff compares geometry changes using the underlying IFC geometric definition. |
| 104 | +This means that if a shape is described in one file as an extrusion, and as a |
| 105 | +mesh in another file, it is considered to be a change in geometry, even if they |
| 106 | +resolve to be the same boundary representation. |
| 107 | + |
| 108 | +Geometric tolerance is defined using the precision defined in the new IFC model. |
| 109 | + |
| 110 | +Relationships |
| 111 | +------------- |
| 112 | + |
| 113 | +By default, IfcDiff only compares changes in attributes and geometry. You may |
| 114 | +wish to optionally specify more relationships to compare. You may choose from: |
| 115 | + |
| 116 | +- **type**: detects changes in the type relationship, such as when an |
| 117 | + occurrence now belongs to a different type. |
| 118 | +- **property**: detects changes in property sets, properties, quantity sets, |
| 119 | + and quantities. Also includes detected changes in inherited properties. |
| 120 | +- **container**: detects changes in the spatial container, handling indirect |
| 121 | + containment such as when an element is part of an aggregate. |
| 122 | +- **aggregate**: detects changes in aggregation. |
| 123 | +- **classification**: detects changes in classification references. Also |
| 124 | + includes detected changes in inherited classifications. |
0 commit comments