当前位置:网站首页>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 !
边栏推荐
- 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
- Set the template of core configuration file in idea
- Calculation formula of retained earnings rate
- Summary of common interview questions of computer composition principle, including answers
- HTTP cache browser cache that rabbits can understand
- Number() VS parseInt()
- Web3.0 时代,基于P2PDB实现一款Dapp的技术理论
- 微服务化解决文库下载业务问题实践
- 【MySQL系列】-索引知多少
猜你喜欢
![[ffmpeg] add timestamp summary to video files](/img/ae/f3f24d16f5d30c276762163867546d.png)
[ffmpeg] add timestamp summary to video files

idea中debug时如何进入指定的用户方法体中?

Mobile phone \ landline call forwarding setting method

DevSecOps,让速度和安全兼顾

1-《PyTorch深度学习实践》-线性模型

除了「加机器」,其实你的微服务还能这样优化

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

记一次invalid bound statement xxxxxx 问题解决思路

The hardest lesson we learned from the crypto Market

【HCIA安全】NAT网络地址转换
随机推荐
平滑滚动到元素
encodeURI VS encodeURIComponent
Some unexpected bug records
【HCIE安全】双机热备-主备备份
Computer professional interview topic summary, general navigation
MySQL -count: the difference between count (1), count (*), and count (column name)
Live broadcast appointment award | senior consultant xuyanfei: how does efficiency measurement help efficient and sophisticated outsourcing management
【虚拟机数据恢复】意外断电导致XenServer虚拟机不可用的数据恢复
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
Line detection based on Hough transform (matlab)
Multivariable time series prediction using LSTM -- problem summary
Monitor MySQL based on MySQL exporter
拖放表格行
播报语音 h5 SpeechSynthesisUtterance
Today, the company came across an Alibaba P8, which was really seen as the ceiling of the foundation
ROS2获取当前系统时间的方法
【HarmonyOS议题资料下载】HDD杭州站·线下沙龙专注应用创新 展现鸿蒙生态魅力
CFdiv1+2-Pathwalks-(树状数组+线性dp)
Test cases should never be used casually, recording the thinking caused by the exception of a test case
Flutter Performance Optimization Practice - UI chapter