ifcjson文件是基于JSON格式,用于存储BIM(Building Information Modeling)数据的开放式格式。它是IFC(Industry Foundation Classes)文件的一种转换格式,IFC是一种基于对象的文件格式,用于表示建筑、工程和建设产品中的各种构件以及它们之间的关系。
ifcjson文件的结构类似于IFC文件。它由实体(entity)和关系(relationship)组成,每个实体由一个对象标识符(object identifier)和它的属性(properties)组成,关系则定义了实体之间的连接。
在ifcjson文件中,每一行表示一个实体或者一种关系。对象标识符和属性则被封装在一个JSON对象中,它们以属性名和对应的值组成键值对的形式进行存储。例如,下面是一个ifcjson文件的示例:
{
"entities":
[
{
"type": "IfcWall",
"object_id": 123456,
"properties":
{
"Name": "Main Wall",
"Description": "This is a main wall"
}
},
{
"type": "IfcDoor",
"object_id": 789012,
"properties":
{
"Name": "Main Door",
"Description": "This is a main door"
}
}
],
"relationships":
[
{
"type": "IfcRelVoidsElement",
"relating_object_id": 123456,
"related_object_id": 789012
}
]
}
该示例中包含了两个实体,一个IfcWall和一个 IfcDoor,它们之间的关系为IfcRelVoidsElement。
ifcjson文件的结构和内容遵循了IFC的开放式规范(Open IFC Standards)。这个规范包括一系列的文档,其中包含了IFC文件的基础知识、IFC文件的数据模型以及IFC文件格式的详细说明。有关更多的信息,请访问以下链接:
下面是一个更详细的ifcjson文件示例,它包含了一个建筑物的数据信息:
{
"entities":
[
{
"type": "IfcBuilding",
"object_id": 0,
"properties":
{
"Name": "Building 1",
"Description": "This is a building"
}
},
{
"type": "IfcBuildingStorey",
"object_id": 1,
"properties":
{
"Name": "Floor 1",
"Description": "This is the first floor"
}
},
{
"type": "IfcWall",
"object_id": 2,
"properties":
{
"Name": "Exterior Wall",
"Description": "This is a exterior wall"
}
},
{
"type": "IfcWall",
"object_id": 3,
"properties":
{
"Name": "Interior Wall",
"Description": "This is a interior wall"
}
},
{
"type": "IfcDoor",
"object_id": 4,
"properties":
{
"Name": "Main Door",
"Description": "This is a main door"
}
}
],
"relationships":
[
{
"type": "IfcRelAggregates",
"relating_object_id": 0,
"related_object_id": 1
},
{
"type": "IfcRelContainedInSpatialStructure",
"relating_object_id": 1,
"related_object_id": 2
},
{
"type": "IfcRelContainedInSpatialStructure",
"relating_object_id": 1,
"related_object_id": 3
},
{
"type": "IfcRelFillsElement",
"relating_object_id": 2,
"related_object_id": 3
},
{
"type": "IfcRelFillsElement",
"relating_object_id": 2,
"related_object_id": 4
}
]
}
该示例中包含了一个IfcBuilding和一个IfcBuildingStorey实体,以及两个IfcWall实体和一个IfcDoor实体,它们之间的关系定义了建筑物的空间结构和组成关系。