Ifcopenshell: Any plans for rule checking?

Created on 31 Dec 2016  路  9Comments  路  Source: IfcOpenShell/IfcOpenShell

I am learning to use IfcOpenShell. One thing I noticed was that I could assign any value to attributes disregarding IFC rules (WHERE). For example site.RefLatitude = (-87, -120, -21, -839999) works while -120 is outside the defined boundary of -60 to +60. I wonder if there are any plans to add rule-checking functionality. If not, is there any open source project written in C/C++ that has such a functionality?

question

All 9 comments

are these rules defined in the IFC spec?

Yes. If you follow the definition of RefLatitude you get to IfcCompoundPlaneAngleMeasure where it has defined 4 rules as below:

TYPE IfcCompoundPlaneAngleMeasure = LIST [3:4] OF INTEGER;
 WHERE
    WR1 : { -360 <= SELF[1] < 360 };
    WR2 : { -60 <= SELF[2] < 60 };
    WR3 : { -60 <= SELF[3] < 60 };
    WR4 : ((SELF[1] >= 0) AND (SELF[2] >= 0) AND (SELF[3] >= 0)) OR ((SELF[1] <= 0) AND (SELF[2] <= 0) AND (SELF[3] <= 0));
END_TYPE;

We have communicated a road map a while back. This is there for version 0.8 [1]. At the current pace of development that might be several years out unfortunately. The truth is that there aren't that many meaningful where clauses in the schema so this has never been given priority. If this is something you would be willing to work on I'd be happy to assist though. The schema is properly parsed, for cases like above it wouldn't be that difficult to augment the code generator to generate C++ for them. Note that EXPRESS also allows for turing complete functions, which might be another story.

Be sure to ask around at https://github.com/stepcode/stepcode. The only open source project I know for sure has a comprehensive implementation of this is http://www.jsdai.net/ but that's not C++.

[1] https://sourceforge.net/p/ifcopenshell/discussion/1782718/thread/b5e3ee85/#b6b2

to augment the code generator to generate C++ for them

Last time I worked with C++ was 15 years ago. I am not sure if I can handle it now. I thought IFCOS is written in Python. Where can I learn more about IFCOS's architecture?

Note that EXPRESS also allows for turing complete functions, which might be another story.

Can you please provide a link so I can learn a bit more about this.

Stepcode looks promising. Is IFCOS using any code base from Stepcode? I found a page from long time ago which talks about IFCOS.

Also, BIMserver claims that their IFC is "valid" IFC which I thought they have implemented rule-checking in their database transactions.

JSDAI project on github seems to be dead :(

Last time I worked with C++ was 15 years ago. I am not sure if I can handle it now. I thought IFCOS is written in Python. Where can I learn more about IFCOS's architecture?

IfcOpenShell is mostly C++ with a rather complete, but not 1-1 python interface generated using SWIG. Documentation on the architecture currently is sparse, if available at all.

Note that EXPRESS also allows for turing complete functions, which might be another story.
Can you please provide a link so I can learn a bit more about this.

Documentation on EXPRESS is also sparse, as it is rather 'old technology' and most information is hidden in ISO documents. More intricate examples in the IFC schema are e.g. IfcCrossProduct which is used to assess whether an IfcAxis2Placement3D is valid.

Is IFCOS using any code base from Stepcode?

Unfortunately not. I would like the IfcOpenShell code base to be modular and to be able to plug-in for example STEPcode as a parser, but it's not likely that these more ambitious projects will take off any time soon.

Also, BIMserver claims that their IFC is "valid" IFC which I thought they have implemented rule-checking in their database transactions.

Strictly enforcing all rules might result in a lot of files not being possible to store. In general most parsers and interpreters (commercial and open source) are quite permissive to account for some of the lower quality exporters out there.

JSDAI project on github seems to be dead :(

I don't think JSDAI has seen any major updates after 2014 (the SDAI standard 10303-22 has not been updated since 1998), but in my experience it is well engineered. Just get it from their official site.

I am keen on merging functionalities from stepcode into IFCOS. Where do you think is a good place to start?

Good question. Depends a lot on what kind of functionality in IfcOpenShell you want to retain. There are things like IfcAbstractEntity but I highly doubt there are thick enough layers of abstraction that you can just provide a drop-in implementation for that class using stepcode and expect things to magically work. The IfcGeom module would be fairly easy if there is a class hierarchy that matches the IFC schema. But differences in the way select- and type declarations are implemented is likely still going to require some significant changes to the code base. Since stepcode comes with a python code generator, maybe the Python wrapper is not the biggest concern?

I would welcome the architectural changes to make this happen. A rigorous refactoring to decouple things is planned anyway for the next 0.6 release.

A more pragmatic solution might be to cherry pick functionality your after but keep the code bases separate. What is it you would like to accomplish?

At this very moment, IFCOS is covering all my needs. Soon I am going to start my PhD and I would like to dedicate some time for open source projects. After so many years, we still do not have a vibrant IFC community. One reason is the high barrier for entry. IFCOS is the most promising project out there which helps in getting more people on board. I wish the installation process was easier like conda install ifcopenshell! It took me some time to setup up the build tools and properly configure the environment variable and some hours to download and install all the dependencies and the rest. Python programmers are too spoiled :D I am sure you guys have already thought about these issues and perhaps that's as easy as it gets.

Soon I am going to start my PhD

Great! Best of luck with that.

I would like to dedicate some time for open source projects

Wonderful

conda install ifcopenshell

This would indeed be very beneficial. There are people some very vocal advocates of conda around here too. One problem though is that IfcOpenShell currently has a rather lengthy release cycle, so finding moments when to push to conda is something that needs figuring out. Parts of the ecosystem are already there [1] [2].

[1] https://anaconda.org/dlr-sc/repo?type=conda&label=main
[2] https://github.com/DLR-SC/tigl-conda

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AlexanderNitsch picture AlexanderNitsch  路  4Comments

tpaviot picture tpaviot  路  12Comments

Moult picture Moult  路  11Comments

lorenzooliva picture lorenzooliva  路  6Comments

Moult picture Moult  路  5Comments