当前位置:网站首页>Industrial basic IFC - extract model structure tree
Industrial basic IFC - extract model structure tree
2022-07-26 21:26:00 【Hard core youth】

First , I'm sorry , I haven't updated the article for a long time , It's too late to explain , Let's get straight to the point . This article is still connected with the previous excavation IFC series , Ahead Several articles We talked IFC Some of the concepts of 、 Data structures and visualization tools , With these mattresses , We can basically talk about some practical content , For example, how to use open source toolkit to read and write IFC data , This includes model structure tree data 、 Geometric data and attribute data .
So the theme of this article is to extract IFC Information of model structure tree , And based on IFC 4 edition , But yes IFC 2x3 Most of them are general . First, combine the picture pairs below IFC Make a description of the model structure tree : In disassembly IFC There are two related entities involved in the process of structure tree ,IfcRelAggregates and IfcRelContainedInSpatialStructure, The former expresses spatial decomposition , For example, a building can be divided into multiple floors , Another example is that piers can be divided into bent caps 、 Columns 、 Bearing platform and pile foundation ; The latter expresses the elements in space , For example, there is a structural wall on the first floor 、 column 、 door 、 Windows, etc . In other words , We can divide elements into non spatial elements and non spatial elements , If you want to get the non spatial elements in the spatial elements, use IfcRelContainedInSpatialStructure, The rest is used IfcRelAggregates .

The Open Source Toolkit we use here is xBIM, It is oriented towards .NET Platform IFC tookit, The main development language is C#, Of course, the geometry library part is still based on C++ Mainly . If readers are used to using Python, It is also recommended that you use IfcOpenShell This library , The basic logic is almost the same .
IfcRelContainedInSpatialStructure
To get non spatial elements in spatial elements , First, we need to determine whether the current element is a spatial element IfcSpatialStructureElement, Then use the corresponding attribute of this class ContainsElements To get the element set .

var spaceEle = elem as IIfcSpatialStructureElement;
if (spaceEle != null)
{
//using IfcRelContainedInSpatialElement to get contained elements
var containedElements = spaceEle.ContainsElements.SelectMany(rel => rel.RelatedElements).ToList();
for (int i = 0; i < containedElements.Count(); i++)
{
// do what you want
// Use recursion to complete the traversal of the structure tree
}
}
IfcRelAggregates
Subset elements of spatial decomposition can be represented by inverse attributes IsDecomposedBy obtain .

foreach ( var item in elem.IsDecomposedBy.SelectMany ( r => r.RelatedObjects ) )
{
// do what you want
// Use recursion to complete the traversal of the structure tree
}Spatial element decomposition
IFC Have a semantic spatial structure tree , In a single file, a “ project IfcProject”, The project contains one or more “ site IfcSite”, The site also contains one or more “ Architecture IfcBuilding”, From building to floor , From floor to wall 、 plate 、 column . Of course, this is just a simple example , With IFC The gradual improvement and enrichment of Standards , Grading methods are also more and more diverse , For example, there can be routes in the site IfcAlignment, There are bridges IfcBridge wait .

Decomposition of non spatial elements
Composite elements IfcElementAssembly It is also a means of expression at the structural level , It can be further decomposed , For example, we take a standard segment of the bridge girder as a composite object , And it can be decomposed into roof 、 floor 、 Web 、 Stiffeners and other components .

Summary
In the actual coding process , We need to combine the above two structural divisions , And use recursive logic to traverse the complete structure tree .Ok, So much for that , Next up :《 Industrial foundation — utilize xBIM extract IFC Geometric and attribute data 》. The following is what I created IFC Communication group , Those who are interested can scan the code to join !
边栏推荐
- Apaas low code platform (I) | leave complexity to yourself and simplicity to users
- 功能尝鲜 | 解密 Doris 复杂数据类型 ARRAY
- Ros2 node communication realizes zero copy
- Summary of common interview questions of operating system, including answers
- 除了「加机器」,其实你的微服务还能这样优化
- CFdiv1+2-Pathwalks-(树状数组+线性dp)
- CONDA reports an error: json.decoder.jsondecodeerror:
- 【虚拟机数据恢复】意外断电导致XenServer虚拟机不可用的数据恢复
- Is it safe for Huishang futures to open an account? What should Huishang futures pay attention to when opening an account?
- 滤波及失真
猜你喜欢
Monitor MySQL based on MySQL exporter

idea中设置核心配置文件的模板

立即报名:7 月 29 日推荐系统峰会 2022

We were tossed all night by a Kong performance bug

After chatting with byte programmers with a monthly salary of 3W, I realized that I had been doing chores

ECCV 2022 | 同时完成四项跟踪任务!Unicorn: 迈向目标跟踪的大统一

Rare discounts on Apple's official website, with a discount of 600 yuan for all iphone13 series; Chess robot injured the fingers of chess playing children; Domestic go language lovers launch a new pro
![[ffmpeg] add timestamp summary to video files](/img/ae/f3f24d16f5d30c276762163867546d.png)
[ffmpeg] add timestamp summary to video files

留存收益率计算公式

【虚拟机数据恢复】意外断电导致XenServer虚拟机不可用的数据恢复
随机推荐
Custom annotation (I)
JDBC connection
Why does it system need observability?
Sprinboot interview questions
除了「加机器」,其实你的微服务还能这样优化
DevSecOps,让速度和安全兼顾
How to block the legendary GEE engine version? Close player account tutorial through script + engine
How to configure the legendary SF lander to automatically read the list without a network
自定义注解(一)
What kind of security problems will the server encounter?
LiveDatade的基本使用
Detailed illustration of B-tree and its implementation in C language
Ros2 method of obtaining current system time
Is it safe for Huishang futures to open an account? What should Huishang futures pay attention to when opening an account?
记一次invalid bound statement xxxxxx 问题解决思路
Why didn't Tencent create a game like "original God"
Redis interview questions
有关无线通信的相关内容
Serial port communication failure
Computer professional interview topic summary, general navigation