├── xBIM.ico ├── Resources ├── IfcOpenShell.url ├── OneWall.gltfb ├── TwoColumsOneBeam.gltfb ├── Releases · KhronosGroup-COLLADA2GLTF.url ├── Importing IFC Models · xeolabs-xeogl Wiki.url ├── TwoWallsTwoColour.gltfb ├── OneWall.txt ├── OneWall.gltf ├── OneWall.ifc ├── TwoWallsTwoColour.gltf ├── TwoWallsTwoColour.txt ├── TwoWallsTwoColour.ifc └── TwoColumsOneBeam.ifc ├── Xbim.GLTF.IO ├── SemanticExport │ ├── BuildingSystem.cs │ ├── ElementPropertySet.cs │ ├── IfcInfo.cs │ ├── BuildingStorey.cs │ ├── BuildingElement.cs │ ├── JsonIfcObject.cs │ ├── BuildingModel.cs │ └── BuildingModelExtractor.cs ├── app.config ├── Properties │ └── AssemblyInfo.cs ├── Xbim.GLTF.IO.csproj ├── ExportHelpers │ └── MultipleFilesExporter.cs └── XbimMesher.cs ├── MainTests ├── Properties │ └── AssemblyInfo.cs ├── SemanticTests.cs ├── MainTests.csproj └── ConversionTests.cs ├── XbimPlugin.Gltf.IO ├── Properties │ ├── Settings.settings │ ├── launchSettings.json │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── App.xaml ├── App.xaml.cs ├── XbimPlugin.Gltf.IO.csproj ├── MainWindow.xaml ├── XplorerGltfExporter │ ├── XplorerGltfExporter.xaml │ └── XplorerGltfExporter.xaml.cs └── MainWindow.xaml.cs ├── nuget.config ├── glTF-CSharp-LoaderLICENSE.md ├── XbimPlugin.Gltf.nuspec ├── XbimGLTF.sln ├── .gitattributes ├── .gitignore ├── azure-pipelines.yml ├── README.md └── license.md /xBIM.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xBimTeam/XbimGltf/HEAD/xBIM.ico -------------------------------------------------------------------------------- /Resources/IfcOpenShell.url: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=http://ifcopenshell.org/ifcconvert.html 3 | -------------------------------------------------------------------------------- /Resources/OneWall.gltfb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xBimTeam/XbimGltf/HEAD/Resources/OneWall.gltfb -------------------------------------------------------------------------------- /Resources/TwoColumsOneBeam.gltfb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xBimTeam/XbimGltf/HEAD/Resources/TwoColumsOneBeam.gltfb -------------------------------------------------------------------------------- /Resources/Releases · KhronosGroup-COLLADA2GLTF.url: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=https://github.com/KhronosGroup/COLLADA2GLTF/releases 3 | -------------------------------------------------------------------------------- /Resources/Importing IFC Models · xeolabs-xeogl Wiki.url: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=https://github.com/xeolabs/xeogl/wiki/Importing-IFC-Models 3 | -------------------------------------------------------------------------------- /Xbim.GLTF.IO/SemanticExport/BuildingSystem.cs: -------------------------------------------------------------------------------- 1 | namespace Xbim.GLTF.SemanticExport 2 | { 3 | public class BuildingSystem : JsonIfcObject 4 | { 5 | 6 | } 7 | } -------------------------------------------------------------------------------- /MainTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | [assembly: ComVisible(false)] 6 | 7 | [assembly: Guid("2309990b-2bd5-4910-9252-2e909bf7abdd")] 8 | -------------------------------------------------------------------------------- /XbimPlugin.Gltf.IO/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /XbimPlugin.Gltf.IO/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "XbimPlugin.Gltf.IO": { 4 | "commandName": "Executable", 5 | "executablePath": "C:\\Data\\Dev\\Xbim50\\XbimWindowsUI\\Output\\Debug\\net472\\XbimXplorer.exe", 6 | "commandLineArgs": "/noplugins /plugin \"C:\\Data\\Dev\\Xbim50\\XbimGltf\\XbimPlugin.Gltf.IO\\bin\\Debug\\net472\\XbimPlugin.Gltf.IO.exe\"" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /nuget.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Xbim.GLTF.IO/SemanticExport/ElementPropertySet.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Xbim.GLTF.SemanticExport 8 | { 9 | public class ElementPropertySet 10 | { 11 | public string propertySetName; 12 | public List properties = new List(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /XbimPlugin.Gltf.IO/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /XbimPlugin.Gltf.IO/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace Xbim.XbimGLTF.IO 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Xbim.GLTF.IO/SemanticExport/IfcInfo.cs: -------------------------------------------------------------------------------- 1 | namespace Xbim.GLTF.SemanticExport 2 | { 3 | public class IfcInfo 4 | { 5 | public string Name; 6 | public string Value; 7 | 8 | // e.g. 9 | // "objectType":, 10 | // "entityName:" , 11 | // "entityDescription:" , 12 | 13 | public IfcInfo(string name, string value) 14 | { 15 | Name = name; 16 | Value = value; 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Xbim.GLTF.IO/SemanticExport/BuildingStorey.cs: -------------------------------------------------------------------------------- 1 | namespace Xbim.GLTF.SemanticExport 2 | { 3 | public class BuildingStorey : JsonIfcObject 4 | { 5 | /// 6 | /// Elevation of the base of this storey, relative to the 0,00 internal reference height of the building. The 0.00 level is given by the absolute above sea level height by the ElevationOfRefHeight attribute given at IfcBuilding. 7 | /// 8 | public double Elevation; 9 | 10 | 11 | public BuildingStorey(double storeyElevation) 12 | { 13 | Elevation = storeyElevation; 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Xbim.GLTF.IO/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Xbim.GLTF.IO/SemanticExport/BuildingElement.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Xbim.Common.Geometry; 4 | using Xbim.Ifc4.Interfaces; 5 | 6 | namespace Xbim.GLTF.SemanticExport 7 | { 8 | public class BuildingElement : JsonIfcObject 9 | { 10 | /// 11 | /// index in systems array 12 | /// 13 | public int ifcSystemIndex = -1; // point 2 14 | 15 | /// 16 | /// index in storey array 17 | /// 18 | public int ifcStoreyIndex = -1; // ": index in the storeys array // for point 3 19 | 20 | /// 21 | /// index in space array 22 | /// 23 | public int ifcSpaceIndex = -1; // ": index in the spaces array // for point 4 24 | 25 | public List propertySets = new List(); 26 | } 27 | } -------------------------------------------------------------------------------- /MainTests/SemanticTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using Microsoft.VisualStudio.TestTools.UnitTesting; 4 | using Xbim.GLTF.SemanticExport; 5 | 6 | namespace MainTests 7 | { 8 | [TestClass] 9 | public class SemanticTests 10 | { 11 | [TestMethod] 12 | public void SemanticExportTest() 13 | { 14 | // create file 15 | // 16 | BuildingModel m = new BuildingModel(); 17 | m.storeys.Add(new BuildingStorey(10.3)); 18 | var fi = m.Export("file.json"); 19 | 20 | // attempt reload 21 | // 22 | using (var readStream = fi.OpenRead()) 23 | { 24 | var b = BuildingModel.DeserializeFromStream(readStream); 25 | var readElev = b.storeys.FirstOrDefault()?.Elevation; 26 | Assert.AreEqual(10.3, readElev); 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /XbimPlugin.Gltf.IO/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace XbimPlugin.Gltf.IO.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /glTF-CSharp-LoaderLICENSE.md: -------------------------------------------------------------------------------- 1 | This license is for the C# reference loader, not the rest of the repository. 2 | 3 | Copyright (c) 2015, Matthew and Xueru McMullan All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | 7 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | 9 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /Xbim.GLTF.IO/SemanticExport/JsonIfcObject.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Xbim.Ifc4.Interfaces; 3 | 4 | namespace Xbim.GLTF.SemanticExport 5 | { 6 | public class JsonIfcObject 7 | { 8 | /// 9 | /// This should serve point 1 of the specs 10 | /// 11 | public string ifcExpressTypeName = "undefined"; 12 | 13 | /// 14 | /// Applications are responsible to keep GUIDs constan across Ifc export, but this is not always the case 15 | /// 16 | public string ifcGuid = ""; 17 | 18 | /// 19 | /// integer, acts like a PK on the IFC model 20 | /// 21 | public int ifcEntityLabel; 22 | 23 | /// 24 | /// human readable data 25 | /// 26 | public List ifcInfo = new List(); 27 | 28 | virtual internal void SetBase(IIfcObject element) 29 | { 30 | this.ifcEntityLabel = element.EntityLabel; 31 | this.ifcGuid = element.GlobalId; 32 | this.ifcExpressTypeName = element.GetType().Name; 33 | 34 | if (element.Name != null) 35 | ifcInfo.Add(new IfcInfo("name", element.Name)); 36 | if (element.Description != null) 37 | ifcInfo.Add(new IfcInfo("description", element.Description.Value)); 38 | if (element.ObjectType != null) 39 | ifcInfo.Add(new IfcInfo("ObjectType", element.ObjectType.Value)); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /Xbim.GLTF.IO/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | 11 | // Setting ComVisible to false makes the types in this assembly not visible 12 | // to COM components. If you need to access a type in this assembly from 13 | // COM, set the ComVisible attribute to true on that type. 14 | [assembly: ComVisible(false)] 15 | 16 | //In order to begin building localizable applications, set 17 | //CultureYouAreCodingWith in your .csproj file 18 | //inside a . For example, if you are using US english 19 | //in your source files, set the to en-US. Then uncomment 20 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 21 | //the line below to match the UICulture setting in the project file. 22 | 23 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 24 | 25 | 26 | [assembly: ThemeInfo( 27 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 28 | //(used if a resource is not found in the page, 29 | // or application resource dictionaries) 30 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 31 | //(used if a resource is not found in the page, 32 | // app, or any theme specific resource dictionaries) 33 | )] 34 | -------------------------------------------------------------------------------- /XbimPlugin.Gltf.IO/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | 11 | // Setting ComVisible to false makes the types in this assembly not visible 12 | // to COM components. If you need to access a type in this assembly from 13 | // COM, set the ComVisible attribute to true on that type. 14 | [assembly: ComVisible(false)] 15 | 16 | //In order to begin building localizable applications, set 17 | //CultureYouAreCodingWith in your .csproj file 18 | //inside a . For example, if you are using US english 19 | //in your source files, set the to en-US. Then uncomment 20 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 21 | //the line below to match the UICulture setting in the project file. 22 | 23 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 24 | 25 | 26 | [assembly: ThemeInfo( 27 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 28 | //(used if a resource is not found in the page, 29 | // or application resource dictionaries) 30 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 31 | //(used if a resource is not found in the page, 32 | // app, or any theme specific resource dictionaries) 33 | )] 34 | -------------------------------------------------------------------------------- /XbimPlugin.Gltf.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | XbimPlugin.Gltf.Exporter 5 | 5.1.100-develop 6 | XbimPlugin.Gltf.Exporter 7 | Claudio Benghi 8 | xBIM team 9 | CDDL-1.0 10 | https://github.com/xBimTeam/ 11 | icon.ico 12 | true 13 | Integration with Xplorer UI for GLTF model export. 14 | . 15 | en-GB 16 | 17 | gltf, XplorerPlugin 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /MainTests/MainTests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | {2309990B-2BD5-4910-9252-2E909BF7ABDD} 4 | net472 5 | {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 6 | 15.0 7 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 8 | $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages 9 | False 10 | UnitTest 11 | MainTests 12 | MainTests 13 | Copyright © 2018 14 | bin\$(Configuration)\ 15 | 16 | 17 | full 18 | 19 | 20 | pdbonly 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | PreserveNewest 36 | 37 | 38 | -------------------------------------------------------------------------------- /Xbim.GLTF.IO/Xbim.GLTF.IO.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | {11755BB4-23CF-4A71-9443-EB1E752CB53D} 4 | Library 5 | Xbim.Gltf.IO 6 | 5.1.100 7 | net472 8 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 9 | true 10 | bin\$(Configuration)\ 11 | true 12 | true 13 | 14 | 15 | Xbim.GLTF.IO 16 | CDDL-1.0 17 | 18 | 19 | full 20 | DEBUG;TRACE 21 | 22 | 23 | pdbonly 24 | 25 | 26 | 27 | 28 | 29 | 30 | <_SettingsFiles Remove="Data\**" /> 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /XbimPlugin.Gltf.IO/XbimPlugin.Gltf.IO.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | {7DAFBD23-8E73-4359-9EC6-52B191344323} 4 | WinExe 5 | XbimPlugin.Gltf.IO 6 | 5.1.100 7 | net472 8 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 9 | true 10 | bin\$(Configuration)\ 11 | true 12 | true 13 | 14 | 15 | CDDL-1.0 16 | 17 | 18 | full 19 | DEBUG;TRACE 20 | 21 | 22 | pdbonly 23 | 24 | 25 | 26 | 27 | 28 | 29 | <_SettingsFiles Remove="Data\**" /> 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /MainTests/ConversionTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using Microsoft.VisualStudio.TestTools.UnitTesting; 9 | using Xbim.Common.Geometry; 10 | using Xbim.GLTF; 11 | using Xbim.Ifc; 12 | using Xbim.ModelGeometry.Scene; 13 | 14 | namespace MainTests 15 | { 16 | [TestClass] 17 | public class ConversionTests 18 | { 19 | [TestMethod] 20 | [DeploymentItem(@"Xbim.Geometry.Engine32.dll")] 21 | [DeploymentItem(@"Xbim.Geometry.Engine64.dll")] 22 | [DeploymentItem(@"Files\OneWallTwoWindows.ifc")] 23 | public void CanConvertOneFile() 24 | { 25 | var ifc = new FileInfo("OneWallTwoWindows.ifc"); 26 | var xbim = CreateGeometry(ifc, true, false); 27 | 28 | using (var s = IfcStore.Open(xbim.FullName)) 29 | { 30 | Stopwatch sw = new Stopwatch(); 31 | sw.Start(); 32 | 33 | var savename = Path.ChangeExtension(s.FileName, ".gltf"); 34 | var bldr = new Builder(); 35 | var ret = bldr.BuildInstancedScene(s, XbimMatrix3D.Identity); 36 | glTFLoader.Interface.SaveModel(ret, savename); 37 | 38 | Debug.WriteLine($"Gltf Model exported to '{savename}' in {sw.ElapsedMilliseconds} ms."); 39 | FileInfo f = new FileInfo(s.FileName); 40 | 41 | // write json 42 | // 43 | var jsonFileName = Path.ChangeExtension(s.FileName, "json"); 44 | var bme = new Xbim.GLTF.SemanticExport.BuildingModelExtractor(); 45 | var rep = bme.GetModel(s); 46 | rep.Export(jsonFileName); 47 | } 48 | } 49 | 50 | private static FileInfo CreateGeometry(FileInfo f, bool mode, bool useAlternativeExtruder) 51 | { 52 | IfcStore.ModelProviderFactory.UseHeuristicModelProvider(); 53 | using (var m = IfcStore.Open(f.FullName)) 54 | { 55 | var c = new Xbim3DModelContext(m); 56 | c.CreateContext(null, mode); 57 | var newName = Path.ChangeExtension(f.FullName, mode + ".xbim"); 58 | m.SaveAs(newName); 59 | return new FileInfo(newName); 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /XbimPlugin.Gltf.IO/MainWindow.xaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 40 | 41 | 42 | 43 | 44 | The whole model is exported to multiple files in the same folder of the currently open model. 45 | 46 | 47 | storey (each file will contain only elements related to a semantically defined IfcStorey) 48 | Other options are under development 49 | 50 | 51 | Export semantic json files next to gltf. 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | This exporter makes use of the glTF C# reference library at https://github.com/KhronosGroup/glTF-CSharp-Loader 88 | 89 | In compliance with their license requiremnt, please find the following statement: 90 | 91 | 92 | 93 | This license is for the C# reference loader, not the rest of the repository. 94 | 95 | Copyright (c) 2015, Matthew and Xueru McMullan All rights reserved. 96 | 97 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 98 | 99 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 100 | 101 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 102 | 103 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 104 | 105 | 106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # XbimGltf - Workflows and tools for the distributed representation of building asset via open standards 2 | 3 | _Claudio Benghi, Northumbria university at Newcastle, UK_ 4 | 5 | 26th September, 2020 6 | 7 | __Abstract__ 8 | 9 | When working with _Building Information Models_ across diverse platforms there can be an advantage in 10 | the storage of the model geometry in a format that is well supported across a variety of 3D viewers. 11 | 12 | The glTF format has been identified as a candidate for such portable format, however it lacks the ability to retain 13 | meaningful semantic properties of the geometries exported that are necessary for most business workflows in the 14 | built environment; consequently a second format is developed to enable such workflows. 15 | 16 | The presented solution supports production workflows under these scenarios; it allows the conversion of building geometries from the IFC format to glTF assets, establishes methods for identity management of such elements, and provide an extendable approach for the reconciliation of any semantic property lost in the conversion process. 17 | 18 | __[pre-print working copy]__ 19 | 20 | ## Methodology 21 | 22 | The development of this library has followed a fast-tracked version of the _Design Science Methodology_ described by Wieringa [1](#f1), which promotes the equilibrium between technical and theoretical concerns 23 | that affect research and development projects in the Information Technology (IT) domain. 24 | 25 | In accordance, the project was executed along the following stages: 26 | 1. identification of the problem and motivation, 27 | 2. definition of the objectives of the solution, 28 | 3. execution of the design and development cycle, and finally a 29 | 4. demonstration and evaluation stage. 30 | 31 | ## 1. Identification of the problem 32 | 33 | The IFC4x1 format defines 126 different concrete classes that inherit from ```IfcRepresentationItem``` for the purpose of model representation, some of which (for example _IfcSurfaceCurveSweptAreaSolid_, _IfcRevolvedAreaSolidTapered_, _IfcBooleanClippingResult_, and many more) can only be converted for 3D rendering using computationally complex and time consuming algorithms. 34 | 35 | This makes the IFC format unsuitable for the transmission of geometries for visualization purposes, particularly for devices with limited computational power and storage capacity, which can not be discounted in mobile and web deployment scenarios. 36 | 37 | Consequently, it is common practice to convert the geometric content of IFC models into simpler schemas that, albeit dropping the powerful descriptive power of IFC, require minimal or null data transformation ahead of the 3D representation process, lowering the bar for the adoption of a variety of 3D visualization components. 38 | This conversion process is generally performed once in the controlled environment of a custom server where performance and resources can be balanced to guarantee reasonable user experiences, with the _simplified geometry_ being retained on the servers, next to the original IFC source, to prevent information loss. 39 | 40 | While transfer of the _simplified geometry_ would be sufficient for the mere visualization of the model to any network client, it would lack any semantic property that is needed for most _use cases_[2](#f2) in the management of building assets. 41 | While this limitation would be conceptually surpassed with the transfer of the associated _IFC source_, this has clear drawbacks. First and foremost, it would obviously result in duplicate data transfer; second, it would still require relatively complex algorithms on the client, given the complexity of the IFC format. 42 | 43 | ## 2. Aim and Objectives 44 | 45 | The analysis of the problems, resulted in the formalisation of the following research aim: "Develop and test a sustainable workflow for the distributed representation and management of built assets across a platform-agnostic information technology stack." 46 | 47 | ### 2.1 Objectives 48 | 49 | The proposed aim was later specialised with the definition of the following Objectives: 50 | 51 | 1. __O1__ the identification of a _geometry transfer format_ (GTF) that enabled deployment across a wide range of client environments, 52 | 2. __O2__ a strategy for efficient transfer of non-geometric data for a range of business workflows, and 53 | 3. __O3__ a software solution supporting the implementation of the identified format and strategy. 54 | 55 | ### 2.1. Approach 56 | 57 | Furthermore, a list of guiding criteria were enumerated to support decision making in consideration of the nature of the industrial sector and the technical landscape: 58 | 59 | 1. __C1__: a preference for open standard and open source algorithms. The long lasting nature of assets in the _Built Environment_ and its stark contrast with fast obsolescence of digital solutions, determined a preference for open and accessible IT workflows as a way to mitigate the risks of technological lock-in as well as enhance the chance and reduce the cost of digital content preservation. 60 | 1. __C2__: exact content experience. When dealing with diverse software environments it is often impossible to retain the same user interface on all platform; while this is acceptable, and sometimes beneficial, it is important that the identical content remains available across them. 61 | 1. __C3__: Following current practice the research aims at a solution that can be integrated in a RESTful infrastructure that favours storage over computation on the service side. 62 | 63 | ## 3. Development cycle 64 | 65 | ### 3.1 Format selection 66 | 67 | An initial review has been performed to select a long-list of suitable 3D formats; which has led to the following candidates: COLLADA, FBX, glTF, PLY, PRC, STL, Universal 3D, VRML (X3D), and Wavefront Obj. 68 | 69 | - __Collada__: Format maintained by Chronos Group published ad ISO/PAS 17506, initial release 2004, last release 2008. XML format with public XSD schema definition and good coverage of loaders (also known as DAE). 70 | - __FBX__: Format acquired and maintained by Autodesk, which regularly publishes a C++ SDK with bindings for Python; includes motion, with 2D, 3D, audio, and video data. Most popular in the gaming domain. 71 | - __glTF__: Format maintained by Chronos Group, started in 2013 and still active. Reference implementation is available as well as ports to several languages and environments. 72 | - __PLY__: Flexible 3D format specified by Greg Turk; excluded since it does not allow the definition of multiple objects. 73 | - __PRC__: Highly compressed 3D file developed by Adobe Systems. Last updated 2008. Powerful ability to describe alternative representation levels. Allows embedding of tri-dimensional models within PDF files. 74 | - __STL__: Widely popular format for triangulated meshes; excluded since it does not allow the definition of multiple objects. 75 | - __Universal 3D__: Accepted as ECMA-363 standard in August 2005. 3D PDF documents support U3D objects embedding and can be viewed in Adobe Reader. Provides definitions for higher order primitives (curved surfaces) and custom blocks. 76 | - __VRML (X3D)__: 77 | - __Wavefront Obj__: 78 | 79 | 80 | ``` 81 | minimizes both the size of 3D assets, and the runtime processing needed to unpack and use those assets 82 | ``` 83 | 84 | ``` 85 | it is an ecosystem of tools, documentation, and extensions contributed by the community 86 | ``` 87 | 88 | 89 | ### 3.2 Model reduction 90 | 91 | ### 3.3 Flexible architecture 92 | 93 | ## Evaluation and Demonstration 94 | 95 | {>> TODO: present evaluation criteria <<} 96 | 97 | ### Xbim.GLTF.IO 98 | 99 | This library supports the export of coherent geometry and data from selected parts of an IFC file for consumption in other environments. 100 | 101 | Geometry is exported in glTF format and the relative data in json. References exist between the two export sets in order restore their associations in any consuming workflow. 102 | 103 | ### XbimPlugin.Gltf.IO 104 | 105 | This project provides a UI to consume the function of Xbim.GLTF.IO within the XbimXplorer application, via the plugin system. 106 | 107 | ## Usage 108 | 109 | For most scenarios you will want to use ```nuget``` to reference the library in your project. You can do this by issuing the following command in the ```package manager command line```: 110 | 111 | ``` 112 | Install-Package Xbim.Gltf.IO -Source https://www.myget.org/F/xbim-master/api/v3/index.json 113 | ``` 114 | 115 | ## Library authors 116 | 117 | * **Claudio Benghi** - *Initial work* - [Personal page](https://github.com/CBenghi) 118 | 119 | See also the list of [contributors](https://github.com/xBimTeam/XbimGltf/graphs/contributors) who participated in this project. 120 | 121 | ## License 122 | 123 | The library is published under the terms of the CDDL 1.0, alternative license agreements can be arranged contacting the author. 124 | 125 | ## References 126 | 127 | [1] Wieringa, R. J., 2014. Design Science Methodology for Information Systems and Software Engineering. Springer-Verlag, Berlin Heidelberg. ISBN 978-3-662-43838-1. URL http://www.springer.com/gb/book/9783662438381 (accessed 5.17.2018). [↩](#a1) 128 | 129 | [2] Assistant Secretary for Public Affairs, 2013. Use Cases [WWW Document]. Usability.gov. URL https://www.usability.gov/how-to-and-tools/methods/use-cases.html (accessed 9.26.20).[↩](#a2) 130 | -------------------------------------------------------------------------------- /XbimPlugin.Gltf.IO/XplorerGltfExporter/XplorerGltfExporter.xaml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Logging; 2 | using System; 3 | using System.Diagnostics; 4 | using System.IO; 5 | using System.Reflection; 6 | using System.Windows; 7 | using System.Windows.Data; 8 | using Xbim.Common; 9 | using Xbim.Common.Geometry; 10 | using Xbim.GLTF; 11 | using Xbim.GLTF.ExportHelpers; 12 | using Xbim.Ifc; 13 | using Xbim.Presentation; 14 | using Xbim.Presentation.XplorerPluginSystem; 15 | 16 | namespace Xbim.Gltf 17 | { 18 | /// 19 | /// Interaction logic for XplorerPlugin.xaml 20 | /// 21 | [XplorerUiElement(PluginWindowUiContainerEnum.LayoutAnchorable, PluginWindowActivation.OnMenu, "Gltf Exporter")] 22 | public partial class XplorerGltfExporter : System.Windows.Controls.UserControl, IXbimXplorerPluginWindow 23 | { 24 | // internal static ILogger Logger { get; private set; } 25 | 26 | protected ILogger Logger { get; private set; } 27 | 28 | public XplorerGltfExporter() 29 | { 30 | InitializeComponent(); 31 | } 32 | 33 | public string WindowTitle => "Xbim.Gltf Exporter"; 34 | 35 | private IXbimXplorerPluginMasterWindow _xpWindow; 36 | 37 | 38 | // Selection 39 | public EntitySelection Selection 40 | { 41 | get { return (EntitySelection)GetValue(SelectionProperty); } 42 | set { SetValue(SelectionProperty, value); } 43 | } 44 | 45 | public static DependencyProperty SelectionProperty = 46 | DependencyProperty.Register( 47 | "Selection", 48 | typeof(EntitySelection), 49 | typeof(XplorerGltfExporter), 50 | new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits, OnPropertyChanged) 51 | ); 52 | 53 | // SelectedEntity 54 | public IPersistEntity SelectedEntity 55 | { 56 | get { return (IPersistEntity)GetValue(SelectedItemProperty); } 57 | set { SetValue(SelectedItemProperty, value); } 58 | } 59 | 60 | public static DependencyProperty SelectedItemProperty = 61 | DependencyProperty.Register( 62 | "SelectedEntity", 63 | typeof(IPersistEntity), 64 | typeof(XplorerGltfExporter), 65 | new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits, OnPropertyChanged) 66 | ); 67 | 68 | // Model 69 | public IModel Model 70 | { 71 | get { return (IModel)GetValue(ModelProperty); } 72 | set { SetValue(ModelProperty, value); } 73 | } 74 | 75 | public static DependencyProperty ModelProperty = 76 | DependencyProperty.Register( 77 | "Model", 78 | typeof(IModel), 79 | typeof(XplorerGltfExporter), 80 | new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits, OnPropertyChanged) 81 | ); 82 | 83 | private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) 84 | { 85 | Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); 86 | e.Handled = true; 87 | } 88 | 89 | public void BindUi(IXbimXplorerPluginMasterWindow mainWindow) 90 | { 91 | _xpWindow = mainWindow; 92 | SetBinding(SelectedItemProperty, new Binding("SelectedItem") { Source = mainWindow, Mode = BindingMode.TwoWay }); 93 | SetBinding(SelectionProperty, new Binding("Selection") { Source = mainWindow.DrawingControl, Mode = BindingMode.TwoWay }); 94 | SetBinding(ModelProperty, new Binding()); // whole datacontext binding, see http://stackoverflow.com/questions/8343928/how-can-i-create-a-binding-in-code-behind-that-doesnt-specify-a-path 95 | 96 | // versioning information 97 | // 98 | var assembly = Assembly.GetAssembly(typeof(Xbim.GLTF.Builder)); 99 | PluginVersion.Text = $"Assembly Version: {assembly.GetName().Version}"; 100 | if (_xpWindow == null) 101 | return; 102 | var location = _xpWindow.GetAssemblyLocation(assembly); 103 | var fvi = FileVersionInfo.GetVersionInfo(location); 104 | PluginVersion.Text += $"\r\nFile Version: {fvi.FileVersion}"; 105 | 106 | Logger = _xpWindow.GetLoggerFactory().CreateLogger(); 107 | } 108 | 109 | 110 | private static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 111 | { 112 | // if any UI event should happen it needs to be specified here 113 | var window = d as XplorerGltfExporter; 114 | if (window == null) 115 | return; 116 | 117 | switch (e.Property.Name) 118 | { 119 | case "Selection": 120 | Debug.WriteLine(e.Property.Name + @" changed"); 121 | break; 122 | case "Model": 123 | Debug.WriteLine(e.Property.Name + @" changed"); 124 | break; 125 | case "SelectedEntity": 126 | Debug.WriteLine(e.Property.Name + @" changed"); 127 | break; 128 | } 129 | } 130 | 131 | private void ExportSingle_Click(object sender, RoutedEventArgs e) 132 | { 133 | IfcStore s = Model as IfcStore; 134 | if (s == null || string.IsNullOrEmpty(s.FileName)) 135 | { 136 | MessageBox.Show("Please save the model in xbim format before exporting."); 137 | return; 138 | } 139 | 140 | var curr = this.Cursor; 141 | Cursor = System.Windows.Input.Cursors.Wait; 142 | try 143 | { 144 | Stopwatch sw = new Stopwatch(); 145 | sw.Start(); 146 | 147 | var savename = Path.ChangeExtension(s.FileName, ".gltf"); 148 | var bldr = new Builder(); 149 | var ret = bldr.BuildInstancedScene(Model, XbimMatrix3D.Identity); 150 | glTFLoader.Interface.SaveModel(ret, savename); 151 | 152 | // Log.Info($"Gltf Model exported to '{savename}' in {sw.ElapsedMilliseconds} ms."); 153 | FileInfo f = new FileInfo(s.FileName); 154 | 155 | // write json 156 | // 157 | var jsonFileName = Path.ChangeExtension(s.FileName, "json"); 158 | var bme = new GLTF.SemanticExport.BuildingModelExtractor(); 159 | var rep = bme.GetModel(s); 160 | rep.Export(jsonFileName); 161 | 162 | // decide if showing the model. 163 | // 164 | var answ = MessageBox.Show("File created, do you want to show it in windows explorer?", "Completed", MessageBoxButton.YesNo); 165 | if (answ == MessageBoxResult.Yes) 166 | SelectFile(savename); 167 | 168 | //System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo() 169 | //{ 170 | // FileName = f.DirectoryName, 171 | // UseShellExecute = true, 172 | // Verb = "open" 173 | //}); 174 | } 175 | catch (System.Exception err) 176 | { 177 | Logger.LogError(err, "Error exporting gltf, see inner exception for details."); 178 | } 179 | Cursor = curr; 180 | 181 | } 182 | 183 | private void ExportMultiple_Click(object sender, RoutedEventArgs e) 184 | { 185 | IfcStore s = Model as IfcStore; 186 | if (s == null || string.IsNullOrEmpty(s.FileName)) 187 | { 188 | MessageBox.Show("Please save the model in xbim format before exporting."); 189 | return; 190 | } 191 | 192 | 193 | var curr = this.Cursor; 194 | Cursor = System.Windows.Input.Cursors.Wait; 195 | try 196 | { 197 | Stopwatch sw = new Stopwatch(); 198 | sw.Start(); 199 | 200 | var exp = new MultipleFilesExporter(); 201 | IfcStore str = Model as IfcStore; 202 | if (str != null) 203 | exp.ExportByStorey(str, ExportSemantic.IsChecked.Value); 204 | 205 | var answ = MessageBox.Show("Files created, do you want to open the folder in windows explorer?", "Completed", MessageBoxButton.YesNo); 206 | if (answ == MessageBoxResult.Yes) 207 | { 208 | FileInfo f = new FileInfo(str.FileName); 209 | Process.Start(new ProcessStartInfo() 210 | { 211 | FileName = f.DirectoryName, 212 | UseShellExecute = true, 213 | Verb = "open" 214 | }); 215 | } 216 | } 217 | catch (Exception err) 218 | { 219 | Logger.LogError(err, "Error exporting gltf, see inner exception for details."); 220 | } 221 | Cursor = curr; 222 | } 223 | 224 | private void SelectFile(string fullName) 225 | { 226 | if (!File.Exists(fullName)) 227 | { 228 | return; 229 | } 230 | // combine the arguments together 231 | // it doesn't matter if there is a space after ',' 232 | string argument = "/select, \"" + fullName + "\""; 233 | Process.Start("explorer.exe", argument); 234 | } 235 | } 236 | } 237 | -------------------------------------------------------------------------------- /Xbim.GLTF.IO/SemanticExport/BuildingModelExtractor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Xbim.Common; 7 | using Xbim.Ifc4.Interfaces; 8 | using Xbim.Ifc4.MeasureResource; 9 | using Xbim.Properties; 10 | 11 | namespace Xbim.GLTF.SemanticExport 12 | { 13 | public class BuildingModelExtractor 14 | { 15 | 16 | public delegate bool MeshingFilter(int elementId, IModel model); 17 | 18 | /// 19 | /// A custom function to determine the behaviour and deflection associated with individual items in the mesher. 20 | /// Default properties can set in the Model.Modelfactors if the same deflection applies to all elements. 21 | /// 22 | public MeshingFilter CustomFilter; 23 | 24 | /// 25 | /// If true, standardised propery sets are extracted to the semantic json file. 26 | /// 27 | public bool IncludeStandardPsets { get; set; } = true; 28 | 29 | /// 30 | /// If true, NON standardised propery sets are extracted to the semantic json file. 31 | /// TODO: NOT IMPLEMENTED. 32 | /// 33 | public bool IncludeNonStandardPsets { get; set; } = false; 34 | 35 | 36 | public BuildingModel GetModel(IModel model, IIfcBuildingStorey ignored = null) 37 | { 38 | Definitions propertyDefinitions = null; 39 | // prepare standard properties dictionary 40 | if (IncludeStandardPsets) 41 | { 42 | switch (model.Header.SchemaVersion.ToLowerInvariant()) 43 | { 44 | case "ifc2x3": 45 | propertyDefinitions = new Definitions(Xbim.Properties.Version.IFC2x3); 46 | break; 47 | case "ifc4": 48 | propertyDefinitions = new Definitions(Xbim.Properties.Version.IFC4); 49 | break; 50 | default: 51 | break; 52 | } 53 | if (propertyDefinitions != null) 54 | propertyDefinitions.LoadAllDefault(); 55 | } 56 | 57 | // cache systems list 58 | // 59 | var elementToSystem = new Dictionary(); 60 | var systemRels = model.Instances.OfType().Where(x => 61 | x.RelatingGroup is IIfcSystem 62 | ); 63 | foreach (var systemRel in systemRels) 64 | { 65 | foreach (var relatedObject in systemRel.RelatedObjects) 66 | { 67 | if (elementToSystem.ContainsKey(relatedObject.EntityLabel)) 68 | continue; 69 | elementToSystem.Add(relatedObject.EntityLabel, systemRel.RelatingGroup.EntityLabel); 70 | } 71 | } 72 | 73 | // now extract 74 | BuildingModel m = new BuildingModel(); 75 | 76 | List storeys = new List(); 77 | List systems = new List(); 78 | 79 | foreach (var ifcElement in model.Instances.OfType()) 80 | { 81 | if (CustomFilter != null) 82 | { 83 | var skip = CustomFilter(ifcElement.EntityLabel, model); 84 | if (skip) 85 | continue; 86 | } 87 | 88 | BuildingElement semanticElement = new BuildingElement(); 89 | semanticElement.SetBase(ifcElement); 90 | 91 | if (propertyDefinitions != null) 92 | { 93 | var thisClass = new ApplicableClass(); 94 | thisClass.ClassName = ifcElement.ExpressType.Name; 95 | var applicable = propertyDefinitions.DefinitionSets.Where(x => x.ApplicableClasses.Any(ac => ac.ClassName == thisClass.ClassName)); 96 | 97 | var psets = ifcElement.IsDefinedBy.Where(x => x.RelatingPropertyDefinition is IIfcPropertySet).Select(pd => pd.RelatingPropertyDefinition as IIfcPropertySetDefinition).ToList(); 98 | foreach (var definition in applicable) 99 | { 100 | var matchingSet = psets.Where(x => x.Name == definition.Name).FirstOrDefault(); 101 | if (matchingSet == null) 102 | continue; 103 | var ps = new ElementPropertySet(); 104 | ps.propertySetName = matchingSet.Name; 105 | 106 | foreach (var singleProperty in definition.PropertyDefinitions) 107 | { 108 | var pFound = GetProperty(matchingSet, singleProperty); 109 | if (!string.IsNullOrWhiteSpace(pFound)) 110 | { 111 | ps.properties.Add(new IfcInfo( 112 | singleProperty.Name, 113 | pFound 114 | )); 115 | } 116 | } 117 | if (ps.properties.Any()) 118 | semanticElement.propertySets.Add(ps); 119 | } 120 | } 121 | 122 | // storeys (prepares list and sets index, data extraction happens later) 123 | semanticElement.ifcStoreyIndex = GetStoreyId(ifcElement, storeys); 124 | if (semanticElement.ifcStoreyIndex == -1) 125 | { 126 | // try through upper level of aggregation (up from the aggregates to the RelatingObject) 127 | // 128 | foreach (var relAggreg in ifcElement.Decomposes.OfType()) 129 | { 130 | int found = GetStoreyId(relAggreg.RelatingObject as IIfcElement, storeys); 131 | if (found != -1) 132 | { 133 | semanticElement.ifcStoreyIndex = found; 134 | break; 135 | } 136 | } 137 | } 138 | 139 | // systems (prepares list and sets index, data extraction happens later) 140 | if (elementToSystem.ContainsKey(ifcElement.EntityLabel)) 141 | { 142 | var systemId = elementToSystem[ifcElement.EntityLabel]; 143 | var system = model.Instances[systemId] as IIfcSystem; 144 | if (system != null) 145 | { 146 | int index = systems.IndexOf(system); 147 | if (index == -1) 148 | { 149 | index = systems.Count; 150 | systems.Add(system); 151 | } 152 | semanticElement.ifcSystemIndex = index; 153 | } 154 | } 155 | 156 | // now add element 157 | m.elements.Add(semanticElement); 158 | } 159 | 160 | // data extraction for the dicionaries happens here 161 | foreach (var storey in storeys) 162 | { 163 | var s = new BuildingStorey( 164 | ToDouble(storey.Elevation) 165 | ); 166 | s.SetBase(storey); 167 | m.storeys.Add(s); 168 | } 169 | 170 | foreach (var system in systems) 171 | { 172 | var s = new BuildingSystem(); 173 | s.SetBase(system); 174 | m.systems.Add(s); 175 | } 176 | 177 | return m; 178 | } 179 | 180 | private static int GetStoreyId(IIfcElement ifcElement, List storeys) 181 | { 182 | if (ifcElement == null) 183 | return -1; 184 | var ret = -1; 185 | foreach (var rel in ifcElement.ContainedInStructure) 186 | { 187 | if (rel.RelatingStructure is IIfcBuildingStorey storey) 188 | { 189 | int index = storeys.IndexOf(storey); 190 | if (index == -1) 191 | { 192 | index = storeys.Count; 193 | storeys.Add(storey); 194 | } 195 | ret = index; 196 | } 197 | } 198 | return ret; 199 | } 200 | 201 | private string GetProperty(IIfcPropertySetDefinition matchingSet, PropertyDef singleProperty) 202 | { 203 | var asSet = matchingSet as IIfcPropertySet; 204 | if (asSet != null) 205 | { 206 | var found = asSet.HasProperties.OfType().FirstOrDefault(x => x.Name == singleProperty.Name); 207 | if (found != null && found.NominalValue != null) 208 | return found.NominalValue.ToString(); 209 | foreach (var alias in singleProperty.NameAliases) 210 | { 211 | found = asSet.HasProperties.OfType().FirstOrDefault(x => x.Name == singleProperty.Name); 212 | if (found != null && found.NominalValue != null) 213 | return found.NominalValue.ToString(); 214 | } 215 | } 216 | return ""; 217 | } 218 | 219 | private double ToDouble(IfcLengthMeasure? totalHeight) 220 | { 221 | if (!totalHeight.HasValue) 222 | return double.NaN; 223 | return (double)totalHeight.Value.Value; 224 | 225 | } 226 | } 227 | } 228 | -------------------------------------------------------------------------------- /Resources/TwoWallsTwoColour.ifc: -------------------------------------------------------------------------------- 1 | ISO-10303-21; 2 | HEADER; 3 | 4 | /****************************************************************************************** 5 | * STEP Physical File produced by: The EXPRESS Data Manager Version 5.02.0100.07 : 28 Aug 2013 6 | * Module: EDMstepFileFactory/EDMstandAlone 7 | * Creation date: Wed Dec 03 09:38:33 2014 8 | * Host: C13300493 9 | * Database: C:\Users\mxfm2\AppData\Local\Temp\{BB3CF3E7-9E69-4F01-968B-D3817654C003}\ifc 10 | * Database version: 5507 11 | * Database creation date: Wed Dec 03 09:38:32 2014 12 | * Schema: IFC2X3 13 | * Model: DataRepository.ifc 14 | * Model creation date: Wed Dec 03 09:38:33 2014 15 | * Header model: DataRepository.ifc_HeaderModel 16 | * Header model creation date: Wed Dec 03 09:38:33 2014 17 | * EDMuser: sdai-user 18 | * EDMgroup: sdai-group 19 | * License ID and type: 5605 : Permanent license. Expiry date: 20 | * EDMstepFileFactory options: 020000 21 | ******************************************************************************************/ 22 | FILE_DESCRIPTION(('ViewDefinition [CoordinationView_V2.0]'),'2;1'); 23 | FILE_NAME('Project Number','2014-12-03T09:38:33',(''),(''),'The EXPRESS Data Manager Version 5.02.0100.07 : 28 Aug 2013','20140606_1530(x64) - Exporter 2015.0.2014.0606 - Default UI',''); 24 | FILE_SCHEMA(('IFC2X3')); 25 | ENDSEC; 26 | 27 | DATA; 28 | #1= IFCORGANIZATION($,'Autodesk Revit 2015 (ENU)',$,$,$); 29 | #5= IFCAPPLICATION(#1,'2015','Autodesk Revit 2015 (ENU)','Revit'); 30 | #6= IFCCARTESIANPOINT((0.,0.,0.)); 31 | #9= IFCCARTESIANPOINT((0.,0.)); 32 | #11= IFCDIRECTION((1.,0.,0.)); 33 | #13= IFCDIRECTION((-1.,0.,0.)); 34 | #15= IFCDIRECTION((0.,1.,0.)); 35 | #17= IFCDIRECTION((0.,-1.,0.)); 36 | #19= IFCDIRECTION((0.,0.,1.)); 37 | #21= IFCDIRECTION((0.,0.,-1.)); 38 | #23= IFCDIRECTION((1.,0.)); 39 | #25= IFCDIRECTION((-1.,0.)); 40 | #27= IFCDIRECTION((0.,1.)); 41 | #29= IFCDIRECTION((0.,-1.)); 42 | #31= IFCAXIS2PLACEMENT3D(#6,$,$); 43 | #32= IFCLOCALPLACEMENT(#321,#31); 44 | #35= IFCPERSON($,'','mxfm2',$,$,$,$,$); 45 | #37= IFCORGANIZATION($,'','',$,$); 46 | #38= IFCPERSONANDORGANIZATION(#35,#37,$); 47 | #41= IFCOWNERHISTORY(#38,#5,$,.NOCHANGE.,$,$,$,0); 48 | #42= IFCSIUNIT(*,.LENGTHUNIT.,.MILLI.,.METRE.); 49 | #43= IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.); 50 | #44= IFCSIUNIT(*,.AREAUNIT.,$,.SQUARE_METRE.); 51 | #45= IFCSIUNIT(*,.VOLUMEUNIT.,$,.CUBIC_METRE.); 52 | #46= IFCSIUNIT(*,.PLANEANGLEUNIT.,$,.RADIAN.); 53 | #47= IFCDIMENSIONALEXPONENTS(0,0,0,0,0,0,0); 54 | #48= IFCMEASUREWITHUNIT(IFCRATIOMEASURE(0.0174532925199433),#46); 55 | #49= IFCCONVERSIONBASEDUNIT(#47,.PLANEANGLEUNIT.,'DEGREE',#48); 56 | #50= IFCSIUNIT(*,.MASSUNIT.,.KILO.,.GRAM.); 57 | #51= IFCSIUNIT(*,.TIMEUNIT.,$,.SECOND.); 58 | #52= IFCSIUNIT(*,.FREQUENCYUNIT.,$,.HERTZ.); 59 | #53= IFCSIUNIT(*,.THERMODYNAMICTEMPERATUREUNIT.,$,.KELVIN.); 60 | #54= IFCSIUNIT(*,.THERMODYNAMICTEMPERATUREUNIT.,$,.DEGREE_CELSIUS.); 61 | #55= IFCDERIVEDUNITELEMENT(#50,1); 62 | #56= IFCDERIVEDUNITELEMENT(#53,-1); 63 | #57= IFCDERIVEDUNITELEMENT(#51,-3); 64 | #58= IFCDERIVEDUNIT((#55,#56,#57),.THERMALTRANSMITTANCEUNIT.,$); 65 | #60= IFCDERIVEDUNITELEMENT(#43,3); 66 | #61= IFCDERIVEDUNITELEMENT(#51,-1); 67 | #62= IFCDERIVEDUNIT((#60,#61),.VOLUMETRICFLOWRATEUNIT.,$); 68 | #64= IFCSIUNIT(*,.ELECTRICCURRENTUNIT.,$,.AMPERE.); 69 | #65= IFCSIUNIT(*,.ELECTRICVOLTAGEUNIT.,$,.VOLT.); 70 | #66= IFCSIUNIT(*,.POWERUNIT.,$,.WATT.); 71 | #67= IFCSIUNIT(*,.FORCEUNIT.,.KILO.,.NEWTON.); 72 | #68= IFCSIUNIT(*,.ILLUMINANCEUNIT.,$,.LUX.); 73 | #69= IFCSIUNIT(*,.LUMINOUSFLUXUNIT.,$,.LUMEN.); 74 | #70= IFCSIUNIT(*,.LUMINOUSINTENSITYUNIT.,$,.CANDELA.); 75 | #71= IFCDERIVEDUNITELEMENT(#50,-1); 76 | #72= IFCDERIVEDUNITELEMENT(#43,-2); 77 | #73= IFCDERIVEDUNITELEMENT(#51,3); 78 | #74= IFCDERIVEDUNITELEMENT(#69,1); 79 | #75= IFCDERIVEDUNIT((#71,#72,#73,#74),.USERDEFINED.,'Luminous Efficacy'); 80 | #77= IFCSIUNIT(*,.PRESSUREUNIT.,$,.PASCAL.); 81 | #78= IFCUNITASSIGNMENT((#42,#44,#45,#49,#50,#51,#52,#54,#58,#62,#64,#65,#66,#67,#68,#69,#70,#77)); 82 | #80= IFCAXIS2PLACEMENT3D(#6,$,$); 83 | #81= IFCDIRECTION((6.12303176911189E-17,1.)); 84 | #83= IFCGEOMETRICREPRESENTATIONCONTEXT($,'Model',3,0.01,#80,#81); 85 | #86= IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Axis','Model',*,*,*,*,#83,$,.GRAPH_VIEW.,$); 86 | #88= IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Body','Model',*,*,*,*,#83,$,.MODEL_VIEW.,$); 87 | #89= IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Box','Model',*,*,*,*,#83,$,.MODEL_VIEW.,$); 88 | #90= IFCGEOMETRICREPRESENTATIONSUBCONTEXT('FootPrint','Model',*,*,*,*,#83,$,.MODEL_VIEW.,$); 89 | #91= IFCPROJECT('3nRMINwjzC6ARvV2Naztsl',#41,'Project Number',$,$,'Project Name','Project Status',(#83),#78); 90 | #97= IFCPOSTALADDRESS($,$,$,$,('Enter address here'),$,'Westminster','London','','UK'); 91 | #101= IFCBUILDING('3nRMINwjzC6ARvV2Naztsk',#41,'',$,$,#32,$,'',.ELEMENT.,$,$,#97); 92 | #107= IFCAXIS2PLACEMENT3D(#6,$,$); 93 | #108= IFCLOCALPLACEMENT(#32,#107); 94 | #110= IFCBUILDINGSTOREY('3nRMINwjzC6ARvV2KR28De',#41,'Level 0',$,$,#108,$,'Level 0',.ELEMENT.,0.); 95 | #112= IFCCARTESIANPOINT((0.,0.,4000.)); 96 | #114= IFCAXIS2PLACEMENT3D(#112,$,$); 97 | #376= IFCRELCONNECTSPATHELEMENTS('0$pbOfjdXEBhgSqtCLkl25',#41,$,$,$,#150,#257,(),(),.ATSTART.,.ATSTART.); 98 | #334= IFCRELCONTAINEDINSPATIALSTRUCTURE('3Zu5Bv0LOHrPC10066FoQQ',#41,$,$,(#150,#257),#110); 99 | #118= IFCAXIS2PLACEMENT3D(#6,$,$); 100 | #119= IFCLOCALPLACEMENT(#108,#118); 101 | #121= IFCCARTESIANPOINT((5000.,0.)); 102 | #123= IFCPOLYLINE((#9,#121)); 103 | #125= IFCSHAPEREPRESENTATION(#86,'Axis','Curve2D',(#123)); 104 | #128= IFCCARTESIANPOINT((2500.,0.)); 105 | #130= IFCAXIS2PLACEMENT2D(#128,#25); 106 | #131= IFCRECTANGLEPROFILEDEF(.AREA.,$,#130,5000.,290.); 107 | #132= IFCAXIS2PLACEMENT3D(#6,$,$); 108 | #133= IFCEXTRUDEDAREASOLID(#131,#132,#19,8000.); 109 | #134= IFCCOLOURRGB($,0.392156862745098,1.,0.196078431372549); 110 | #135= IFCSURFACESTYLERENDERING(#134,0.,$,$,$,$,IFCNORMALISEDRATIOMEASURE(0.5),IFCSPECULAREXPONENT(128.),.NOTDEFINED.); 111 | #136= IFCSURFACESTYLE('Brick, Engineering, Grey',.BOTH.,(#135)); 112 | #138= IFCPRESENTATIONSTYLEASSIGNMENT((#136)); 113 | #140= IFCSTYLEDITEM(#133,(#138),$); 114 | #143= IFCSHAPEREPRESENTATION(#88,'Body','SweptSolid',(#133)); 115 | #146= IFCPRODUCTDEFINITIONSHAPE($,$,(#125,#143)); 116 | #150= IFCWALLSTANDARDCASE('3Hmf6cl9j9jO5h9YDtGK95',#41,'Basic Wall:Wall-Ext_102Bwk-75Ins-100LBlk-12P:285345',$,'Basic Wall:Wall-Ext_102Bwk-75Ins-100LBlk-12P:45419',#119,#146,'285345'); 117 | #159= IFCMATERIAL('Brick, Engineering, Grey'); 118 | #162= IFCPRESENTATIONSTYLEASSIGNMENT((#136)); 119 | #164= IFCSTYLEDITEM($,(#162),$); 120 | #166= IFCSTYLEDREPRESENTATION(#83,'Style','Material',(#164)); 121 | #169= IFCMATERIALDEFINITIONREPRESENTATION($,$,(#166),#159); 122 | #172= IFCMATERIALLAYER(#159,102.5,$); 123 | #174= IFCMATERIAL('Fiberglass Batt'); 124 | #175= IFCCOLOURRGB($,0.498039215686275,0.498039215686275,0.498039215686275); 125 | #176= IFCSURFACESTYLERENDERING(#175,0.,$,$,$,$,IFCNORMALISEDRATIOMEASURE(0.5),IFCSPECULAREXPONENT(64.),.NOTDEFINED.); 126 | #177= IFCSURFACESTYLE('Fiberglass Batt',.BOTH.,(#176)); 127 | #179= IFCPRESENTATIONSTYLEASSIGNMENT((#177)); 128 | #181= IFCSTYLEDITEM($,(#179),$); 129 | #183= IFCSTYLEDREPRESENTATION(#83,'Style','Material',(#181)); 130 | #185= IFCMATERIALDEFINITIONREPRESENTATION($,$,(#183),#174); 131 | #188= IFCMATERIALLAYER(#174,75.,$); 132 | #189= IFCMATERIAL('Concrete Masonry Units _Low Density'); 133 | #190= IFCCOLOURRGB($,0.709803921568627,0.709803921568627,0.709803921568627); 134 | #191= IFCSURFACESTYLERENDERING(#190,0.,$,$,$,$,IFCNORMALISEDRATIOMEASURE(0.5),IFCSPECULAREXPONENT(64.),.NOTDEFINED.); 135 | #192= IFCSURFACESTYLE('Concrete Masonry Units _Low Density',.BOTH.,(#191)); 136 | #194= IFCPRESENTATIONSTYLEASSIGNMENT((#192)); 137 | #196= IFCSTYLEDITEM($,(#194),$); 138 | #198= IFCSTYLEDREPRESENTATION(#83,'Style','Material',(#196)); 139 | #200= IFCMATERIALDEFINITIONREPRESENTATION($,$,(#198),#189); 140 | #203= IFCMATERIALLAYER(#189,100.,$); 141 | #204= IFCMATERIALLAYER(#159,12.5,$); 142 | #205= IFCMATERIALLAYERSET((#172,#188,#203,#204),'Basic Wall:Wall-Ext_102Bwk-75Ins-100LBlk-12P'); 143 | #211= IFCMATERIALLAYERSETUSAGE(#205,.AXIS2.,.NEGATIVE.,145.); 144 | #212= IFCWALLTYPE('2ru7YPT4T9MuTpOS4FRzxX',#41,'Basic Wall:Wall-Ext_102Bwk-75Ins-100LBlk-12P',$,$,$,$,'45419',$,.STANDARD.); 145 | #214= IFCPROPERTYSINGLEVALUE('Reference',$,IFCIDENTIFIER('Wall-Ext_102Bwk-75Ins-100LBlk-12P'),$); 146 | #215= IFCPROPERTYSINGLEVALUE('LoadBearing',$,IFCBOOLEAN(.F.),$); 147 | #216= IFCPROPERTYSINGLEVALUE('ExtendToStructure',$,IFCBOOLEAN(.F.),$); 148 | #217= IFCPROPERTYSINGLEVALUE('IsExternal',$,IFCBOOLEAN(.T.),$); 149 | #218= IFCPROPERTYSINGLEVALUE('ThermalTransmittance',$,IFCTHERMALTRANSMITTANCEMEASURE(0.240023034149326),$); 150 | #219= IFCPROPERTYSET('3Hmf6cl9j9jO5hBTvtGK95',#41,'Pset_WallCommon',$,(#214,#215,#216,#217,#218)); 151 | #224= IFCRELDEFINESBYPROPERTIES('2fIVQs7Fj9CxhNqPiIY7vw',#41,$,$,(#150),#219); 152 | #228= IFCCLASSIFICATION('http://www.csiorg.net/uniformat','1998',$,'Uniformat'); 153 | #230= IFCAXIS2PLACEMENT3D(#6,#19,#13); 154 | #231= IFCLOCALPLACEMENT(#108,#230); 155 | #232= IFCCARTESIANPOINT((6000.,0.)); 156 | #234= IFCPOLYLINE((#9,#232)); 157 | #236= IFCSHAPEREPRESENTATION(#86,'Axis','Curve2D',(#234)); 158 | #238= IFCCARTESIANPOINT((3000.,0.)); 159 | #240= IFCAXIS2PLACEMENT2D(#238,#25); 160 | #241= IFCRECTANGLEPROFILEDEF(.AREA.,$,#240,6000.,310.); 161 | #242= IFCAXIS2PLACEMENT3D(#6,$,$); 162 | #243= IFCEXTRUDEDAREASOLID(#241,#242,#19,8000.); 163 | #244= IFCCOLOURRGB($,0.,0.,1.); 164 | #245= IFCSURFACESTYLERENDERING(#244,0.,$,$,$,$,IFCNORMALISEDRATIOMEASURE(0.5),IFCSPECULAREXPONENT(128.),.NOTDEFINED.); 165 | #246= IFCSURFACESTYLE('Brick, Engineering',.BOTH.,(#245)); 166 | #248= IFCPRESENTATIONSTYLEASSIGNMENT((#246)); 167 | #250= IFCSTYLEDITEM(#243,(#248),$); 168 | #253= IFCSHAPEREPRESENTATION(#88,'Body','SweptSolid',(#243)); 169 | #255= IFCPRODUCTDEFINITIONSHAPE($,$,(#236,#253)); 170 | #257= IFCWALLSTANDARDCASE('3Hmf6cl9j9jO5h9YDtGKEU',#41,'Basic Wall:Wall-Ext_102Bwk-50Air-45Ins-100DBlk-12P:285562',$,'Basic Wall:Wall-Ext_102Bwk-50Air-45Ins-100DBlk-12P:45417',#231,#255,'285562'); 171 | #260= IFCMATERIAL('Brick, Engineering'); 172 | #261= IFCPRESENTATIONSTYLEASSIGNMENT((#246)); 173 | #263= IFCSTYLEDITEM($,(#261),$); 174 | #265= IFCSTYLEDREPRESENTATION(#83,'Style','Material',(#263)); 175 | #267= IFCMATERIALDEFINITIONREPRESENTATION($,$,(#265),#260); 176 | #270= IFCMATERIALLAYER(#260,102.5,$); 177 | #271= IFCMATERIAL('Air'); 178 | #272= IFCCOLOURRGB($,1.,1.,1.); 179 | #273= IFCSURFACESTYLERENDERING(#272,0.,$,$,$,$,IFCNORMALISEDRATIOMEASURE(0.5),IFCSPECULAREXPONENT(64.),.NOTDEFINED.); 180 | #274= IFCSURFACESTYLE('Air',.BOTH.,(#273)); 181 | #276= IFCPRESENTATIONSTYLEASSIGNMENT((#274)); 182 | #278= IFCSTYLEDITEM($,(#276),$); 183 | #280= IFCSTYLEDREPRESENTATION(#83,'Style','Material',(#278)); 184 | #282= IFCMATERIALDEFINITIONREPRESENTATION($,$,(#280),#271); 185 | #285= IFCMATERIALLAYER(#271,50.,$); 186 | #286= IFCMATERIALLAYER(#174,45.,$); 187 | #287= IFCMATERIAL('Concrete Masonry Units _High Density'); 188 | #288= IFCCOLOURRGB($,0.709803921568627,0.709803921568627,0.709803921568627); 189 | #289= IFCSURFACESTYLERENDERING(#288,0.,$,$,$,$,IFCNORMALISEDRATIOMEASURE(0.5),IFCSPECULAREXPONENT(64.),.NOTDEFINED.); 190 | #290= IFCSURFACESTYLE('Concrete Masonry Units _High Density',.BOTH.,(#289)); 191 | #292= IFCPRESENTATIONSTYLEASSIGNMENT((#290)); 192 | #294= IFCSTYLEDITEM($,(#292),$); 193 | #296= IFCSTYLEDREPRESENTATION(#83,'Style','Material',(#294)); 194 | #298= IFCMATERIALDEFINITIONREPRESENTATION($,$,(#296),#287); 195 | #301= IFCMATERIALLAYER(#287,100.,$); 196 | #302= IFCMATERIALLAYER(#260,12.5,$); 197 | #303= IFCMATERIALLAYERSET((#270,#285,#286,#301,#302),'Basic Wall:Wall-Ext_102Bwk-50Air-45Ins-100DBlk-12P'); 198 | #310= IFCMATERIALLAYERSETUSAGE(#303,.AXIS2.,.NEGATIVE.,155.); 199 | #311= IFCWALLTYPE('2ru7YPT4T9MuTpOS4FRzxZ',#41,'Basic Wall:Wall-Ext_102Bwk-50Air-45Ins-100DBlk-12P',$,$,$,$,'45417',$,.STANDARD.); 200 | #312= IFCPROPERTYSINGLEVALUE('Reference',$,IFCIDENTIFIER('Wall-Ext_102Bwk-50Air-45Ins-100DBlk-12P'),$); 201 | #313= IFCPROPERTYSINGLEVALUE('ThermalTransmittance',$,IFCTHERMALTRANSMITTANCEMEASURE(0.217992231296001),$); 202 | #314= IFCPROPERTYSET('3Hmf6cl9j9jO5hBTvtGKEU',#41,'Pset_WallCommon',$,(#215,#216,#217,#312,#313)); 203 | #316= IFCRELDEFINESBYPROPERTIES('08sY6yPD5An8$qp_v9CHf0',#41,$,$,(#257),#314); 204 | #320= IFCAXIS2PLACEMENT3D(#6,$,$); 205 | #321= IFCLOCALPLACEMENT($,#320); 206 | #322= IFCSITE('3nRMINwjzC6ARvV2Naztsj',#41,'Default',$,'',#321,$,$,.ELEMENT.,(51,30,0,549316),(0,-7,-34,-450321),0.,$,$); 207 | #327= IFCPROPERTYSINGLEVALUE('AboveGround',$,IFCLOGICAL(.U.),$); 208 | #328= IFCPROPERTYSET('3Zu5Bv0LOHrPC12_o6FoQQ',#41,'Pset_BuildingStoreyCommon',$,(#327)); 209 | #330= IFCRELDEFINESBYPROPERTIES('3BeMHYvmDB5Bh9fvNFgTVE',#41,$,$,(#110),#328); 210 | #339= IFCRELAGGREGATES('15CEtdFkj7nAyqvZ4chLfX',#41,$,$,#91,(#322)); 211 | #343= IFCRELAGGREGATES('1RMdf3vGH4gfU6F9_f6gWS',#41,$,$,#322,(#101)); 212 | #347= IFCRELAGGREGATES('2$1LAsj$T3CPRLiPj39tWH',#41,$,$,#101,(#110)); 213 | #351= IFCPROPERTYSINGLEVALUE('NumberOfStoreys',$,IFCINTEGER(1),$); 214 | #352= IFCPROPERTYSET('2$1LAsj$T3CPRLkdD39tWH',#41,'Pset_BuildingCommon',$,(#351)); 215 | #354= IFCRELDEFINESBYPROPERTIES('3GtMa14$z6CeYWJ3Z_2NWk',#41,$,$,(#101),#352); 216 | #358= IFCRELASSOCIATESMATERIAL('3HRV1Y9iT8MuFg1k_c9yVm',#41,$,$,(#150),#211); 217 | #361= IFCRELASSOCIATESMATERIAL('1nvJbTAWz3beBFFYtJULGh',#41,$,$,(#212),#205); 218 | #364= IFCRELASSOCIATESMATERIAL('1Cgjraf1n7u9YrWtx2jqEd',#41,$,$,(#257),#310); 219 | #367= IFCRELASSOCIATESMATERIAL('2CJtFIGH9CPh2d$AoSaY6C',#41,$,$,(#311),#303); 220 | #370= IFCRELDEFINESBYTYPE('2S9CONQWjBkPFMMEZ0uCdv',#41,$,$,(#150),#212); 221 | #373= IFCRELDEFINESBYTYPE('21gz64Q4TAj8$E89af7Pbp',#41,$,$,(#257),#311); 222 | #381= IFCPRESENTATIONLAYERASSIGNMENT('A-200-M_WALL_EXT',$,(#125,#143,#236,#253),$); 223 | ENDSEC; 224 | 225 | END-ISO-10303-21; 226 | -------------------------------------------------------------------------------- /Resources/TwoColumsOneBeam.ifc: -------------------------------------------------------------------------------- 1 | ISO-10303-21; 2 | HEADER; 3 | 4 | /****************************************************************************************** 5 | * STEP Physical File produced by: The EXPRESS Data Manager Version 5.02.0100.07 : 28 Aug 2013 6 | * Module: EDMstepFileFactory/EDMstandAlone 7 | * Creation date: Mon Sep 11 13:10:04 2017 8 | * Host: C10200216 9 | * Database: C:\Users\sgmk2\AppData\Local\Temp\{59CA229E-7C90-478C-A456-1EE900A1D279}\ifc 10 | * Database version: 5507 11 | * Database creation date: Mon Sep 11 13:10:01 2017 12 | * Schema: IFC2X3 13 | * Model: DataRepository.ifc 14 | * Model creation date: Mon Sep 11 13:10:01 2017 15 | * Header model: DataRepository.ifc_HeaderModel 16 | * Header model creation date: Mon Sep 11 13:10:01 2017 17 | * EDMuser: sdai-user 18 | * EDMgroup: sdai-group 19 | * License ID and type: 5605 : Permanent license. Expiry date: 20 | * EDMstepFileFactory options: 020000 21 | ******************************************************************************************/ 22 | FILE_DESCRIPTION(('ViewDefinition [CoordinationView_V2.0]'),'2;1'); 23 | FILE_NAME('Project Number','2017-09-11T13:10:04',(''),(''),'The EXPRESS Data Manager Version 5.02.0100.07 : 28 Aug 2013','20160225_1515(x64) - Exporter 17.0.416.0 - Alternate UI 17.12.14.0',''); 24 | FILE_SCHEMA(('IFC2X3')); 25 | ENDSEC; 26 | 27 | DATA; 28 | #1= IFCORGANIZATION($,'Autodesk Revit 2017 (ENU)',$,$,$); 29 | #5= IFCAPPLICATION(#1,'2017','Autodesk Revit 2017 (ENU)','Revit'); 30 | #6= IFCCARTESIANPOINT((0.,0.,0.)); 31 | #9= IFCCARTESIANPOINT((0.,0.)); 32 | #11= IFCDIRECTION((1.,0.,0.)); 33 | #13= IFCDIRECTION((-1.,0.,0.)); 34 | #15= IFCDIRECTION((0.,1.,0.)); 35 | #17= IFCDIRECTION((0.,-1.,0.)); 36 | #19= IFCDIRECTION((0.,0.,1.)); 37 | #21= IFCDIRECTION((0.,0.,-1.)); 38 | #23= IFCDIRECTION((1.,0.)); 39 | #25= IFCDIRECTION((-1.,0.)); 40 | #27= IFCDIRECTION((0.,1.)); 41 | #29= IFCDIRECTION((0.,-1.)); 42 | #31= IFCAXIS2PLACEMENT3D(#6,$,$); 43 | #32= IFCLOCALPLACEMENT(#394,#31); 44 | #35= IFCPERSON($,'','sgmk2',$,$,$,$,$); 45 | #37= IFCORGANIZATION($,'','',$,$); 46 | #38= IFCPERSONANDORGANIZATION(#35,#37,$); 47 | #41= IFCOWNERHISTORY(#38,#5,$,.NOCHANGE.,$,$,$,0); 48 | #42= IFCSIUNIT(*,.LENGTHUNIT.,.MILLI.,.METRE.); 49 | #43= IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.); 50 | #44= IFCSIUNIT(*,.AREAUNIT.,$,.SQUARE_METRE.); 51 | #45= IFCSIUNIT(*,.VOLUMEUNIT.,$,.CUBIC_METRE.); 52 | #46= IFCSIUNIT(*,.PLANEANGLEUNIT.,$,.RADIAN.); 53 | #47= IFCDIMENSIONALEXPONENTS(0,0,0,0,0,0,0); 54 | #48= IFCMEASUREWITHUNIT(IFCRATIOMEASURE(0.0174532925199433),#46); 55 | #49= IFCCONVERSIONBASEDUNIT(#47,.PLANEANGLEUNIT.,'DEGREE',#48); 56 | #50= IFCSIUNIT(*,.MASSUNIT.,.KILO.,.GRAM.); 57 | #51= IFCSIUNIT(*,.TIMEUNIT.,$,.SECOND.); 58 | #52= IFCSIUNIT(*,.FREQUENCYUNIT.,$,.HERTZ.); 59 | #53= IFCSIUNIT(*,.THERMODYNAMICTEMPERATUREUNIT.,$,.KELVIN.); 60 | #54= IFCSIUNIT(*,.THERMODYNAMICTEMPERATUREUNIT.,$,.DEGREE_CELSIUS.); 61 | #55= IFCDERIVEDUNITELEMENT(#50,1); 62 | #56= IFCDERIVEDUNITELEMENT(#53,-1); 63 | #57= IFCDERIVEDUNITELEMENT(#51,-3); 64 | #58= IFCDERIVEDUNIT((#55,#56,#57),.THERMALTRANSMITTANCEUNIT.,$); 65 | #60= IFCSIUNIT(*,.LENGTHUNIT.,.DECI.,.METRE.); 66 | #61= IFCDERIVEDUNITELEMENT(#43,3); 67 | #62= IFCDERIVEDUNITELEMENT(#51,-1); 68 | #63= IFCDERIVEDUNIT((#61,#62),.VOLUMETRICFLOWRATEUNIT.,$); 69 | #65= IFCSIUNIT(*,.ELECTRICCURRENTUNIT.,$,.AMPERE.); 70 | #66= IFCSIUNIT(*,.ELECTRICVOLTAGEUNIT.,$,.VOLT.); 71 | #67= IFCSIUNIT(*,.POWERUNIT.,$,.WATT.); 72 | #68= IFCSIUNIT(*,.FORCEUNIT.,.KILO.,.NEWTON.); 73 | #69= IFCSIUNIT(*,.ILLUMINANCEUNIT.,$,.LUX.); 74 | #70= IFCSIUNIT(*,.LUMINOUSFLUXUNIT.,$,.LUMEN.); 75 | #71= IFCSIUNIT(*,.LUMINOUSINTENSITYUNIT.,$,.CANDELA.); 76 | #72= IFCDERIVEDUNITELEMENT(#50,-1); 77 | #73= IFCDERIVEDUNITELEMENT(#43,-2); 78 | #74= IFCDERIVEDUNITELEMENT(#51,3); 79 | #75= IFCDERIVEDUNITELEMENT(#70,1); 80 | #76= IFCDERIVEDUNIT((#72,#73,#74,#75),.USERDEFINED.,'Luminous Efficacy'); 81 | #78= IFCDERIVEDUNITELEMENT(#43,1); 82 | #79= IFCDERIVEDUNITELEMENT(#51,-1); 83 | #80= IFCDERIVEDUNIT((#78,#79),.LINEARVELOCITYUNIT.,$); 84 | #82= IFCSIUNIT(*,.PRESSUREUNIT.,$,.PASCAL.); 85 | #83= IFCDERIVEDUNITELEMENT(#43,-2); 86 | #84= IFCDERIVEDUNITELEMENT(#50,1); 87 | #85= IFCDERIVEDUNITELEMENT(#51,-2); 88 | #86= IFCDERIVEDUNIT((#83,#84,#85),.USERDEFINED.,'Friction Loss'); 89 | #88= IFCUNITASSIGNMENT((#42,#44,#45,#49,#50,#51,#52,#54,#58,#63,#65,#66,#67,#68,#69,#70,#71,#76,#80,#82,#86)); 90 | #90= IFCAXIS2PLACEMENT3D(#6,$,$); 91 | #91= IFCDIRECTION((6.12303176911189E-17,1.)); 92 | #93= IFCGEOMETRICREPRESENTATIONCONTEXT($,'Model',3,0.01,#90,#91); 93 | #96= IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Axis','Model',*,*,*,*,#93,$,.GRAPH_VIEW.,$); 94 | #98= IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Body','Model',*,*,*,*,#93,$,.MODEL_VIEW.,$); 95 | #99= IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Box','Model',*,*,*,*,#93,$,.MODEL_VIEW.,$); 96 | #100= IFCGEOMETRICREPRESENTATIONSUBCONTEXT('FootPrint','Model',*,*,*,*,#93,$,.MODEL_VIEW.,$); 97 | #101= IFCPROJECT('2uK5zYFe1BbAxcIrrjrsLE',#41,'Project Number',$,$,'Project Name','Project Status',(#93),#88); 98 | #107= IFCPOSTALADDRESS($,$,$,$,('Enter address here'),$,'London','London','','United Kingdom'); 99 | #111= IFCBUILDING('2uK5zYFe1BbAxcIrrjrsLF',#41,'',$,$,#32,$,'',.ELEMENT.,$,$,#107); 100 | #117= IFCAXIS2PLACEMENT3D(#6,$,$); 101 | #118= IFCLOCALPLACEMENT(#32,#117); 102 | #120= IFCBUILDINGSTOREY('2uK5zYFe1BbAxcIrsIA9lj',#41,'Level 1',$,$,#118,$,'Level 1',.ELEMENT.,0.); 103 | #122= IFCCARTESIANPOINT((0.,0.,3000.)); 104 | #124= IFCAXIS2PLACEMENT3D(#122,$,$); 105 | #125= IFCLOCALPLACEMENT(#32,#124); 106 | #126= IFCBUILDINGSTOREY('2uK5zYFe1BbAxcIrsIA91T',#41,'Level 2',$,$,#125,$,'Level 2',.ELEMENT.,3000.); 107 | #128= IFCAXIS2PLACEMENT3D(#6,$,$); 108 | #448= IFCRELDEFINESBYTYPE('1Q71b6XDz5aB4dZLHw6W6R',#41,$,$,(#315,#345),#283); 109 | #130= IFCCARTESIANPOINT((398.65,-145.85)); 110 | #132= IFCCARTESIANPOINT((417.45,-145.85)); 111 | #134= IFCPOLYLINE((#130,#132)); 112 | #136= IFCCOMPOSITECURVESEGMENT(.CONTINUOUS.,.T.,#134); 113 | #138= IFCCARTESIANPOINT((417.45,-145.85)); 114 | #140= IFCCARTESIANPOINT((417.45,145.85)); 115 | #142= IFCPOLYLINE((#138,#140)); 116 | #144= IFCCOMPOSITECURVESEGMENT(.CONTINUOUS.,.T.,#142); 117 | #145= IFCCARTESIANPOINT((417.45,145.85)); 118 | #147= IFCCARTESIANPOINT((398.65,145.85)); 119 | #149= IFCPOLYLINE((#145,#147)); 120 | #151= IFCCOMPOSITECURVESEGMENT(.CONTINUOUS.,.T.,#149); 121 | #152= IFCCARTESIANPOINT((398.65,145.85)); 122 | #154= IFCCARTESIANPOINT((398.65,24.8)); 123 | #156= IFCPOLYLINE((#152,#154)); 124 | #158= IFCCOMPOSITECURVESEGMENT(.CONTINUOUS.,.T.,#156); 125 | #159= IFCCARTESIANPOINT((380.85,24.8)); 126 | #161= IFCAXIS2PLACEMENT2D(#159,#23); 127 | #162= IFCCIRCLE(#161,17.8); 128 | #163= IFCTRIMMEDCURVE(#162,(IFCPARAMETERVALUE(270.)),(IFCPARAMETERVALUE(0.)),.T.,.PARAMETER.); 129 | #166= IFCCOMPOSITECURVESEGMENT(.CONTINUOUS.,.F.,#163); 130 | #167= IFCCARTESIANPOINT((380.85,7.)); 131 | #169= IFCCARTESIANPOINT((-380.85,7.)); 132 | #171= IFCPOLYLINE((#167,#169)); 133 | #173= IFCCOMPOSITECURVESEGMENT(.CONTINUOUS.,.T.,#171); 134 | #174= IFCCARTESIANPOINT((-380.85,24.8000000000001)); 135 | #176= IFCAXIS2PLACEMENT2D(#174,#29); 136 | #177= IFCCIRCLE(#176,17.8000000000001); 137 | #178= IFCTRIMMEDCURVE(#177,(IFCPARAMETERVALUE(270.)),(IFCPARAMETERVALUE(0.)),.T.,.PARAMETER.); 138 | #181= IFCCOMPOSITECURVESEGMENT(.CONTINUOUS.,.F.,#178); 139 | #182= IFCCARTESIANPOINT((-398.65,24.8)); 140 | #184= IFCCARTESIANPOINT((-398.65,145.85)); 141 | #186= IFCPOLYLINE((#182,#184)); 142 | #188= IFCCOMPOSITECURVESEGMENT(.CONTINUOUS.,.T.,#186); 143 | #189= IFCCARTESIANPOINT((-398.65,145.85)); 144 | #191= IFCCARTESIANPOINT((-417.45,145.85)); 145 | #193= IFCPOLYLINE((#189,#191)); 146 | #195= IFCCOMPOSITECURVESEGMENT(.CONTINUOUS.,.T.,#193); 147 | #196= IFCCARTESIANPOINT((-417.45,145.85)); 148 | #198= IFCCARTESIANPOINT((-417.45,-145.85)); 149 | #200= IFCPOLYLINE((#196,#198)); 150 | #202= IFCCOMPOSITECURVESEGMENT(.CONTINUOUS.,.T.,#200); 151 | #203= IFCCARTESIANPOINT((-417.45,-145.85)); 152 | #205= IFCCARTESIANPOINT((-398.65,-145.85)); 153 | #207= IFCPOLYLINE((#203,#205)); 154 | #209= IFCCOMPOSITECURVESEGMENT(.CONTINUOUS.,.T.,#207); 155 | #210= IFCCARTESIANPOINT((-398.65,-145.85)); 156 | #212= IFCCARTESIANPOINT((-398.65,-24.8)); 157 | #214= IFCPOLYLINE((#210,#212)); 158 | #216= IFCCOMPOSITECURVESEGMENT(.CONTINUOUS.,.T.,#214); 159 | #217= IFCCARTESIANPOINT((-380.85,-24.8)); 160 | #219= IFCAXIS2PLACEMENT2D(#217,#25); 161 | #220= IFCCIRCLE(#219,17.8); 162 | #221= IFCTRIMMEDCURVE(#220,(IFCPARAMETERVALUE(270.)),(IFCPARAMETERVALUE(0.)),.T.,.PARAMETER.); 163 | #224= IFCCOMPOSITECURVESEGMENT(.CONTINUOUS.,.F.,#221); 164 | #225= IFCCARTESIANPOINT((-380.85,-7.)); 165 | #227= IFCCARTESIANPOINT((380.85,-7.)); 166 | #229= IFCPOLYLINE((#225,#227)); 167 | #231= IFCCOMPOSITECURVESEGMENT(.CONTINUOUS.,.T.,#229); 168 | #232= IFCCARTESIANPOINT((380.85,-24.7999999999999)); 169 | #234= IFCAXIS2PLACEMENT2D(#232,#27); 170 | #235= IFCCIRCLE(#234,17.8); 171 | #236= IFCTRIMMEDCURVE(#235,(IFCPARAMETERVALUE(269.999999999999)),(IFCPARAMETERVALUE(0.)),.T.,.PARAMETER.); 172 | #239= IFCCOMPOSITECURVESEGMENT(.CONTINUOUS.,.F.,#236); 173 | #240= IFCCARTESIANPOINT((398.65,-24.8)); 174 | #242= IFCCARTESIANPOINT((398.65,-145.85)); 175 | #244= IFCPOLYLINE((#240,#242)); 176 | #246= IFCCOMPOSITECURVESEGMENT(.CONTINUOUS.,.T.,#244); 177 | #247= IFCCOMPOSITECURVE((#136,#144,#151,#158,#166,#173,#181,#188,#195,#202,#209,#216,#224,#231,#239,#246),.F.); 178 | #265= IFCARBITRARYCLOSEDPROFILEDEF(.AREA.,'UB838x292x176',#247); 179 | #266= IFCAXIS2PLACEMENT3D(#6,#19,#17); 180 | #267= IFCEXTRUDEDAREASOLID(#265,#266,#19,3000.); 181 | #268= IFCCOLOURRGB($,0.968627450980392,0.968627450980392,0.968627450980392); 182 | #269= IFCSURFACESTYLERENDERING(#268,0.,$,$,$,$,IFCNORMALISEDRATIOMEASURE(0.5),IFCSPECULAREXPONENT(128.),.NOTDEFINED.); 183 | #270= IFCSURFACESTYLE('Metal - Steel 43-275',.BOTH.,(#269)); 184 | #272= IFCPRESENTATIONSTYLEASSIGNMENT((#270)); 185 | #274= IFCSTYLEDITEM(#267,(#272),$); 186 | #277= IFCSHAPEREPRESENTATION(#98,'Body','SweptSolid',(#267)); 187 | #280= IFCAXIS2PLACEMENT3D(#6,$,$); 188 | #281= IFCREPRESENTATIONMAP(#280,#277); 189 | #283= IFCCOLUMNTYPE('0OqsfJjEvEVhh65z66E17c',#41,'UB838x292x176',$,$,$,(#281),'127819','UB838x292x176',.COLUMN.); 190 | #286= IFCMATERIAL('Metal - Steel 43-275'); 191 | #289= IFCPRESENTATIONSTYLEASSIGNMENT((#270)); 192 | #291= IFCSTYLEDITEM($,(#289),$); 193 | #293= IFCSTYLEDREPRESENTATION(#93,'Style','Material',(#291)); 194 | #296= IFCMATERIALDEFINITIONREPRESENTATION($,$,(#293),#286); 195 | #299= IFCCLASSIFICATION('http://www.csiorg.net/uniformat','1998',$,'Uniformat'); 196 | #301= IFCCARTESIANTRANSFORMATIONOPERATOR3D($,$,#6,1.,$); 197 | #302= IFCMAPPEDITEM(#281,#301); 198 | #304= IFCSHAPEREPRESENTATION(#98,'Body','MappedRepresentation',(#302)); 199 | #306= IFCPRODUCTDEFINITIONSHAPE($,$,(#304)); 200 | #310= IFCCARTESIANPOINT((-8709.20407542989,7724.18101209079,0.)); 201 | #312= IFCAXIS2PLACEMENT3D(#310,$,$); 202 | #313= IFCLOCALPLACEMENT(#118,#312); 203 | #315= IFCCOLUMN('0OqsfJjEvEVhh65z66E17h',#41,'UB-Universal Beams-Column:UB838x292x176:408839',$,'UB838x292x176',#313,#306,'408839'); 204 | #324= IFCPROPERTYSINGLEVALUE('Reference',$,IFCIDENTIFIER('UB838x292x176'),$); 205 | #325= IFCPROPERTYSINGLEVALUE('LoadBearing',$,IFCBOOLEAN(.T.),$); 206 | #326= IFCPROPERTYSINGLEVALUE('IsExternal',$,IFCBOOLEAN(.F.),$); 207 | #327= IFCPROPERTYSET('0j1ump0kr3PfV4j_WmUBYV',#41,'Pset_ColumnCommon',$,(#324,#325,#326)); 208 | #332= IFCRELDEFINESBYPROPERTIES('3d_ByCnqD6rvWm7vJvO6Ka',#41,$,$,(#315),#327); 209 | #336= IFCMAPPEDITEM(#281,#301); 210 | #337= IFCSHAPEREPRESENTATION(#98,'Body','MappedRepresentation',(#336)); 211 | #339= IFCPRODUCTDEFINITIONSHAPE($,$,(#337)); 212 | #341= IFCCARTESIANPOINT((60.9536784283719,7724.18101209079,0.)); 213 | #343= IFCAXIS2PLACEMENT3D(#341,$,$); 214 | #344= IFCLOCALPLACEMENT(#118,#343); 215 | #345= IFCCOLUMN('0OqsfJjEvEVhh65z66E17z',#41,'UB-Universal Beams-Column:UB838x292x176:408849',$,'UB838x292x176',#344,#339,'408849'); 216 | #348= IFCPROPERTYSET('0Kb8VnMzb1_vS$FIcNkmrg',#41,'Pset_ColumnCommon',$,(#324,#325,#326)); 217 | #350= IFCRELDEFINESBYPROPERTIES('3CwSi7vk98vA$98JyuMkMo',#41,$,$,(#345),#348); 218 | #354= IFCCARTESIANPOINT((-8709.20407542989,7724.18101209079,0.)); 219 | #356= IFCAXIS2PLACEMENT3D(#354,$,$); 220 | #357= IFCLOCALPLACEMENT(#125,#356); 221 | #359= IFCCARTESIANPOINT((1.09423581307055E-12,-1.62359015121183E-12)); 222 | #361= IFCAXIS2PLACEMENT2D(#359,#27); 223 | #362= IFCISHAPEPROFILEDEF(.AREA.,'UB305x102x25',#361,101.600000000028,305.1,5.79999999889007,7.00000000000057,7.60000000000039); 224 | #363= IFCCARTESIANPOINT((7.02887692913547,0.,-152.550000000008)); 225 | #365= IFCAXIS2PLACEMENT3D(#363,#11,#21); 226 | #366= IFCEXTRUDEDAREASOLID(#362,#365,#19,8756.1); 227 | #367= IFCSTYLEDITEM(#366,(#272),$); 228 | #370= IFCSHAPEREPRESENTATION(#98,'Body','SweptSolid',(#366)); 229 | #372= IFCCARTESIANPOINT((8770.15775385827,0.)); 230 | #374= IFCPOLYLINE((#9,#372)); 231 | #376= IFCSHAPEREPRESENTATION(#96,'Axis','Curve2D',(#374)); 232 | #379= IFCPRODUCTDEFINITIONSHAPE($,$,(#376,#370)); 233 | #381= IFCBEAM('0OqsfJjEvEVhh65z66E174',#41,'UB-Universal Beams:UB305x102x25:408872',$,'UB-Universal Beams:UB305x102x25:95037',#357,#379,'408872'); 234 | #384= IFCPROPERTYSINGLEVALUE('Reference',$,IFCIDENTIFIER('UB305x102x25'),$); 235 | #385= IFCPROPERTYSINGLEVALUE('Span',$,IFCPOSITIVELENGTHMEASURE(8770.1),$); 236 | #386= IFCPROPERTYSINGLEVALUE('Slope',$,IFCPLANEANGLEMEASURE(0.),$); 237 | #387= IFCPROPERTYSET('0OqsfJjEvEVhh673Y6E174',#41,'Pset_BeamCommon',$,(#325,#326,#384,#385,#386)); 238 | #389= IFCRELDEFINESBYPROPERTIES('3fcteHp$5C1foKwHOIK2B$',#41,$,$,(#381),#387); 239 | #393= IFCAXIS2PLACEMENT3D(#6,$,$); 240 | #394= IFCLOCALPLACEMENT($,#393); 241 | #395= IFCSITE('2uK5zYFe1BbAxcIrrjrsLC',#41,'Default',$,'',#394,$,$,.ELEMENT.,(51,30,23,112487),(0,-7,-37,-956022),0.,$,$); 242 | #400= IFCPROPERTYSINGLEVALUE('AboveGround',$,IFCLOGICAL(.U.),$); 243 | #401= IFCPROPERTYSET('1w2kgyXAD2C9c7O8j4npO9',#41,'Pset_BuildingStoreyCommon',$,(#400)); 244 | #403= IFCRELDEFINESBYPROPERTIES('2yuO$OwL58Rh4jekPju8x8',#41,$,$,(#120),#401); 245 | #407= IFCRELCONTAINEDINSPATIALSTRUCTURE('1w2kgyXAD2C9c7QsP4npO9',#41,$,$,(#315,#345),#120); 246 | #412= IFCPROPERTYSET('1w2kgyXAD2C9c7O8j4npsv',#41,'Pset_BuildingStoreyCommon',$,(#400)); 247 | #414= IFCRELDEFINESBYPROPERTIES('1QfSoMjfr5GAHhmnpksMRF',#41,$,$,(#126),#412); 248 | #418= IFCRELCONTAINEDINSPATIALSTRUCTURE('1w2kgyXAD2C9c7QsP4npsv',#41,$,$,(#381),#126); 249 | #422= IFCRELAGGREGATES('04NINeENr8gxHOzL0xQ1Oy',#41,$,$,#101,(#395)); 250 | #426= IFCRELAGGREGATES('13ieWLef5699fOe$ApguUZ',#41,$,$,#395,(#111)); 251 | #430= IFCRELAGGREGATES('3mQBaTfuH9QBHDcYQBQvNl',#41,$,$,#111,(#120,#126)); 252 | #435= IFCPROPERTYSINGLEVALUE('NumberOfStoreys',$,IFCINTEGER(2),$); 253 | #436= IFCPROPERTYSET('3mQBaTfuH9QBHDaSwBQvNl',#41,'Pset_BuildingCommon',$,(#435)); 254 | #438= IFCRELDEFINESBYPROPERTIES('0RvgxJGyf4AvC76SueldPr',#41,$,$,(#111),#436); 255 | #442= IFCRELASSOCIATESMATERIAL('1WS$YZHrzBV9ZZkpoblmLY',#41,$,$,(#283,#315,#345,#381),#286); 256 | #451= IFCPRESENTATIONLAYERASSIGNMENT('S-280-M_COLUMN',$,(#277,#304,#337),$); 257 | #453= IFCPRESENTATIONLAYERASSIGNMENT('S-280-M_STRUCT_FRAME',$,(#370,#376),$); 258 | ENDSEC; 259 | 260 | END-ISO-10303-21; 261 | -------------------------------------------------------------------------------- /license.md: -------------------------------------------------------------------------------- 1 | # COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 2 | 3 | 1. Definitions. 4 | 5 | 1.1. "Contributor" means each individual or entity that creates or contributes to the creation of Modifications. 6 | 7 | 1.2. "Contributor Version" means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor. 8 | 9 | 1.3. "Covered Software" means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof. 10 | 11 | 1.4. "Executable" means the Covered Software in any form other than Source Code. 12 | 13 | 1.5. "Initial Developer" means the individual or entity that first makes Original Software available under this License. 14 | 15 | 1.6. "Larger Work" means a work which combines Covered Software or portions thereof with code not governed by the terms of this License. 16 | 17 | 1.7. "License" means this document. 18 | 19 | 1.8. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. 20 | 21 | 1.9. "Modifications" means the Source Code and Executable form of any of the following: 22 | 23 | A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications; 24 | 25 | B. Any new file that contains any part of the Original Software or previous Modification; or 26 | 27 | C. Any new file that is contributed or otherwise made available under the terms of this License. 28 | 29 | 1.10. "Original Software" means the Source Code and Executable form of computer software code that is originally released under this License. 30 | 31 | 1.11. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. 32 | 33 | 1.12. "Source Code" means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code. 34 | 35 | 1.13. "You" (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 36 | 37 | 2. License Grants. 38 | 39 | 2.1. The Initial Developer Grant. 40 | 41 | Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license: 42 | 43 | (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and 44 | 45 | (b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof). 46 | 47 | (c) The licenses granted in Sections 2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License. 48 | 49 | (d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for code that You delete from the Original Software, or (2) for infringements caused by: (i) the modification of the Original Software, or (ii) the combination of the Original Software with other software or devices. 50 | 51 | 2.2. Contributor Grant. 52 | 53 | Conditioned upon Your compliance with Section 3.1 below and 54 | subject to third party intellectual property claims, each 55 | Contributor hereby grants You a world-wide, royalty-free, 56 | non-exclusive license: 57 | 58 | (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and 59 | 60 | (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1) Modifications made by that Contributor (or portions thereof); and (2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). 61 | 62 | (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party. 63 | (d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for any code that Contributor has deleted from the Contributor Version; (2) for infringements caused by: (i) third party modifications of Contributor Version, or (ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3) under Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor. 64 | 65 | 3. Distribution Obligations. 66 | 67 | 3.1. Availability of Source Code. 68 | 69 | Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange. 70 | 71 | 3.2. Modifications. 72 | 73 | The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License. 74 | 75 | 3.3. Required Notices. 76 | 77 | You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer. 78 | 79 | 3.4. Application of Additional Terms. 80 | 81 | You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients' rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. 82 | 83 | 3.5. Distribution of Executable Versions. 84 | 85 | You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipient's rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. 86 | 87 | 3.6. Larger Works. 88 | 89 | You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software. 90 | 91 | 4. Versions of the License. 92 | 93 | 4.1. New Versions. 94 | 95 | Sun Microsystems, Inc. is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License. 96 | 97 | 4.2. Effect of New Versions. 98 | 99 | You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward. 100 | 101 | 4.3. Modified Versions. 102 | 103 | When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a) rename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b) otherwise make it clear that the license contains terms which differ from this License. 104 | 105 | 5. DISCLAIMER OF WARRANTY. 106 | 107 | COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. 108 | 109 | 6. TERMINATION. 110 | 111 | 6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. 112 | 113 | 6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as "Participant") alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant. 114 | 115 | 6.3. In the event of termination under Sections 6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination. 116 | 117 | 7. LIMITATION OF LIABILITY. 118 | 119 | UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. 120 | 121 | 8. U.S. GOVERNMENT END USERS. 122 | 123 | The Covered Software is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" (as that term is defined at 48 C.F.R. ¤ 252.227-7014(a)(1)) and "commercial computer software documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License. 124 | 125 | 9. MISCELLANEOUS. 126 | 127 | This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdiction's conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software. 128 | 129 | 10. RESPONSIBILITY FOR CLAIMS. 130 | 131 | As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. -------------------------------------------------------------------------------- /XbimPlugin.Gltf.IO/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using gltf = glTFLoader.Schema; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Diagnostics; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Windows; 10 | using System.Windows.Controls; 11 | using Xbim.Common.Geometry; 12 | using Xbim.Ifc; 13 | using Xbim.ModelGeometry.Scene; 14 | using Xbim.Geom; 15 | using Xbim.Ifc4.Interfaces; 16 | using Xbim.Common; 17 | using Xbim.GLTF.SemanticExport; 18 | using Xbim.GLTF.ExportHelpers; 19 | 20 | namespace Xbim.GLTF 21 | { 22 | /// 23 | /// Interaction logic for MainWindow.xaml 24 | /// 25 | public partial class MainWindow : UserControl 26 | { 27 | public MainWindow() 28 | { 29 | InitializeComponent(); 30 | } 31 | 32 | private void Button_Click(object sender, RoutedEventArgs e) 33 | { 34 | var inValue = new byte[] { 35 | 1, 0, 0 36 | }; 37 | var str = Convert.ToBase64String(inValue); 38 | Debug.WriteLine(str); 39 | 40 | byte[] databack = Convert.FromBase64String(str); 41 | 42 | for (int i = 0; i < databack.Length; i++) 43 | { 44 | if (inValue[i] != databack[i]) 45 | { 46 | Debug.WriteLine("error."); 47 | } 48 | } 49 | 50 | var example = "AAABAAIAAAAAAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAA="; 51 | databack = Convert.FromBase64String(example); 52 | for (int i = 0; i < databack.Length; i++) 53 | { 54 | Debug.Write($", {databack[i]} "); 55 | } 56 | Debug.WriteLine(""); 57 | Debug.WriteLine($"Len: {databack.Length}"); 58 | 59 | 60 | str = Convert.ToBase64String(test); 61 | 62 | } 63 | 64 | private byte[] test = new byte[] 65 | { 66 | 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 0, 0 67 | }; 68 | 69 | private void MakeTriangle_Click(object sender, RoutedEventArgs e) 70 | { 71 | //var s = new Gltf2Schema(); 72 | //s.buffers.Add(new Buffer(test)); 73 | 74 | 75 | //JsonSerializer serializer = new JsonSerializer(); 76 | //serializer.NullValueHandling = NullValueHandling.Ignore; 77 | //using (StreamWriter sw = new StreamWriter("out.gltf")) 78 | //using (JsonWriter writer = new JsonTextWriter(sw)) 79 | //{ 80 | // serializer.Serialize(writer, s); 81 | //} 82 | 83 | 84 | } 85 | 86 | private void libtest_Click(object sender, RoutedEventArgs e) 87 | { 88 | var t = glTFLoader.Interface.LoadModel("..\\..\\..\\Resources\\TwoWallsTwoColour.gltf"); 89 | 90 | report(t); 91 | 92 | // var gltf = CreateModel(); 93 | // glTFLoader.Interface.SaveModel(gltf, "Data\\BoxInterleaved2.gltf"); 94 | } 95 | 96 | private void report(gltf.Gltf t) 97 | { 98 | var sb = new StringBuilder(); 99 | ReportAllProperties(t, sb); 100 | Debug.WriteLine(sb.ToString()); 101 | // PrintProperties(t, 0); 102 | } 103 | 104 | public static string ReportAllProperties(T instance, StringBuilder sb, int indent = 0) where T : class 105 | { 106 | if (instance == null) 107 | return string.Empty; 108 | 109 | var strListType = typeof(List); 110 | var strArrType = typeof(string[]); 111 | 112 | 113 | 114 | var arrayTypes = new[] { strListType, strArrType }; 115 | var handledTypes = new[] { 116 | typeof(bool), 117 | typeof(Int32), 118 | typeof(String), 119 | typeof(DateTime), 120 | typeof(double), 121 | typeof(decimal), 122 | typeof(float), 123 | strListType, 124 | strArrType 125 | }; 126 | 127 | try 128 | { 129 | var ind = new string('\t', indent); 130 | var elems = instance as System.Collections.ICollection; 131 | if (elems != null) 132 | { 133 | sb.AppendLine(ind + "==="); 134 | 135 | int i = 0; 136 | if (elems.Count == 16) 137 | { 138 | sb.Append(ind); 139 | foreach (var elem in elems) 140 | { 141 | sb.Append(elem + "\t"); 142 | i++; 143 | if (i==4 || i == 8 || i == 12) 144 | { 145 | sb.AppendLine(""); 146 | sb.Append(ind); 147 | } 148 | } 149 | sb.AppendLine(""); 150 | } 151 | else { 152 | 153 | foreach (var elem in elems) 154 | { 155 | if (handledTypes.Contains(elem.GetType())) 156 | { 157 | sb.AppendLine(ind + $"( {i++} ) '{elem}'"); 158 | } 159 | else 160 | { 161 | sb.AppendLine(ind + $"( {i++} ) [{elem.GetType().Name}]"); 162 | ReportAllProperties(elem, sb, indent + 1); 163 | } 164 | } 165 | } 166 | } 167 | else 168 | { 169 | var validProperties = instance.GetType() 170 | .GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) 171 | // .Where(prop => handledTypes.Contains(prop.PropertyType)) 172 | .Where(prop => prop.GetValue(instance, null) != null) 173 | .ToList(); 174 | if (!validProperties.Any()) 175 | return ""; 176 | var format = ind + string.Format("{{0,-{0}}} : {{1}}", validProperties.Max(prp => prp.Name.Length)); 177 | foreach (var prop in validProperties) 178 | { 179 | if (prop.Name == "SyncRoot") 180 | continue; 181 | var itervalue = prop.GetValue(instance, null); 182 | var outv = string.Format(format, prop.Name, (arrayTypes.Contains(prop.PropertyType) ? string.Join(", ", (IEnumerable)itervalue) : prop.GetValue(instance, null))); 183 | sb.AppendLine(outv); 184 | if (!handledTypes.Contains(prop.PropertyType)) 185 | { 186 | ReportAllProperties(itervalue, sb, indent + 1); 187 | } 188 | } 189 | } 190 | } 191 | catch (Exception) 192 | { 193 | 194 | } 195 | return ""; 196 | 197 | } 198 | 199 | public void PrintProperties(object obj, int indent) 200 | { 201 | if (obj == null) return; 202 | string indentString = new string(' ', indent); 203 | Type objType = obj.GetType(); 204 | PropertyInfo[] properties = objType.GetProperties(); 205 | foreach (PropertyInfo property in properties) 206 | { 207 | object propValue = property.GetValue(obj, null); 208 | var elems = propValue as System.Collections.IList; 209 | if (elems != null) 210 | { 211 | foreach (var item in elems) 212 | { 213 | PrintProperties(item, indent + 3); 214 | } 215 | } 216 | else 217 | { 218 | // This will not cut-off System.Collections because of the first check 219 | if (property.PropertyType.Assembly == objType.Assembly) 220 | { 221 | Debug.WriteLine("{0}{1}:", indentString, property.Name); 222 | 223 | PrintProperties(propValue, indent + 2); 224 | } 225 | else 226 | { 227 | Debug.WriteLine("{0}{1}: {2}", indentString, property.Name, propValue); 228 | } 229 | } 230 | } 231 | } 232 | 233 | 234 | 235 | private void GetModel(object sender, RoutedEventArgs e) 236 | { 237 | using (var m = IfcStore.Open(@"C:\Users\Claudio\Dev\XbimTeam\XbimWebUI\Xbim.WeXplorer\tests\data\OneWall.ifc")) 238 | { 239 | var c = new Xbim3DModelContext(m); 240 | c.CreateContext(); 241 | m.SaveAs("model.xbim"); 242 | } 243 | } 244 | 245 | IfcStore _model = null; 246 | 247 | string _gltfOutName = ""; 248 | 249 | 250 | 251 | private void OpenModel(object sender, RoutedEventArgs e) 252 | { 253 | if (_model != null) 254 | { 255 | _model.Close(); 256 | _model.Dispose(); 257 | } 258 | // _model = IfcStore.Open("model.xbim"); 259 | var modelName = @"C:\Users\Claudio\Dropbox (Northumbria University)\_Courseware\2017-18\Semester 2\KB7038\materials\Duplex\Duplex_A_20110907.xBIM"; 260 | 261 | // on mac 262 | modelName = @"C:\Users\Claudio\Dropbox (Northumbria University)\Projects\uniZite\BIM model\ARK 0-00-A-200-X-01.xbim"; 263 | modelName = @"C:\Users\Claudio\Dropbox (Northumbria University)\Projects\uniZite\BIM model\Hadsel Bygg B VVS.xbim"; 264 | modelName = @"C:\Users\Claudio\Dropbox (Northumbria University)\Projects\uniZite\Style\Hadsel Bygg B VVS.xBIM"; 265 | modelName = @"C:\Users\Claudio\Dropbox (Northumbria University)\Projects\uniZite\BIM model\VAMMA\Vamma12_ARK.xBIM"; 266 | // modelName = @"C:\Users\Claudio\Dropbox (Northumbria University)\Projects\uniZite\BIM model\VAMMA\Vamma12_RIE.xBIM"; 267 | 268 | // at uni 269 | // modelName = @"C:\Users\sgmk2\Dropbox (Northumbria University)\Projects\uniZite\BIM model\ARK 0-00-A-200-X-01.xBIM"; 270 | // modelName = @"C:\Users\sgmk2\Dropbox (Northumbria University)\Projects\uniZite\BIM model\Hadsel Bygg B VVS.xbim"; 271 | modelName = @"C:\Users\sgmk2\Dropbox (Northumbria University)\Projects\uniZite\BIM model\VAMMA\Vamma12_RIE.xBIM"; 272 | 273 | _model = IfcStore.Open(modelName); 274 | _gltfOutName = Path.ChangeExtension(modelName, "gltf"); 275 | 276 | } 277 | 278 | //private static void AddMesh(gltf.Gltf gltf, XbimMesher mesh) 279 | //{ 280 | // gltf.Buffers = new glTFLoader.Schema.Buffer[1]; 281 | // var buf = new glTFLoader.Schema.Buffer(); 282 | // gltf.Buffers[0] = buf; 283 | // gltf.BufferViews = new gltf.BufferView[2]; 284 | //} 285 | 286 | 287 | 288 | private void TryMesh(object sender, RoutedEventArgs e) 289 | { 290 | MessageBox.Show("Method disabled."); 291 | } 292 | 293 | private void ToBin(object sender, RoutedEventArgs e) 294 | { 295 | var d = new DirectoryInfo(@"..\..\..\Resources\"); 296 | 297 | var files = d.GetFiles("*.gltf"); 298 | foreach (var file in files) 299 | { 300 | var t = glTFLoader.Interface.LoadModel(file.FullName); 301 | var newName = Path.ChangeExtension(file.FullName, ".txt2"); 302 | glTFLoader.Interface.SaveModel(t, newName); 303 | } 304 | } 305 | 306 | private void ToText(object sender, RoutedEventArgs e) 307 | { 308 | var d = new DirectoryInfo(@"..\..\..\Resources\"); 309 | 310 | var files = d.GetFiles("*.gltfb"); 311 | foreach (var file in files) 312 | { 313 | var t = glTFLoader.Interface.LoadModel(file.FullName); 314 | var newName = Path.ChangeExtension(file.FullName, ".2.gltf"); 315 | glTFLoader.Interface.SaveModel(t, newName); 316 | } 317 | } 318 | 319 | private void XbimsRead(object sender, RoutedEventArgs e) 320 | { 321 | var d = new DirectoryInfo(@"C:\Users\Claudio\Desktop"); 322 | var files = d.GetFiles("*.xbim", SearchOption.AllDirectories); 323 | 324 | foreach (var file in files) 325 | { 326 | using (var m = IfcStore.Open(file.FullName)) 327 | { 328 | using (var geomStore = m.GeometryStore) 329 | using (var geomReader = geomStore.BeginRead()) 330 | { 331 | int sameobject = 0; 332 | int notIdentity = 0; 333 | int productLabel = 0; 334 | XbimMatrix3D t = XbimMatrix3D.Identity; 335 | var shapeInstances = geomReader.ShapeInstances.Where(s => s.RepresentationType == XbimGeometryRepresentationType.OpeningsAndAdditionsIncluded); 336 | foreach (var shapeInstance in shapeInstances.OrderBy(x => x.IfcProductLabel)) 337 | { 338 | 339 | if (productLabel == shapeInstance.IfcProductLabel) 340 | { 341 | sameobject++; 342 | if (!shapeInstance.Transformation.Equals(t)) 343 | { 344 | 345 | } 346 | } 347 | productLabel = shapeInstance.IfcProductLabel; 348 | t = shapeInstance.Transformation; 349 | if (!t.Equals(XbimMatrix3D.Identity)) 350 | { 351 | notIdentity++; 352 | } 353 | } 354 | Debug.WriteLine($"{file.FullName} same:{sameobject} notid:{notIdentity}"); 355 | } 356 | m.Close(); 357 | } 358 | } 359 | } 360 | 361 | private void ConvertAll(object sender, RoutedEventArgs e) 362 | { 363 | foreach (var item in GetModelList()) 364 | { 365 | MultipleFilesExporter m = new MultipleFilesExporter(); 366 | m.ExportByStorey(item); 367 | } 368 | } 369 | 370 | private IEnumerable GetModelList() 371 | { 372 | var folders = new string[] 373 | { 374 | @"C:\Users\Claudio\Dropbox (Northumbria University)\Projects\uniZite\", 375 | @"C:\Users\sgmk2\Dropbox (Northumbria University)\Projects\uniZite\" 376 | }; 377 | 378 | var folder = ""; 379 | foreach (var item in folders) 380 | { 381 | if (Directory.Exists(item)) 382 | { 383 | folder = item; 384 | break; 385 | } 386 | } 387 | 388 | var files = new string[] 389 | { 390 | @"BIM model\ARK 0-00-A-200-X-01.xbim", 391 | @"BIM model\Hadsel Bygg B VVS.xbim", 392 | @"BIM model\VAMMA\Vamma12_ARK.xBIM", 393 | @"BIM model\VAMMA\Vamma12_RIE.xBIM" 394 | }; 395 | 396 | foreach (var item in files) 397 | { 398 | var fname = Path.Combine(folder, item); 399 | if (File.Exists(fname)) 400 | yield return fname; 401 | } 402 | } 403 | } 404 | } 405 | --------------------------------------------------------------------------------