├── 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 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/Xbim.GLTF.IO/SemanticExport/BuildingModel.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using Newtonsoft.Json.Converters;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace Xbim.GLTF.SemanticExport
11 | {
12 | public class BuildingModel
13 | {
14 | public string geometryExporterVersion = "1.2";
15 |
16 | public string uniZiteMetadataExporterVersion = "1.2";
17 |
18 | public string ifcSchemaVersion = "ifc2x3";
19 |
20 | public List elements = new List();
21 |
22 | public List systems = new List();
23 |
24 | public List storeys = new List();
25 |
26 | public FileInfo Export(string v)
27 | {
28 | FileInfo f = new FileInfo(v);
29 | if (f.Exists)
30 | f.Delete();
31 | using (var stream = f.OpenWrite())
32 | {
33 | SerializeToStream(this, stream);
34 | }
35 | return f;
36 | }
37 |
38 | private static JsonSerializerSettings GetJsonSerializerSettings()
39 | {
40 | JsonSerializerSettings settings = new JsonSerializerSettings{
41 | Converters = new List {
42 | new StringEnumConverter()
43 | }
44 | };
45 | return settings;
46 | }
47 |
48 | public static void SerializeToStream(BuildingModel obj, Stream stream)
49 | {
50 | var settings = GetJsonSerializerSettings();
51 | settings.Formatting = Formatting.Indented;
52 | var serializer = JsonSerializer.Create(settings);
53 |
54 | using (var sw = new StreamWriter(stream))
55 | using (var jsonTextWriter = new JsonTextWriter(sw))
56 | {
57 | serializer.Serialize(jsonTextWriter, obj);
58 | }
59 | }
60 |
61 | public static BuildingModel DeserializeFromStream(Stream stream)
62 | {
63 | var serializer = new JsonSerializer();
64 |
65 | using (var sr = new StreamReader(stream))
66 | using (var jsonTextReader = new JsonTextReader(sr))
67 | {
68 | var obj = serializer.Deserialize(jsonTextReader, typeof(BuildingModel));
69 | return obj as BuildingModel;
70 | }
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/XbimGLTF.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.1.32421.90
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution items", "Solution items", "{DC6781F8-5E66-4DCF-89B8-EA2839318DD5}"
7 | ProjectSection(SolutionItems) = preProject
8 | azure-pipelines.yml = azure-pipelines.yml
9 | license.md = license.md
10 | SharedAssemblyInfo.cs = SharedAssemblyInfo.cs
11 | XbimPlugin.Gltf.nuspec = XbimPlugin.Gltf.nuspec
12 | EndProjectSection
13 | EndProject
14 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MainTests", "MainTests\MainTests.csproj", "{2309990B-2BD5-4910-9252-2E909BF7ABDD}"
15 | ProjectSection(ProjectDependencies) = postProject
16 | {11755BB4-23CF-4A71-9443-EB1E752CB53D} = {11755BB4-23CF-4A71-9443-EB1E752CB53D}
17 | EndProjectSection
18 | EndProject
19 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xbim.GLTF.IO", "Xbim.GLTF.IO\Xbim.GLTF.IO.csproj", "{11755BB4-23CF-4A71-9443-EB1E752CB53D}"
20 | EndProject
21 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XbimPlugin.Gltf.IO", "XbimPlugin.Gltf.IO\XbimPlugin.Gltf.IO.csproj", "{7DAFBD23-8E73-4359-9EC6-52B191344323}"
22 | EndProject
23 | Global
24 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
25 | Debug|Any CPU = Debug|Any CPU
26 | Release|Any CPU = Release|Any CPU
27 | EndGlobalSection
28 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
29 | {2309990B-2BD5-4910-9252-2E909BF7ABDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
30 | {2309990B-2BD5-4910-9252-2E909BF7ABDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
31 | {2309990B-2BD5-4910-9252-2E909BF7ABDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
32 | {2309990B-2BD5-4910-9252-2E909BF7ABDD}.Release|Any CPU.Build.0 = Release|Any CPU
33 | {11755BB4-23CF-4A71-9443-EB1E752CB53D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34 | {11755BB4-23CF-4A71-9443-EB1E752CB53D}.Debug|Any CPU.Build.0 = Debug|Any CPU
35 | {11755BB4-23CF-4A71-9443-EB1E752CB53D}.Release|Any CPU.ActiveCfg = Release|Any CPU
36 | {11755BB4-23CF-4A71-9443-EB1E752CB53D}.Release|Any CPU.Build.0 = Release|Any CPU
37 | {7DAFBD23-8E73-4359-9EC6-52B191344323}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38 | {7DAFBD23-8E73-4359-9EC6-52B191344323}.Debug|Any CPU.Build.0 = Debug|Any CPU
39 | {7DAFBD23-8E73-4359-9EC6-52B191344323}.Release|Any CPU.ActiveCfg = Release|Any CPU
40 | {7DAFBD23-8E73-4359-9EC6-52B191344323}.Release|Any CPU.Build.0 = Release|Any CPU
41 | EndGlobalSection
42 | GlobalSection(SolutionProperties) = preSolution
43 | HideSolutionNode = FALSE
44 | EndGlobalSection
45 | GlobalSection(ExtensibilityGlobals) = postSolution
46 | SolutionGuid = {7AB42F23-CD9E-4AA2-ACAB-51BCDCF68C1E}
47 | EndGlobalSection
48 | EndGlobal
49 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 | *.gltf binary
6 | *.gltf merge=text
7 |
8 |
9 | ###############################################################################
10 | # Set default behavior for command prompt diff.
11 | #
12 | # This is need for earlier builds of msysgit that does not have it on by
13 | # default for csharp files.
14 | # Note: This is only used by command line
15 | ###############################################################################
16 | #*.cs diff=csharp
17 |
18 | ###############################################################################
19 | # Set the merge driver for project and solution files
20 | #
21 | # Merging from the command prompt will add diff markers to the files if there
22 | # are conflicts (Merging from VS is not affected by the settings below, in VS
23 | # the diff markers are never inserted). Diff markers may cause the following
24 | # file extensions to fail to load in VS. An alternative would be to treat
25 | # these files as binary and thus will always conflict and require user
26 | # intervention with every merge. To do so, just uncomment the entries below
27 | ###############################################################################
28 | #*.sln merge=binary
29 | #*.csproj merge=binary
30 | #*.vbproj merge=binary
31 | #*.vcxproj merge=binary
32 | #*.vcproj merge=binary
33 | #*.dbproj merge=binary
34 | #*.fsproj merge=binary
35 | #*.lsproj merge=binary
36 | #*.wixproj merge=binary
37 | #*.modelproj merge=binary
38 | #*.sqlproj merge=binary
39 | #*.wwaproj merge=binary
40 |
41 | ###############################################################################
42 | # behavior for image files
43 | #
44 | # image files are treated as binary by default.
45 | ###############################################################################
46 | #*.jpg binary
47 | #*.png binary
48 | #*.gif binary
49 |
50 | ###############################################################################
51 | # diff behavior for common document formats
52 | #
53 | # Convert binary document formats to text before diffing them. This feature
54 | # is only available from the command line. Turn it on by uncommenting the
55 | # entries below.
56 | ###############################################################################
57 | #*.doc diff=astextplain
58 | #*.DOC diff=astextplain
59 | #*.docx diff=astextplain
60 | #*.DOCX diff=astextplain
61 | #*.dot diff=astextplain
62 | #*.DOT diff=astextplain
63 | #*.pdf diff=astextplain
64 | #*.PDF diff=astextplain
65 | #*.rtf diff=astextplain
66 | #*.RTF diff=astextplain
67 |
--------------------------------------------------------------------------------
/XbimPlugin.Gltf.IO/Properties/Resources.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 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("XbimPlugin.Gltf.IO.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/Resources/TwoWallsTwoColour.gltfb:
--------------------------------------------------------------------------------
1 | glTF L 8 JSON{"accessors":[{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR","max":[23.0],"min":[0.0]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[1.0,1.0,1.0],"min":[-1.0,-1.0,-1.0]},{"bufferView":1,"byteOffset":288,"componentType":5126,"count":24,"type":"VEC3","max":[6.0,0.155,8.0],"min":[0.0,-0.155,0.0]},{"bufferView":0,"byteOffset":72,"componentType":5123,"count":36,"type":"SCALAR","max":[23.0],"min":[0.0]},{"bufferView":1,"byteOffset":576,"componentType":5126,"count":24,"type":"VEC3","max":[1.0,1.0,1.0],"min":[-1.0,-1.0,-1.0]},{"bufferView":1,"byteOffset":864,"componentType":5126,"count":24,"type":"VEC3","max":[5.0,0.145000011,8.0],"min":[0.0,-0.145000011,0.0]}],"asset":{"generator":"COLLADA2GLTF","version":"2.0"},"buffers":[{"uri":"data:application/octet-stream;base64,AAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AADAQFK4Hj4AAABBAADAQFK4Hj4AAAAAAAAAAFK4Hj4AAAAAAAAAAFK4Hj4AAABBAAAAAFK4Hj4AAABBAAAAAFK4Hj4AAAAAAAAAAFK4Hr4AAAAAAAAAAFK4Hr4AAABBAAAAAFK4Hr4AAABBAAAAAFK4Hr4AAAAAAADAQFK4Hr4AAAAAAADAQFK4Hr4AAABBAADAQFK4Hr4AAABBAADAQFK4Hr4AAAAAAADAQFK4Hj4AAAAAAADAQFK4Hj4AAABBAAAAAFK4Hj4AAAAAAADAQFK4Hr4AAAAAAAAAAFK4Hr4AAAAAAADAQFK4Hj4AAAAAAAAAAFK4Hr4AAABBAADAQFK4Hr4AAABBAAAAAFK4Hj4AAABBAADAQFK4Hj4AAABBAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AACgQOJ6FD4AAABBAACgQOJ6FD4AAAAAAAAAAOJ6FD4AAAAAAAAAAOJ6FD4AAABBAAAAAOJ6FD4AAABBAAAAAOJ6FD4AAAAAAAAAAOJ6FL4AAAAAAAAAAOJ6FL4AAABBAAAAAOJ6FL4AAABBAAAAAOJ6FL4AAAAAAACgQOJ6FL4AAAAAAACgQOJ6FL4AAABBAACgQOJ6FL4AAABBAACgQOJ6FL4AAAAAAACgQOJ6FD4AAAAAAACgQOJ6FD4AAABBAAAAAOJ6FL4AAAAAAACgQOJ6FD4AAAAAAACgQOJ6FL4AAAAAAAAAAOJ6FD4AAAAAAACgQOJ6FL4AAABBAACgQOJ6FD4AAABBAAAAAOJ6FL4AAABBAAAAAOJ6FD4AAABBAAABAAIAAwAAAAIABAAFAAYABwAEAAYACAAJAAoACwAIAAoADAANAA4ADwAMAA4AEAARABIAEAATABEAFAAVABYAFQAXABYAAAABAAIAAwAAAAIABAAFAAYABwAEAAYACAAJAAoACwAIAAoADAANAA4ADwAMAA4AEAARABIAEwARABAAFAAVABYAFgAVABcA","byteLength":1296}],"bufferViews":[{"buffer":0,"byteOffset":1152,"byteLength":144,"target":34963},{"buffer":0,"byteLength":1152,"byteStride":12,"target":34962}],"materials":[{"name":"246_BrickEngineering-fx","pbrMetallicRoughness":{"baseColorFactor":[0.0,0.0,1.0,1.0],"metallicFactor":0.0}},{"name":"136_BrickEngineeringGrey-fx","pbrMetallicRoughness":{"baseColorFactor":[0.3921569,1.0,0.1960784,1.0],"metallicFactor":0.0}}],"meshes":[{"primitives":[{"attributes":{"NORMAL":1,"POSITION":2},"indices":0,"material":0}],"name":"257_BasicWallWallExt_102Bwk50Air45Ins100DBlk12P285562"},{"primitives":[{"attributes":{"NORMAL":4,"POSITION":5},"indices":3,"material":1}],"name":"150_BasicWallWallExt_102Bwk75Ins100LBlk12P285345"}],"nodes":[{"children":[2,1],"matrix":[1.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0],"name":"Z_UP"},{"matrix":[-1.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0],"mesh":0,"name":"257_BasicWallWallExt_102Bwk50Air45Ins100DBlk12P285562"},{"mesh":1,"name":"150_BasicWallWallExt_102Bwk75Ins100LBlk12P285345"}],"scene":0,"scenes":[{"nodes":[0]}]}
--------------------------------------------------------------------------------
/Xbim.GLTF.IO/ExportHelpers/MultipleFilesExporter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using Xbim.Common;
8 | using Xbim.Common.Geometry;
9 | using Xbim.GLTF.SemanticExport;
10 | using Xbim.Ifc;
11 | using Xbim.Ifc4.Interfaces;
12 | using Xbim.Ifc4.MeasureResource;
13 | using Xbim.ModelGeometry.Scene;
14 |
15 | namespace Xbim.GLTF.ExportHelpers
16 | {
17 | public class MultipleFilesExporter
18 | {
19 | int[] elemsToExport;
20 |
21 | bool Filter(int elementId, IModel model)
22 | {
23 | return !elemsToExport.Contains(elementId);
24 | }
25 |
26 | public void ExportByStorey(string fileName)
27 | {
28 | FileInfo f = new FileInfo(fileName);
29 |
30 | var ifcName = Path.ChangeExtension(fileName, "ifc");
31 | using (var store = IfcStore.Open(ifcName))
32 | {
33 | ExportByStorey(store);
34 | }
35 | }
36 |
37 | public void ExportByStorey(IfcStore store, bool exportSemantic = true)
38 | {
39 | var f = new FileInfo(store.FileName);
40 | var dir = f.Directory;
41 | if (store.GeometryStore.IsEmpty)
42 | {
43 | var context = new Xbim3DModelContext(store);
44 | context.CreateContext();
45 | }
46 |
47 | foreach (var storey in store.Instances.OfType())
48 | {
49 | // prepare filter
50 | var rels = store.Instances.OfType().Where(x => x.RelatingStructure.EntityLabel == storey.EntityLabel);
51 | List els = new List();
52 | foreach (var rel in rels)
53 | {
54 | // entities directly in the relation
55 | //
56 | var entitiesInStoreyRel = rel.RelatedElements.Select(x => x.EntityLabel).ToList();
57 | els.AddRange(entitiesInStoreyRel);
58 |
59 | // decomposed elements
60 | //
61 | var relsToComposingEntities = store.Instances.OfType().Where(x => entitiesInStoreyRel.Contains(x.RelatingObject.EntityLabel));
62 | foreach (var relToComposingEntities in relsToComposingEntities)
63 | {
64 | els.AddRange(relToComposingEntities.RelatedObjects.Select(x => x.EntityLabel).ToList());
65 | }
66 | }
67 |
68 | // only export once
69 | elemsToExport = els.Distinct().ToArray();
70 |
71 | // write gltf
72 | //
73 | var bldr = new Builder();
74 | bldr.BufferInBase64 = true;
75 | bldr.CustomFilter = this.Filter;
76 |
77 | var storeyName = storey.Name.ToString();
78 | if (HasInvalidChars(storeyName))
79 | {
80 | storeyName = storey.EntityLabel.ToString();
81 | }
82 |
83 | var outName = Path.Combine(
84 | dir.FullName,
85 | f.Name + "." + storeyName + ".gltf"
86 | );
87 | var ret = bldr.BuildInstancedScene(store, XbimMatrix3D.Identity);
88 | if (ret != null && exportSemantic)
89 | {
90 | // actual write if not empty model.
91 | //
92 | glTFLoader.Interface.SaveModel(ret, outName);
93 |
94 | // write json
95 | //
96 | var jsonFileName = Path.ChangeExtension(outName, "json");
97 | var bme = new BuildingModelExtractor();
98 | bme.CustomFilter = this.Filter;
99 | var rep = bme.GetModel(store);
100 | rep.Export(jsonFileName);
101 | }
102 | }
103 | }
104 |
105 | private bool HasInvalidChars(string storeyName)
106 | {
107 | var invalid = Path.GetInvalidFileNameChars();
108 | var broken = storeyName.Split(invalid);
109 | return (broken.Length != 1);
110 | }
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/Resources/OneWall.txt:
--------------------------------------------------------------------------------
1 | Accessors : glTFLoader.Schema.Accessor[]
2 | ===
3 | ( 0 ) [Accessor]
4 | BufferView : 0
5 | ByteOffset : 0
6 | ComponentType : UNSIGNED_SHORT
7 | Normalized : False
8 | Count : 36
9 | Type : SCALAR
10 | Max : System.Single[]
11 | ===
12 | ( 0 ) '23'
13 | Min : System.Single[]
14 | ===
15 | ( 0 ) '0'
16 | ( 1 ) [Accessor]
17 | BufferView : 1
18 | ByteOffset : 0
19 | ComponentType : FLOAT
20 | Normalized : False
21 | Count : 24
22 | Type : VEC3
23 | Max : System.Single[]
24 | ===
25 | ( 0 ) '1'
26 | ( 1 ) '1'
27 | ( 2 ) '1'
28 | Min : System.Single[]
29 | ===
30 | ( 0 ) '-1'
31 | ( 1 ) '-1'
32 | ( 2 ) '-1'
33 | ( 2 ) [Accessor]
34 | BufferView : 1
35 | ByteOffset : 288
36 | ComponentType : FLOAT
37 | Normalized : False
38 | Count : 24
39 | Type : VEC3
40 | Max : System.Single[]
41 | ===
42 | ( 0 ) '4'
43 | ( 1 ) '0.25'
44 | ( 2 ) '3'
45 | Min : System.Single[]
46 | ===
47 | ( 0 ) '0'
48 | ( 1 ) '-0.25'
49 | ( 2 ) '0'
50 | Asset : glTFLoader.Schema.Asset
51 | Generator : COLLADA2GLTF
52 | Version : 2.0
53 | Buffers : glTFLoader.Schema.Buffer[]
54 | ===
55 | ( 0 ) [Buffer]
56 | Uri : data:application/octet-stream;base64,AAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AACAQAAAgD4AAEBAAACAQAAAgD4AAAAAAAAAAAAAgD4AAAAAAAAAAAAAgD4AAEBAAAAAAAAAgL4AAEBAAAAAAAAAgD4AAEBAAAAAAAAAgD4AAAAAAAAAAAAAgL4AAAAAAAAAAAAAgL4AAEBAAAAAAAAAgL4AAAAAAACAQAAAgL4AAEBAAACAQAAAgL4AAAAAAACAQAAAgD4AAEBAAACAQAAAgL4AAEBAAACAQAAAgL4AAAAAAACAQAAAgD4AAAAAAAAAAAAAgL4AAAAAAACAQAAAgD4AAAAAAACAQAAAgL4AAAAAAAAAAAAAgD4AAAAAAACAQAAAgL4AAEBAAACAQAAAgD4AAEBAAAAAAAAAgL4AAEBAAAAAAAAAgD4AAEBAAAABAAIAAwAAAAIABAAFAAYABAAGAAcACAAJAAoACgAJAAsADAANAA4ADAAOAA8AEAARABIAEwARABAAFAAVABYAFgAVABcA
57 | ByteLength : 648
58 | BufferViews : glTFLoader.Schema.BufferView[]
59 | ===
60 | ( 0 ) [BufferView]
61 | Buffer : 0
62 | ByteOffset : 576
63 | ByteLength : 72
64 | Target : ELEMENT_ARRAY_BUFFER
65 | ( 1 ) [BufferView]
66 | Buffer : 0
67 | ByteOffset : 0
68 | ByteLength : 576
69 | ByteStride : 12
70 | Target : ARRAY_BUFFER
71 | Materials : glTFLoader.Schema.Material[]
72 | ===
73 | ( 0 ) [Material]
74 | Name : 138_BrickCommon-fx
75 | PbrMetallicRoughness : glTFLoader.Schema.MaterialPbrMetallicRoughness
76 | BaseColorFactor : System.Single[]
77 | ===
78 | ( 0 ) '0.6666667'
79 | ( 1 ) '0.3921569'
80 | ( 2 ) '0.4117647'
81 | ( 3 ) '1'
82 | MetallicFactor : 0
83 | RoughnessFactor : 1
84 | EmissiveFactor : System.Single[]
85 | ===
86 | ( 0 ) '0'
87 | ( 1 ) '0'
88 | ( 2 ) '0'
89 | AlphaMode : OPAQUE
90 | AlphaCutoff : 0.5
91 | DoubleSided : False
92 | Meshes : glTFLoader.Schema.Mesh[]
93 | ===
94 | ( 0 ) [Mesh]
95 | Primitives : glTFLoader.Schema.MeshPrimitive[]
96 | ===
97 | ( 0 ) [MeshPrimitive]
98 | Attributes : System.Collections.Generic.Dictionary`2[System.String,System.Int32]
99 | ===
100 | ( 0 ) [KeyValuePair`2]
101 | Key : NORMAL
102 | Value : 1 (accessor)
103 | ( 1 ) [KeyValuePair`2]
104 | Key : POSITION
105 | Value : 2 (accessor)
106 | Indices : 0 (accessor)
107 | Material : 0
108 | Mode : TRIANGLES
109 | Name : 152_BasicWallWallExt_215Bwk285815
110 | Nodes : glTFLoader.Schema.Node[]
111 | ===
112 | ( 0 ) [Node]
113 | Children : System.Int32[]
114 | ===
115 | ( 0 ) '1'
116 | Matrix : System.Single[]
117 | ===
118 | 1 0 0 0
119 | 0 0 -1 0
120 | 0 1 0 0
121 | 0 0 0 1
122 | Rotation : System.Single[]
123 | ===
124 | ( 0 ) '0'
125 | ( 1 ) '0'
126 | ( 2 ) '0'
127 | ( 3 ) '1'
128 | Scale : System.Single[]
129 | ===
130 | ( 0 ) '1'
131 | ( 1 ) '1'
132 | ( 2 ) '1'
133 | Translation : System.Single[]
134 | ===
135 | ( 0 ) '0'
136 | ( 1 ) '0'
137 | ( 2 ) '0'
138 | Name : Z_UP
139 | ( 1 ) [Node]
140 | Matrix : System.Single[]
141 | ===
142 | 1 0 0 0
143 | 0 1 0 0
144 | 0 0 1 0
145 | 0 0.25 0 1
146 | Mesh : 0
147 | Rotation : System.Single[]
148 | ===
149 | ( 0 ) '0'
150 | ( 1 ) '0'
151 | ( 2 ) '0'
152 | ( 3 ) '1'
153 | Scale : System.Single[]
154 | ===
155 | ( 0 ) '1'
156 | ( 1 ) '1'
157 | ( 2 ) '1'
158 | Translation : System.Single[]
159 | ===
160 | ( 0 ) '0'
161 | ( 1 ) '0'
162 | ( 2 ) '0'
163 | Name : 152_BasicWallWallExt_215Bwk285815
164 | Scene : 0
165 | Scenes : glTFLoader.Schema.Scene[]
166 | ===
167 | ( 0 ) [Scene]
168 | Nodes : System.Int32[]
169 | ===
170 | ( 0 ) '0'
171 |
172 |
--------------------------------------------------------------------------------
/Resources/OneWall.gltf:
--------------------------------------------------------------------------------
1 | {
2 | "asset": {
3 | "generator": "COLLADA2GLTF",
4 | "version": "2.0"
5 | },
6 | "scenes": [
7 | {
8 | "nodes": [
9 | 0
10 | ]
11 | }
12 | ],
13 | "scene": 0,
14 | "nodes": [
15 | {
16 | "children": [
17 | 1
18 | ],
19 | "matrix": [
20 | 1.0,
21 | 0.0,
22 | 0.0,
23 | 0.0,
24 | 0.0,
25 | 0.0,
26 | -1.0,
27 | 0.0,
28 | 0.0,
29 | 1.0,
30 | 0.0,
31 | 0.0,
32 | 0.0,
33 | 0.0,
34 | 0.0,
35 | 1.0
36 | ],
37 | "name": "Z_UP"
38 | },
39 | {
40 | "mesh": 0,
41 | "matrix": [
42 | 1.0,
43 | 0.0,
44 | 0.0,
45 | 0.0,
46 | 0.0,
47 | 1.0,
48 | 0.0,
49 | 0.0,
50 | 0.0,
51 | 0.0,
52 | 1.0,
53 | 0.0,
54 | 0.0,
55 | 0.25,
56 | 0.0,
57 | 1.0
58 | ],
59 | "name": "152_BasicWallWallExt_215Bwk285815"
60 | }
61 | ],
62 | "meshes": [
63 | {
64 | "primitives": [
65 | {
66 | "attributes": {
67 | "NORMAL": 1,
68 | "POSITION": 2
69 | },
70 | "indices": 0,
71 | "mode": 4,
72 | "material": 0
73 | }
74 | ],
75 | "name": "152_BasicWallWallExt_215Bwk285815"
76 | }
77 | ],
78 | "accessors": [
79 | {
80 | "bufferView": 0,
81 | "byteOffset": 0,
82 | "componentType": 5123,
83 | "count": 36,
84 | "max": [
85 | 23
86 | ],
87 | "min": [
88 | 0
89 | ],
90 | "type": "SCALAR"
91 | },
92 | {
93 | "bufferView": 1,
94 | "byteOffset": 0,
95 | "componentType": 5126,
96 | "count": 24,
97 | "max": [
98 | 1.0,
99 | 1.0,
100 | 1.0
101 | ],
102 | "min": [
103 | -1.0,
104 | -1.0,
105 | -1.0
106 | ],
107 | "type": "VEC3"
108 | },
109 | {
110 | "bufferView": 1,
111 | "byteOffset": 288,
112 | "componentType": 5126,
113 | "count": 24,
114 | "max": [
115 | 4.0,
116 | 0.25,
117 | 3.0
118 | ],
119 | "min": [
120 | 0.0,
121 | -0.25,
122 | 0.0
123 | ],
124 | "type": "VEC3"
125 | }
126 | ],
127 | "materials": [
128 | {
129 | "pbrMetallicRoughness": {
130 | "baseColorFactor": [
131 | 0.6666666865348816,
132 | 0.3921568989753723,
133 | 0.4117647111415863,
134 | 1.0
135 | ],
136 | "metallicFactor": 0.0
137 | },
138 | "name": "138_BrickCommon-fx"
139 | }
140 | ],
141 | "bufferViews": [
142 | {
143 | "buffer": 0,
144 | "byteOffset": 576,
145 | "byteLength": 72,
146 | "target": 34963
147 | },
148 | {
149 | "buffer": 0,
150 | "byteOffset": 0,
151 | "byteLength": 576,
152 | "byteStride": 12,
153 | "target": 34962
154 | }
155 | ],
156 | "buffers": [
157 | {
158 | "byteLength": 648,
159 | "uri": "data:application/octet-stream;base64,AAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AACAQAAAgD4AAEBAAACAQAAAgD4AAAAAAAAAAAAAgD4AAAAAAAAAAAAAgD4AAEBAAAAAAAAAgL4AAEBAAAAAAAAAgD4AAEBAAAAAAAAAgD4AAAAAAAAAAAAAgL4AAAAAAAAAAAAAgL4AAEBAAAAAAAAAgL4AAAAAAACAQAAAgL4AAEBAAACAQAAAgL4AAAAAAACAQAAAgD4AAEBAAACAQAAAgL4AAEBAAACAQAAAgL4AAAAAAACAQAAAgD4AAAAAAAAAAAAAgL4AAAAAAACAQAAAgD4AAAAAAACAQAAAgL4AAAAAAAAAAAAAgD4AAAAAAACAQAAAgL4AAEBAAACAQAAAgD4AAEBAAAAAAAAAgL4AAEBAAAAAAAAAgD4AAEBAAAABAAIAAwAAAAIABAAFAAYABAAGAAcACAAJAAoACgAJAAsADAANAA4ADAAOAA8AEAARABIAEwARABAAFAAVABYAFgAVABcA"
160 | }
161 | ]
162 | }
163 |
--------------------------------------------------------------------------------
/Xbim.GLTF.IO/XbimMesher.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.IO;
3 | using Xbim.Common.Geometry;
4 | using Xbim.Common.XbimExtensions;
5 |
6 | namespace Xbim.Geom
7 | {
8 | class XbimMesher
9 | {
10 | internal List Positions = new List();
11 | internal List Normals = new List();
12 | internal List Indices = new List();
13 |
14 | internal List PositionsAsDoubleList(double divider)
15 | {
16 | List ret = new List();
17 | foreach (var pos in Positions)
18 | {
19 | ret.Add(pos.X / divider);
20 | ret.Add(pos.Y / divider);
21 | ret.Add(pos.Z / divider);
22 | }
23 | return ret;
24 | }
25 |
26 | internal List PositionsAsSingleList(double divider)
27 | {
28 | List ret = new List();
29 | foreach (var pos in Positions)
30 | {
31 | ret.Add((float)(pos.X / divider));
32 | ret.Add((float)(pos.Y / divider));
33 | ret.Add((float)(pos.Z / divider));
34 | }
35 | return ret;
36 | }
37 |
38 |
39 | internal List NormalsAsDoubleList()
40 | {
41 | List ret = new List();
42 | foreach (var nrm in Normals)
43 | {
44 | ret.Add(nrm.X);
45 | ret.Add(nrm.Y);
46 | ret.Add(nrm.Z);
47 | }
48 | return ret;
49 | }
50 |
51 | internal List NormalsAsSingleList()
52 | {
53 | List ret = new List();
54 | foreach (var nrm in Normals)
55 | {
56 | ret.Add((float)nrm.X);
57 | ret.Add((float)nrm.Y);
58 | ret.Add((float)nrm.Z);
59 | }
60 | return ret;
61 | }
62 |
63 | public enum CoordinatesMode {
64 | IncludeShapeTransform,
65 | IgnoreShapeTransform
66 | }
67 |
68 | internal void AddShape(IGeometryStoreReader geomReader, XbimShapeInstance shapeInstance, CoordinatesMode mode)
69 | {
70 | // XbimMatrix3D modelTransform = XbimMatrix3D.Identity;
71 | IXbimShapeGeometryData shapeGeom = geomReader.ShapeGeometry(shapeInstance.ShapeGeometryLabel);
72 | if (shapeGeom.Format != (byte)XbimGeometryType.PolyhedronBinary)
73 | return;
74 | // var transform = XbimMatrix3D.Multiply(, modelTransform);
75 | if (mode == CoordinatesMode.IncludeShapeTransform)
76 | AddMesh(shapeGeom.ShapeData, shapeInstance.Transformation);
77 | else
78 | AddMesh(shapeGeom.ShapeData);
79 | }
80 |
81 | internal void AddMesh(byte[] mesh, XbimMatrix3D? transform = null)
82 | {
83 | int indexBase = Positions.Count;
84 | bool needRotate = false;
85 | bool needTransform = false;
86 | XbimQuaternion xq = new XbimQuaternion(0.0, 0.0, 0.0, 1.0);
87 | XbimMatrix3D transformValue = XbimMatrix3D.Identity;
88 |
89 | if (transform.HasValue)
90 | {
91 | transformValue = transform.Value;
92 | needTransform = !transformValue.IsIdentity;
93 | xq = transformValue.GetRotationQuaternion();
94 | // we have to build a rotation transform from the quaternion (to tranform normals later on)
95 | needRotate = !xq.IsIdentity();
96 | }
97 | using (var ms = new MemoryStream(mesh))
98 | using (var br = new BinaryReader(ms))
99 | {
100 | var t = br.ReadShapeTriangulation();
101 | List pts;
102 | List idx;
103 | t.ToPointsWithNormalsAndIndices(out pts, out idx);
104 |
105 | // add to lists
106 | //
107 | // Commented because of https://github.com/xBimTeam/XbimGltf/issues/2
108 | //Positions.Capacity += pts.Count;
109 | //Normals.Capacity += pts.Count;
110 | //Indices.Capacity += idx.Count;
111 | foreach (var floatsArray in pts)
112 | {
113 | var tmpPosition = new XbimPoint3D(floatsArray[0], floatsArray[1], floatsArray[2]);
114 | if (needTransform)
115 | tmpPosition = transformValue.Transform(tmpPosition);
116 | Positions.Add(tmpPosition);
117 |
118 | var tmpNormal = new XbimVector3D(floatsArray[3], floatsArray[4], floatsArray[5]);
119 | if (needRotate) //transform the normal if we have to
120 | XbimQuaternion.Transform(ref tmpNormal, ref xq, out tmpNormal);
121 | Normals.Add(tmpNormal);
122 | }
123 | foreach (var index in idx)
124 | {
125 | Indices.Add(index + indexBase);
126 | }
127 | }
128 | }
129 | }
130 | }
131 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | project.fragment.lock.json
46 | artifacts/
47 |
48 | *_i.c
49 | *_p.c
50 | *_i.h
51 | *.ilk
52 | *.meta
53 | *.obj
54 | *.pch
55 | *.pdb
56 | *.pgc
57 | *.pgd
58 | *.rsp
59 | *.sbr
60 | *.tlb
61 | *.tli
62 | *.tlh
63 | *.tmp
64 | *.tmp_proj
65 | *.log
66 | *.vspscc
67 | *.vssscc
68 | .builds
69 | *.pidb
70 | *.svclog
71 | *.scc
72 |
73 | # Chutzpah Test files
74 | _Chutzpah*
75 |
76 | # Visual C++ cache files
77 | ipch/
78 | *.aps
79 | *.ncb
80 | *.opendb
81 | *.opensdf
82 | *.sdf
83 | *.cachefile
84 | *.VC.db
85 | *.VC.VC.opendb
86 |
87 | # Visual Studio profiler
88 | *.psess
89 | *.vsp
90 | *.vspx
91 | *.sap
92 |
93 | # TFS 2012 Local Workspace
94 | $tf/
95 |
96 | # Guidance Automation Toolkit
97 | *.gpState
98 |
99 | # ReSharper is a .NET coding add-in
100 | _ReSharper*/
101 | *.[Rr]e[Ss]harper
102 | *.DotSettings.user
103 |
104 | # JustCode is a .NET coding add-in
105 | .JustCode
106 |
107 | # TeamCity is a build add-in
108 | _TeamCity*
109 |
110 | # DotCover is a Code Coverage Tool
111 | *.dotCover
112 |
113 | # NCrunch
114 | _NCrunch_*
115 | .*crunch*.local.xml
116 | nCrunchTemp_*
117 |
118 | # MightyMoose
119 | *.mm.*
120 | AutoTest.Net/
121 |
122 | # Web workbench (sass)
123 | .sass-cache/
124 |
125 | # Installshield output folder
126 | [Ee]xpress/
127 |
128 | # DocProject is a documentation generator add-in
129 | DocProject/buildhelp/
130 | DocProject/Help/*.HxT
131 | DocProject/Help/*.HxC
132 | DocProject/Help/*.hhc
133 | DocProject/Help/*.hhk
134 | DocProject/Help/*.hhp
135 | DocProject/Help/Html2
136 | DocProject/Help/html
137 |
138 | # Click-Once directory
139 | publish/
140 |
141 | # Publish Web Output
142 | *.[Pp]ublish.xml
143 | *.azurePubxml
144 | # TODO: Comment the next line if you want to checkin your web deploy settings
145 | # but database connection strings (with potential passwords) will be unencrypted
146 | #*.pubxml
147 | *.publishproj
148 |
149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
150 | # checkin your Azure Web App publish settings, but sensitive information contained
151 | # in these scripts will be unencrypted
152 | PublishScripts/
153 |
154 | # NuGet Packages
155 | *.nupkg
156 | # The packages folder can be ignored because of Package Restore
157 | **/packages/*
158 | # except build/, which is used as an MSBuild target.
159 | !**/packages/build/
160 | # Uncomment if necessary however generally it will be regenerated when needed
161 | #!**/packages/repositories.config
162 | # NuGet v3's project.json files produces more ignoreable files
163 | *.nuget.props
164 | *.nuget.targets
165 |
166 | # Microsoft Azure Build Output
167 | csx/
168 | *.build.csdef
169 |
170 | # Microsoft Azure Emulator
171 | ecf/
172 | rcf/
173 |
174 | # Windows Store app package directories and files
175 | AppPackages/
176 | BundleArtifacts/
177 | Package.StoreAssociation.xml
178 | _pkginfo.txt
179 |
180 | # Visual Studio cache files
181 | # files ending in .cache can be ignored
182 | *.[Cc]ache
183 | # but keep track of directories ending in .cache
184 | !*.[Cc]ache/
185 |
186 | # Others
187 | ClientBin/
188 | ~$*
189 | *~
190 | *.dbmdl
191 | *.dbproj.schemaview
192 | *.jfm
193 | *.pfx
194 | *.publishsettings
195 | node_modules/
196 | orleans.codegen.cs
197 |
198 | # Since there are multiple workflows, uncomment next line to ignore bower_components
199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
200 | #bower_components/
201 |
202 | # RIA/Silverlight projects
203 | Generated_Code/
204 |
205 | # Backup & report files from converting an old project file
206 | # to a newer Visual Studio version. Backup files are not needed,
207 | # because we have git ;-)
208 | _UpgradeReport_Files/
209 | Backup*/
210 | UpgradeLog*.XML
211 | UpgradeLog*.htm
212 |
213 | # SQL Server files
214 | *.mdf
215 | *.ldf
216 |
217 | # Business Intelligence projects
218 | *.rdl.data
219 | *.bim.layout
220 | *.bim_*.settings
221 |
222 | # Microsoft Fakes
223 | FakesAssemblies/
224 |
225 | # GhostDoc plugin setting file
226 | *.GhostDoc.xml
227 |
228 | # Node.js Tools for Visual Studio
229 | .ntvs_analysis.dat
230 |
231 | # Visual Studio 6 build log
232 | *.plg
233 |
234 | # Visual Studio 6 workspace options file
235 | *.opt
236 |
237 | # Visual Studio LightSwitch build output
238 | **/*.HTMLClient/GeneratedArtifacts
239 | **/*.DesktopClient/GeneratedArtifacts
240 | **/*.DesktopClient/ModelManifest.xml
241 | **/*.Server/GeneratedArtifacts
242 | **/*.Server/ModelManifest.xml
243 | _Pvt_Extensions
244 |
245 | # Paket dependency manager
246 | .paket/paket.exe
247 | paket-files/
248 |
249 | # FAKE - F# Make
250 | .fake/
251 |
252 | # JetBrains Rider
253 | .idea/
254 | *.sln.iml
255 |
256 | # CodeRush
257 | .cr/
258 |
259 | # Python Tools for Visual Studio (PTVS)
260 | __pycache__/
261 | *.pyc
262 | /SharedFileVersionInfo.cs
263 |
--------------------------------------------------------------------------------
/XbimPlugin.Gltf.IO/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/azure-pipelines.yml:
--------------------------------------------------------------------------------
1 | # .NET Desktop
2 | # Build and run tests for .NET Desktop or Windows classic desktop solutions.
3 | # Add steps that publish symbols, save build artifacts, and more:
4 | # https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
5 |
6 | trigger:
7 | branches:
8 | include:
9 | - master
10 | - develop
11 | paths:
12 | exclude:
13 | - README.md
14 | - CHANGELOG.md
15 | - CONTRIBUTING.md
16 |
17 | pool:
18 | vmImage: 'windows-2019'
19 |
20 | variables:
21 | buildConfiguration: 'Release'
22 | major: 5
23 | minor: 1
24 | # creates a counter called versioncounter and seeds it at 100 and then assigns the value to a variable named buildNo.
25 | buildNo: $[counter('versioncounter', 100)]
26 |
27 |
28 | name: $(BuildDefinitionName)_$(SourceBranchName)_$(major).$(minor).$(buildNo)
29 |
30 | steps:
31 | # Windows script setting up $(packageversion) of the nuget package based on branch
32 | # Master branch
33 | - script: |
34 | echo ##vso[task.setvariable variable=packageversion]$(major).$(minor).$(buildNo)
35 | displayName: 'Setting Master Nuget PackageVersion'
36 | condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
37 | - script: |
38 | echo ##vso[task.setvariable variable=packageversion]$(major).$(minor).$(buildNo)-$(Build.SourceBranchName)
39 | displayName: 'Setting Prerelease Nuget PackageVersion'
40 | condition: ne(variables['Build.SourceBranch'], 'refs/heads/master')
41 |
42 |
43 | # Windows script setting up $(fileversion) used to stamp AssemblyFileVersions.
44 | # By convention we use 'Major.Minor.BuildNo.0' on Master and 'Major.Minor.0.BuildNo' on other branches
45 | # Master branch
46 | - script: |
47 | echo ##vso[task.setvariable variable=fileversion]$(major).$(minor).$(buildNo).0
48 | displayName: 'Setting FileVersion'
49 | condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
50 | # Any other branch
51 | - script: |
52 | echo ##vso[task.setvariable variable=fileversion]$(major).$(minor).0.$(buildNo)
53 | displayName: 'Setting Prerelease FileVersion'
54 | condition: ne(variables['Build.SourceBranch'], 'refs/heads/master')
55 |
56 | - task: NuGetToolInstaller@0
57 | displayName: 'Install Nuget'
58 | inputs:
59 | versionSpec: '5.8.0' # the License element was not found in 2.164.0
60 |
61 | # Version .NET Core project files
62 | # Description - Applies a version to a .NET Core assembly via the .csproj files based on the build number.
63 | # Based on https://github.com/rfennell/AzurePipelines/wiki/Version-Assemblies-and-Packages-Tasks-YAML#versiondotnetcoreassembliestask
64 | - task: VersionDotNetCoreAssemblies@2
65 | displayName: 'Versioning netcore projects $(fileversion)'
66 | inputs:
67 | # Required arguments
68 | Path: $(Build.SourcesDirectory)
69 | VersionNumber: $(fileversion)
70 | VersionRegex: \d+\.\d+\.\d+\.\d+
71 | FilenamePattern: .csproj
72 | Field: FileVersion
73 | OutputVersion: OutputedVersion
74 |
75 | # Unit tests
76 | #- task: DotNetCoreCLI@2
77 | # displayName: 'dotnet test $(buildConfiguration)'
78 | # inputs:
79 | # command: test
80 | # projects: '**/*Tests/*.csproj'
81 | # arguments: '--configuration $(buildConfiguration) --collect "Code coverage"'
82 |
83 |
84 | # xBIM Library
85 | - script: dotnet pack Xbim.GLTF.IO/Xbim.GLTF.IO.csproj -c Release -o $(Build.BinariesDirectory) /p:PackageVersion=$(packageversion)
86 | displayName: 'Xbim.GLTF.IO - packing'
87 |
88 |
89 | # Copy artifacts and Publish
90 | - task: CopyFiles@2
91 | displayName: 'Copy to artifacts'
92 | inputs:
93 | sourceFolder: '$(Build.BinariesDirectory)'
94 | contents: '**\*.nupkg'
95 | targetFolder: '$(build.artifactstagingdirectory)'
96 | cleanTargetFolder: true
97 |
98 | # Publish to master or develop MyGet feed based on the source branch
99 | - task: NuGetCommand@2
100 | displayName: 'Publish to MyGet Master'
101 | condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
102 | inputs:
103 | command: push
104 | nuGetFeedType: external
105 | publishFeedCredentials: 'MyGetMaster'
106 | versioningScheme: byEnvVar
107 | versionEnvVar: packageversion
108 |
109 | - task: NuGetCommand@2
110 | displayName: 'Publish to MyGet Develop'
111 | condition: eq(variables['Build.SourceBranch'], 'refs/heads/develop')
112 | inputs:
113 | command: push
114 | nuGetFeedType: external
115 | publishFeedCredentials: 'MyGetDev'
116 | versioningScheme: byEnvVar
117 | versionEnvVar: packageversion
118 |
119 | ## ___ _ _
120 | ## | _ \ |_ _ __ _(_)_ _
121 | ## | _/ | || / _` | | ' \
122 | ## |_| |_|\_,_\__, |_|_||_|
123 | ## |___/
124 | ##
125 | ## Plugin preparation and publishing
126 |
127 | # nuget restore sln
128 | - task: NuGetCommand@2
129 | displayName: 'Plugin - NuGet restore solution'
130 | inputs:
131 | restoreSolution: '*.sln'
132 | feedsToUse: config
133 | nugetConfigPath: 'nuget.config'
134 |
135 | # build
136 | - task: VSBuild@1
137 | displayName: 'Plugin - Build solution'
138 | inputs:
139 | solution: '*.sln' # the plugin project alone does not build.
140 | msbuildArgs: '/t:build'
141 | platform: 'Any CPU'
142 | configuration: '$(BuildConfiguration)'
143 |
144 | # Pack XplorerPlugin.Bcf with nuget and nuspec.
145 | - task: NuGetCommand@2
146 | displayName: 'Plugin - NuGet pack'
147 | inputs:
148 | command: pack
149 | packagesToPack: 'XbimPlugin.Gltf.nuspec'
150 | configuration: $(BuildConfiguration)
151 | versioningScheme: byEnvVar
152 | versionEnvVar: packageversion
153 |
154 | # Publish plugin to custom myget service connection.
155 | - task: NuGetCommand@2
156 | displayName: 'Plugin - NuGet publish'
157 | inputs:
158 | command: push
159 | nuGetFeedType: external
160 | publishFeedCredentials: 'MyGetPlugins'
161 | packagesToPush: '$(Build.ArtifactStagingDirectory)/**/XbimPlugin.*.nupkg;' # Required when command == Push
162 | versioningScheme: byEnvVar
163 | versionEnvVar: version
164 |
165 | - task: PublishBuildArtifacts@1
166 | displayName: 'Publish artifacts'
167 |
--------------------------------------------------------------------------------
/Resources/OneWall.ifc:
--------------------------------------------------------------------------------
1 | ISO-10303-21;
2 | HEADER;
3 | FILE_DESCRIPTION (('ViewDefinition [CoordinationView_V2.0]'), '2;1');
4 | FILE_NAME ('Project Number', '2014-12-02T09:14:04', (''), (''), 'The EXPRESS Data Manager Version 5.02.0100.07 : 28 Aug 2013', '20140606_1530(x64) - Exporter 2015.0.2014.0606 - Default UI', '');
5 | FILE_SCHEMA (('IFC2X3'));
6 | ENDSEC;
7 | DATA;
8 | #1=IFCORGANIZATION($,'Autodesk Revit 2015 (ENU)',$,$,$);
9 | #5=IFCAPPLICATION(#1,'2015','Autodesk Revit 2015 (ENU)','Revit');
10 | #6=IFCCARTESIANPOINT((0.,0.,0.));
11 | #9=IFCCARTESIANPOINT((0.,0.));
12 | #11=IFCDIRECTION((1.,0.,0.));
13 | #13=IFCDIRECTION((-1.,0.,0.));
14 | #15=IFCDIRECTION((0.,1.,0.));
15 | #17=IFCDIRECTION((0.,-1.,0.));
16 | #19=IFCDIRECTION((0.,0.,1.));
17 | #21=IFCDIRECTION((0.,0.,-1.));
18 | #23=IFCDIRECTION((1.,0.));
19 | #25=IFCDIRECTION((-1.,0.));
20 | #27=IFCDIRECTION((0.,1.));
21 | #29=IFCDIRECTION((0.,-1.));
22 | #31=IFCAXIS2PLACEMENT3D(#6,$,$);
23 | #32=IFCLOCALPLACEMENT(#199,#31);
24 | #35=IFCPERSON($,'','Martin',$,$,$,$,$);
25 | #37=IFCORGANIZATION($,'','',$,$);
26 | #38=IFCPERSONANDORGANIZATION(#35,#37,$);
27 | #41=IFCOWNERHISTORY(#38,#5,$,.NOCHANGE.,$,$,$,0);
28 | #42=IFCSIUNIT(*,.LENGTHUNIT.,.MILLI.,.METRE.);
29 | #43=IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);
30 | #44=IFCSIUNIT(*,.AREAUNIT.,$,.SQUARE_METRE.);
31 | #45=IFCSIUNIT(*,.VOLUMEUNIT.,$,.CUBIC_METRE.);
32 | #46=IFCSIUNIT(*,.PLANEANGLEUNIT.,$,.RADIAN.);
33 | #47=IFCDIMENSIONALEXPONENTS(0,0,0,0,0,0,0);
34 | #48=IFCMEASUREWITHUNIT(IFCRATIOMEASURE(0.0174532925199433),#46);
35 | #49=IFCCONVERSIONBASEDUNIT(#47,.PLANEANGLEUNIT.,'DEGREE',#48);
36 | #50=IFCSIUNIT(*,.MASSUNIT.,.KILO.,.GRAM.);
37 | #51=IFCSIUNIT(*,.TIMEUNIT.,$,.SECOND.);
38 | #52=IFCSIUNIT(*,.FREQUENCYUNIT.,$,.HERTZ.);
39 | #53=IFCSIUNIT(*,.THERMODYNAMICTEMPERATUREUNIT.,$,.KELVIN.);
40 | #54=IFCSIUNIT(*,.THERMODYNAMICTEMPERATUREUNIT.,$,.DEGREE_CELSIUS.);
41 | #55=IFCDERIVEDUNITELEMENT(#50,1);
42 | #56=IFCDERIVEDUNITELEMENT(#53,-1);
43 | #57=IFCDERIVEDUNITELEMENT(#51,-3);
44 | #58=IFCDERIVEDUNIT((#55,#56,#57),.THERMALTRANSMITTANCEUNIT.,$);
45 | #60=IFCDERIVEDUNITELEMENT(#43,3);
46 | #61=IFCDERIVEDUNITELEMENT(#51,-1);
47 | #62=IFCDERIVEDUNIT((#60,#61),.VOLUMETRICFLOWRATEUNIT.,$);
48 | #64=IFCSIUNIT(*,.ELECTRICCURRENTUNIT.,$,.AMPERE.);
49 | #65=IFCSIUNIT(*,.ELECTRICVOLTAGEUNIT.,$,.VOLT.);
50 | #66=IFCSIUNIT(*,.POWERUNIT.,$,.WATT.);
51 | #67=IFCSIUNIT(*,.FORCEUNIT.,.KILO.,.NEWTON.);
52 | #68=IFCSIUNIT(*,.ILLUMINANCEUNIT.,$,.LUX.);
53 | #69=IFCSIUNIT(*,.LUMINOUSFLUXUNIT.,$,.LUMEN.);
54 | #70=IFCSIUNIT(*,.LUMINOUSINTENSITYUNIT.,$,.CANDELA.);
55 | #71=IFCDERIVEDUNITELEMENT(#50,-1);
56 | #72=IFCDERIVEDUNITELEMENT(#43,-2);
57 | #73=IFCDERIVEDUNITELEMENT(#51,3);
58 | #74=IFCDERIVEDUNITELEMENT(#69,1);
59 | #75=IFCDERIVEDUNIT((#71,#72,#73,#74),.USERDEFINED.,'Luminous Efficacy');
60 | #77=IFCSIUNIT(*,.PRESSUREUNIT.,$,.PASCAL.);
61 | #78=IFCUNITASSIGNMENT((#42,#44,#45,#49,#50,#51,#52,#54,#58,#62,#64,#65,#66,#67,#68,#69,#70,#77));
62 | #80=IFCAXIS2PLACEMENT3D(#6,$,$);
63 | #81=IFCDIRECTION((0.,1.));
64 | #83=IFCGEOMETRICREPRESENTATIONCONTEXT($,'Model',3,0.01,#80,#81);
65 | #86=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Axis','Model',*,*,*,*,#83,$,.GRAPH_VIEW.,$);
66 | #88=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Body','Model',*,*,*,*,#83,$,.MODEL_VIEW.,$);
67 | #89=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Box','Model',*,*,*,*,#83,$,.MODEL_VIEW.,$);
68 | #90=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('FootPrint','Model',*,*,*,*,#83,$,.MODEL_VIEW.,$);
69 | #91=IFCPROJECT('31ptf8OJb33wJRC2Iz4E_X',#41,'Project Number',$,$,'Project Name','Project Status',(#83),#78);
70 | #97=IFCPOSTALADDRESS($,$,$,$,('Enter address here'),$,'Westminster','London','','UK');
71 | #101=IFCBUILDING('31ptf8OJb33wJRC2Iz4E_W',#41,'',$,$,#32,$,'',.ELEMENT.,$,$,#97);
72 | #107=IFCAXIS2PLACEMENT3D(#6,$,$);
73 | #108=IFCLOCALPLACEMENT(#32,#107);
74 | #110=IFCBUILDINGSTOREY('31ptf8OJb33wJRC2H2xn5c',#41,'Level 0',$,$,#108,$,'Level 0',.ELEMENT.,0.);
75 | #112=IFCCARTESIANPOINT((0.,0.,4000.));
76 | #114=IFCAXIS2PLACEMENT3D(#112,$,$);
77 | #241=IFCRELDEFINESBYTYPE('2wcJeBhvPETwHWBqcl6BGk',#41,$,$,(#152),#180);
78 | #212=IFCRELCONTAINEDINSPATIALSTRUCTURE('3Zu5Bv0LOHrPC10066FoQQ',#41,$,$,(#152),#110);
79 | #118=IFCCARTESIANPOINT((0.,250.,0.));
80 | #120=IFCAXIS2PLACEMENT3D(#118,$,$);
81 | #121=IFCLOCALPLACEMENT(#108,#120);
82 | #123=IFCCARTESIANPOINT((4000.,0.));
83 | #125=IFCPOLYLINE((#9,#123));
84 | #127=IFCSHAPEREPRESENTATION(#86,'Axis','Curve2D',(#125));
85 | #130=IFCCARTESIANPOINT((2000.,0.));
86 | #132=IFCAXIS2PLACEMENT2D(#130,#25);
87 | #133=IFCRECTANGLEPROFILEDEF(.AREA.,$,#132,4000.,500.);
88 | #134=IFCAXIS2PLACEMENT3D(#6,$,$);
89 | #135=IFCEXTRUDEDAREASOLID(#133,#134,#19,3000.);
90 | #136=IFCCOLOURRGB($,0.666666666666667,0.392156862745098,0.411764705882353);
91 | #137=IFCSURFACESTYLERENDERING(#136,0.,$,$,$,$,IFCNORMALISEDRATIOMEASURE(0.5),IFCSPECULAREXPONENT(128.),.NOTDEFINED.);
92 | #138=IFCSURFACESTYLE('Brick, Common',.BOTH.,(#137));
93 | #140=IFCPRESENTATIONSTYLEASSIGNMENT((#138));
94 | #142=IFCSTYLEDITEM(#135,(#140),$);
95 | #145=IFCSHAPEREPRESENTATION(#88,'Body','SweptSolid',(#135));
96 | #148=IFCPRODUCTDEFINITIONSHAPE($,$,(#127,#145));
97 | #152=IFCWALLSTANDARDCASE('03DRS5e1bCjww6nJOJX0b5',#41,'Basic Wall:Wall-Ext_215Bwk:285815',$,'Basic Wall:Wall-Ext_215Bwk:45410',#121,#148,'285815');
98 | #161=IFCMATERIAL('Brick, Common');
99 | #164=IFCPRESENTATIONSTYLEASSIGNMENT((#138));
100 | #166=IFCSTYLEDITEM($,(#164),$);
101 | #168=IFCSTYLEDREPRESENTATION(#83,'Style','Material',(#166));
102 | #171=IFCMATERIALDEFINITIONREPRESENTATION($,$,(#168),#161);
103 | #174=IFCMATERIALLAYER(#161,500.,$);
104 | #176=IFCMATERIALLAYERSET((#174),'Basic Wall:Wall-Ext_215Bwk');
105 | #179=IFCMATERIALLAYERSETUSAGE(#176,.AXIS2.,.NEGATIVE.,250.);
106 | #180=IFCWALLTYPE('2ru7YPT4T9MuTpOS4FRzxe',#41,'Basic Wall:Wall-Ext_215Bwk',$,$,$,$,'45410',$,.STANDARD.);
107 | #182=IFCPROPERTYSINGLEVALUE('Reference',$,IFCIDENTIFIER('Wall-Ext_215Bwk'),$);
108 | #183=IFCPROPERTYSINGLEVALUE('LoadBearing',$,IFCBOOLEAN(.F.),$);
109 | #184=IFCPROPERTYSINGLEVALUE('ExtendToStructure',$,IFCBOOLEAN(.F.),$);
110 | #185=IFCPROPERTYSINGLEVALUE('IsExternal',$,IFCBOOLEAN(.T.),$);
111 | #186=IFCPROPERTYSINGLEVALUE('ThermalTransmittance',$,IFCTHERMALTRANSMITTANCEMEASURE(1.08),$);
112 | #187=IFCPROPERTYSET('03DRS5e1bCjww6piiJX0b5',#41,'Pset_WallCommon',$,(#182,#183,#184,#185,#186));
113 | #192=IFCRELDEFINESBYPROPERTIES('0beRqvHqD4RuhGIxQ3pWv$',#41,$,$,(#152),#187);
114 | #196=IFCCLASSIFICATION('http://www.csiorg.net/uniformat','1998',$,'Uniformat');
115 | #198=IFCAXIS2PLACEMENT3D(#6,$,$);
116 | #199=IFCLOCALPLACEMENT($,#198);
117 | #200=IFCSITE('31ptf8OJb33wJRC2Iz4E_Z',#41,'Default',$,'',#199,$,$,.ELEMENT.,(51,30,0,549316),(0,-7,-34,-450321),0.,$,$);
118 | #205=IFCPROPERTYSINGLEVALUE('AboveGround',$,IFCLOGICAL(.U.),$);
119 | #206=IFCPROPERTYSET('3Zu5Bv0LOHrPC12_o6FoQQ',#41,'Pset_BuildingStoreyCommon',$,(#205));
120 | #208=IFCRELDEFINESBYPROPERTIES('1lJBg5bb1AigxlVRKJp8$U',#41,$,$,(#110),#206);
121 | #216=IFCRELAGGREGATES('3CWutKJ3DDkgTu65OnRBTy',#41,$,$,#91,(#200));
122 | #220=IFCRELAGGREGATES('1bB2YuzqH4c9O8mlJdaP2m',#41,$,$,#200,(#101));
123 | #224=IFCRELAGGREGATES('2$1LAsj$T3CPRLiPj39tWH',#41,$,$,#101,(#110));
124 | #228=IFCPROPERTYSINGLEVALUE('NumberOfStoreys',$,IFCINTEGER(1),$);
125 | #229=IFCPROPERTYSET('2$1LAsj$T3CPRLkdD39tWH',#41,'Pset_BuildingCommon',$,(#228));
126 | #231=IFCRELDEFINESBYPROPERTIES('0uwNsMAz96pxei$qI1ZCpE',#41,$,$,(#101),#229);
127 | #235=IFCRELASSOCIATESMATERIAL('1QVxhUrCz82QNbqhxQPpyR',#41,$,$,(#152),#179);
128 | #238=IFCRELASSOCIATESMATERIAL('2NAMWINaP3DAyX2i1ZD4_v',#41,$,$,(#180),#176);
129 | #244=IFCPRESENTATIONLAYERASSIGNMENT('A-WALL-____-OTLN',$,(#127,#145),$);
130 | ENDSEC;
131 | END-ISO-10303-21;
132 |
--------------------------------------------------------------------------------
/Resources/TwoWallsTwoColour.gltf:
--------------------------------------------------------------------------------
1 | {
2 | "asset": {
3 | "generator": "COLLADA2GLTF",
4 | "version": "2.0"
5 | },
6 | "scenes": [
7 | {
8 | "nodes": [
9 | 0
10 | ]
11 | }
12 | ],
13 | "scene": 0,
14 | "nodes": [
15 | {
16 | "children": [
17 | 2,
18 | 1
19 | ],
20 | "matrix": [
21 | 1.0,
22 | 0.0,
23 | 0.0,
24 | 0.0,
25 | 0.0,
26 | 0.0,
27 | -1.0,
28 | 0.0,
29 | 0.0,
30 | 1.0,
31 | 0.0,
32 | 0.0,
33 | 0.0,
34 | 0.0,
35 | 0.0,
36 | 1.0
37 | ],
38 | "name": "Z_UP"
39 | },
40 | {
41 | "mesh": 0,
42 | "matrix": [
43 | -1.0,
44 | 0.0,
45 | 0.0,
46 | 0.0,
47 | 0.0,
48 | -1.0,
49 | 0.0,
50 | 0.0,
51 | 0.0,
52 | 0.0,
53 | 1.0,
54 | 0.0,
55 | 0.0,
56 | 0.0,
57 | 0.0,
58 | 1.0
59 | ],
60 | "name": "257_BasicWallWallExt_102Bwk50Air45Ins100DBlk12P285562"
61 | },
62 | {
63 | "mesh": 1,
64 | "name": "150_BasicWallWallExt_102Bwk75Ins100LBlk12P285345"
65 | }
66 | ],
67 | "meshes": [
68 | {
69 | "primitives": [
70 | {
71 | "attributes": {
72 | "NORMAL": 1,
73 | "POSITION": 2
74 | },
75 | "indices": 0,
76 | "mode": 4,
77 | "material": 0
78 | }
79 | ],
80 | "name": "257_BasicWallWallExt_102Bwk50Air45Ins100DBlk12P285562"
81 | },
82 | {
83 | "primitives": [
84 | {
85 | "attributes": {
86 | "NORMAL": 4,
87 | "POSITION": 5
88 | },
89 | "indices": 3,
90 | "mode": 4,
91 | "material": 1
92 | }
93 | ],
94 | "name": "150_BasicWallWallExt_102Bwk75Ins100LBlk12P285345"
95 | }
96 | ],
97 | "accessors": [
98 | {
99 | "bufferView": 0,
100 | "byteOffset": 0,
101 | "componentType": 5123,
102 | "count": 36,
103 | "max": [
104 | 23
105 | ],
106 | "min": [
107 | 0
108 | ],
109 | "type": "SCALAR"
110 | },
111 | {
112 | "bufferView": 1,
113 | "byteOffset": 0,
114 | "componentType": 5126,
115 | "count": 24,
116 | "max": [
117 | 1.0,
118 | 1.0,
119 | 1.0
120 | ],
121 | "min": [
122 | -1.0,
123 | -1.0,
124 | -1.0
125 | ],
126 | "type": "VEC3"
127 | },
128 | {
129 | "bufferView": 1,
130 | "byteOffset": 288,
131 | "componentType": 5126,
132 | "count": 24,
133 | "max": [
134 | 6.0,
135 | 0.1550000011920929,
136 | 8.0
137 | ],
138 | "min": [
139 | 0.0,
140 | -0.1550000011920929,
141 | 0.0
142 | ],
143 | "type": "VEC3"
144 | },
145 | {
146 | "bufferView": 0,
147 | "byteOffset": 72,
148 | "componentType": 5123,
149 | "count": 36,
150 | "max": [
151 | 23
152 | ],
153 | "min": [
154 | 0
155 | ],
156 | "type": "SCALAR"
157 | },
158 | {
159 | "bufferView": 1,
160 | "byteOffset": 576,
161 | "componentType": 5126,
162 | "count": 24,
163 | "max": [
164 | 1.0,
165 | 1.0,
166 | 1.0
167 | ],
168 | "min": [
169 | -1.0,
170 | -1.0,
171 | -1.0
172 | ],
173 | "type": "VEC3"
174 | },
175 | {
176 | "bufferView": 1,
177 | "byteOffset": 864,
178 | "componentType": 5126,
179 | "count": 24,
180 | "max": [
181 | 5.0,
182 | 0.1450000107288361,
183 | 8.0
184 | ],
185 | "min": [
186 | 0.0,
187 | -0.1450000107288361,
188 | 0.0
189 | ],
190 | "type": "VEC3"
191 | }
192 | ],
193 | "materials": [
194 | {
195 | "pbrMetallicRoughness": {
196 | "baseColorFactor": [
197 | 0.0,
198 | 0.0,
199 | 1.0,
200 | 1.0
201 | ],
202 | "metallicFactor": 0.0
203 | },
204 | "name": "246_BrickEngineering-fx"
205 | },
206 | {
207 | "pbrMetallicRoughness": {
208 | "baseColorFactor": [
209 | 0.3921568989753723,
210 | 1.0,
211 | 0.19607840478420256,
212 | 1.0
213 | ],
214 | "metallicFactor": 0.0
215 | },
216 | "name": "136_BrickEngineeringGrey-fx"
217 | }
218 | ],
219 | "bufferViews": [
220 | {
221 | "buffer": 0,
222 | "byteOffset": 1152,
223 | "byteLength": 144,
224 | "target": 34963
225 | },
226 | {
227 | "buffer": 0,
228 | "byteOffset": 0,
229 | "byteLength": 1152,
230 | "byteStride": 12,
231 | "target": 34962
232 | }
233 | ],
234 | "buffers": [
235 | {
236 | "byteLength": 1296,
237 | "uri": "data:application/octet-stream;base64,AAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AADAQFK4Hj4AAABBAADAQFK4Hj4AAAAAAAAAAFK4Hj4AAAAAAAAAAFK4Hj4AAABBAAAAAFK4Hj4AAABBAAAAAFK4Hj4AAAAAAAAAAFK4Hr4AAAAAAAAAAFK4Hr4AAABBAAAAAFK4Hr4AAABBAAAAAFK4Hr4AAAAAAADAQFK4Hr4AAAAAAADAQFK4Hr4AAABBAADAQFK4Hr4AAABBAADAQFK4Hr4AAAAAAADAQFK4Hj4AAAAAAADAQFK4Hj4AAABBAAAAAFK4Hj4AAAAAAADAQFK4Hr4AAAAAAAAAAFK4Hr4AAAAAAADAQFK4Hj4AAAAAAAAAAFK4Hr4AAABBAADAQFK4Hr4AAABBAAAAAFK4Hj4AAABBAADAQFK4Hj4AAABBAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AACgQOJ6FD4AAABBAACgQOJ6FD4AAAAAAAAAAOJ6FD4AAAAAAAAAAOJ6FD4AAABBAAAAAOJ6FD4AAABBAAAAAOJ6FD4AAAAAAAAAAOJ6FL4AAAAAAAAAAOJ6FL4AAABBAAAAAOJ6FL4AAABBAAAAAOJ6FL4AAAAAAACgQOJ6FL4AAAAAAACgQOJ6FL4AAABBAACgQOJ6FL4AAABBAACgQOJ6FL4AAAAAAACgQOJ6FD4AAAAAAACgQOJ6FD4AAABBAAAAAOJ6FL4AAAAAAACgQOJ6FD4AAAAAAACgQOJ6FL4AAAAAAAAAAOJ6FD4AAAAAAACgQOJ6FL4AAABBAACgQOJ6FD4AAABBAAAAAOJ6FL4AAABBAAAAAOJ6FD4AAABBAAABAAIAAwAAAAIABAAFAAYABwAEAAYACAAJAAoACwAIAAoADAANAA4ADwAMAA4AEAARABIAEAATABEAFAAVABYAFQAXABYAAAABAAIAAwAAAAIABAAFAAYABwAEAAYACAAJAAoACwAIAAoADAANAA4ADwAMAA4AEAARABIAEwARABAAFAAVABYAFgAVABcA"
238 | }
239 | ]
240 | }
241 |
--------------------------------------------------------------------------------
/Resources/TwoWallsTwoColour.txt:
--------------------------------------------------------------------------------
1 | Accessors : glTFLoader.Schema.Accessor[]
2 | ===
3 | ( 0 ) [Accessor]
4 | BufferView : 0
5 | ByteOffset : 0
6 | ComponentType : UNSIGNED_SHORT
7 | Normalized : False
8 | Count : 36
9 | Type : SCALAR
10 | Max : System.Single[]
11 | ===
12 | ( 0 ) '23'
13 | Min : System.Single[]
14 | ===
15 | ( 0 ) '0'
16 | ( 1 ) [Accessor]
17 | BufferView : 1
18 | ByteOffset : 0
19 | ComponentType : FLOAT
20 | Normalized : False
21 | Count : 24
22 | Type : VEC3
23 | Max : System.Single[]
24 | ===
25 | ( 0 ) '1'
26 | ( 1 ) '1'
27 | ( 2 ) '1'
28 | Min : System.Single[]
29 | ===
30 | ( 0 ) '-1'
31 | ( 1 ) '-1'
32 | ( 2 ) '-1'
33 | ( 2 ) [Accessor]
34 | BufferView : 1
35 | ByteOffset : 288
36 | ComponentType : FLOAT
37 | Normalized : False
38 | Count : 24
39 | Type : VEC3
40 | Max : System.Single[]
41 | ===
42 | ( 0 ) '6'
43 | ( 1 ) '0.155'
44 | ( 2 ) '8'
45 | Min : System.Single[]
46 | ===
47 | ( 0 ) '0'
48 | ( 1 ) '-0.155'
49 | ( 2 ) '0'
50 | ( 3 ) [Accessor]
51 | BufferView : 0
52 | ByteOffset : 72
53 | ComponentType : UNSIGNED_SHORT
54 | Normalized : False
55 | Count : 36
56 | Type : SCALAR
57 | Max : System.Single[]
58 | ===
59 | ( 0 ) '23'
60 | Min : System.Single[]
61 | ===
62 | ( 0 ) '0'
63 | ( 4 ) [Accessor]
64 | BufferView : 1
65 | ByteOffset : 576
66 | ComponentType : FLOAT
67 | Normalized : False
68 | Count : 24
69 | Type : VEC3
70 | Max : System.Single[]
71 | ===
72 | ( 0 ) '1'
73 | ( 1 ) '1'
74 | ( 2 ) '1'
75 | Min : System.Single[]
76 | ===
77 | ( 0 ) '-1'
78 | ( 1 ) '-1'
79 | ( 2 ) '-1'
80 | ( 5 ) [Accessor]
81 | BufferView : 1
82 | ByteOffset : 864
83 | ComponentType : FLOAT
84 | Normalized : False
85 | Count : 24
86 | Type : VEC3
87 | Max : System.Single[]
88 | ===
89 | ( 0 ) '5'
90 | ( 1 ) '0.145'
91 | ( 2 ) '8'
92 | Min : System.Single[]
93 | ===
94 | ( 0 ) '0'
95 | ( 1 ) '-0.145'
96 | ( 2 ) '0'
97 | Asset : glTFLoader.Schema.Asset
98 | Generator : COLLADA2GLTF
99 | Version : 2.0
100 | Buffers : glTFLoader.Schema.Buffer[]
101 | ===
102 | ( 0 ) [Buffer]
103 | Uri : data:application/octet-stream;base64,AAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AADAQFK4Hj4AAABBAADAQFK4Hj4AAAAAAAAAAFK4Hj4AAAAAAAAAAFK4Hj4AAABBAAAAAFK4Hj4AAABBAAAAAFK4Hj4AAAAAAAAAAFK4Hr4AAAAAAAAAAFK4Hr4AAABBAAAAAFK4Hr4AAABBAAAAAFK4Hr4AAAAAAADAQFK4Hr4AAAAAAADAQFK4Hr4AAABBAADAQFK4Hr4AAABBAADAQFK4Hr4AAAAAAADAQFK4Hj4AAAAAAADAQFK4Hj4AAABBAAAAAFK4Hj4AAAAAAADAQFK4Hr4AAAAAAAAAAFK4Hr4AAAAAAADAQFK4Hj4AAAAAAAAAAFK4Hr4AAABBAADAQFK4Hr4AAABBAAAAAFK4Hj4AAABBAADAQFK4Hj4AAABBAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AACgQOJ6FD4AAABBAACgQOJ6FD4AAAAAAAAAAOJ6FD4AAAAAAAAAAOJ6FD4AAABBAAAAAOJ6FD4AAABBAAAAAOJ6FD4AAAAAAAAAAOJ6FL4AAAAAAAAAAOJ6FL4AAABBAAAAAOJ6FL4AAABBAAAAAOJ6FL4AAAAAAACgQOJ6FL4AAAAAAACgQOJ6FL4AAABBAACgQOJ6FL4AAABBAACgQOJ6FL4AAAAAAACgQOJ6FD4AAAAAAACgQOJ6FD4AAABBAAAAAOJ6FL4AAAAAAACgQOJ6FD4AAAAAAACgQOJ6FL4AAAAAAAAAAOJ6FD4AAAAAAACgQOJ6FL4AAABBAACgQOJ6FD4AAABBAAAAAOJ6FL4AAABBAAAAAOJ6FD4AAABBAAABAAIAAwAAAAIABAAFAAYABwAEAAYACAAJAAoACwAIAAoADAANAA4ADwAMAA4AEAARABIAEAATABEAFAAVABYAFQAXABYAAAABAAIAAwAAAAIABAAFAAYABwAEAAYACAAJAAoACwAIAAoADAANAA4ADwAMAA4AEAARABIAEwARABAAFAAVABYAFgAVABcA
104 | ByteLength : 1296
105 | BufferViews : glTFLoader.Schema.BufferView[]
106 | ===
107 | ( 0 ) [BufferView]
108 | Buffer : 0
109 | ByteOffset : 1152
110 | ByteLength : 144
111 | Target : ELEMENT_ARRAY_BUFFER
112 | ( 1 ) [BufferView]
113 | Buffer : 0
114 | ByteOffset : 0
115 | ByteLength : 1152
116 | ByteStride : 12
117 | Target : ARRAY_BUFFER
118 | Materials : glTFLoader.Schema.Material[]
119 | ===
120 | ( 0 ) [Material]
121 | Name : 246_BrickEngineering-fx
122 | PbrMetallicRoughness : glTFLoader.Schema.MaterialPbrMetallicRoughness
123 | BaseColorFactor : System.Single[]
124 | ===
125 | ( 0 ) '0'
126 | ( 1 ) '0'
127 | ( 2 ) '1'
128 | ( 3 ) '1'
129 | MetallicFactor : 0
130 | RoughnessFactor : 1
131 | EmissiveFactor : System.Single[]
132 | ===
133 | ( 0 ) '0'
134 | ( 1 ) '0'
135 | ( 2 ) '0'
136 | AlphaMode : OPAQUE
137 | AlphaCutoff : 0.5
138 | DoubleSided : False
139 | ( 1 ) [Material]
140 | Name : 136_BrickEngineeringGrey-fx
141 | PbrMetallicRoughness : glTFLoader.Schema.MaterialPbrMetallicRoughness
142 | BaseColorFactor : System.Single[]
143 | ===
144 | ( 0 ) '0.3921569'
145 | ( 1 ) '1'
146 | ( 2 ) '0.1960784'
147 | ( 3 ) '1'
148 | MetallicFactor : 0
149 | RoughnessFactor : 1
150 | EmissiveFactor : System.Single[]
151 | ===
152 | ( 0 ) '0'
153 | ( 1 ) '0'
154 | ( 2 ) '0'
155 | AlphaMode : OPAQUE
156 | AlphaCutoff : 0.5
157 | DoubleSided : False
158 | Meshes : glTFLoader.Schema.Mesh[]
159 | ===
160 | ( 0 ) [Mesh]
161 | Primitives : glTFLoader.Schema.MeshPrimitive[]
162 | ===
163 | ( 0 ) [MeshPrimitive]
164 | Attributes : System.Collections.Generic.Dictionary`2[System.String,System.Int32]
165 | ===
166 | ( 0 ) [KeyValuePair`2]
167 | Key : NORMAL
168 | Value : 1
169 | ( 1 ) [KeyValuePair`2]
170 | Key : POSITION
171 | Value : 2
172 | Indices : 0
173 | Material : 0
174 | Mode : TRIANGLES
175 | Name : 257_BasicWallWallExt_102Bwk50Air45Ins100DBlk12P285562
176 | ( 1 ) [Mesh]
177 | Primitives : glTFLoader.Schema.MeshPrimitive[]
178 | ===
179 | ( 0 ) [MeshPrimitive]
180 | Attributes : System.Collections.Generic.Dictionary`2[System.String,System.Int32]
181 | ===
182 | ( 0 ) [KeyValuePair`2]
183 | Key : NORMAL
184 | Value : 4
185 | ( 1 ) [KeyValuePair`2]
186 | Key : POSITION
187 | Value : 5
188 | Indices : 3
189 | Material : 1
190 | Mode : TRIANGLES
191 | Name : 150_BasicWallWallExt_102Bwk75Ins100LBlk12P285345
192 | Nodes : glTFLoader.Schema.Node[]
193 | ===
194 | ( 0 ) [Node]
195 | Children : System.Int32[]
196 | ===
197 | ( 0 ) '2'
198 | ( 1 ) '1'
199 | Matrix : System.Single[]
200 | ===
201 | 1 0 0 0
202 | 0 0 -1 0
203 | 0 1 0 0
204 | 0 0 0 1
205 | Rotation : System.Single[]
206 | ===
207 | ( 0 ) '0'
208 | ( 1 ) '0'
209 | ( 2 ) '0'
210 | ( 3 ) '1'
211 | Scale : System.Single[]
212 | ===
213 | ( 0 ) '1'
214 | ( 1 ) '1'
215 | ( 2 ) '1'
216 | Translation : System.Single[]
217 | ===
218 | ( 0 ) '0'
219 | ( 1 ) '0'
220 | ( 2 ) '0'
221 | Name : Z_UP
222 | ( 1 ) [Node]
223 | Matrix : System.Single[]
224 | ===
225 | -1 0 0 0
226 | 0 -1 0 0
227 | 0 0 1 0
228 | 0 0 0 1
229 | Mesh : 0
230 | Rotation : System.Single[]
231 | ===
232 | ( 0 ) '0'
233 | ( 1 ) '0'
234 | ( 2 ) '0'
235 | ( 3 ) '1'
236 | Scale : System.Single[]
237 | ===
238 | ( 0 ) '1'
239 | ( 1 ) '1'
240 | ( 2 ) '1'
241 | Translation : System.Single[]
242 | ===
243 | ( 0 ) '0'
244 | ( 1 ) '0'
245 | ( 2 ) '0'
246 | Name : 257_BasicWallWallExt_102Bwk50Air45Ins100DBlk12P285562
247 | ( 2 ) [Node]
248 | Matrix : System.Single[]
249 | ===
250 | 1 0 0 0
251 | 0 1 0 0
252 | 0 0 1 0
253 | 0 0 0 1
254 | Mesh : 1
255 | Rotation : System.Single[]
256 | ===
257 | ( 0 ) '0'
258 | ( 1 ) '0'
259 | ( 2 ) '0'
260 | ( 3 ) '1'
261 | Scale : System.Single[]
262 | ===
263 | ( 0 ) '1'
264 | ( 1 ) '1'
265 | ( 2 ) '1'
266 | Translation : System.Single[]
267 | ===
268 | ( 0 ) '0'
269 | ( 1 ) '0'
270 | ( 2 ) '0'
271 | Name : 150_BasicWallWallExt_102Bwk75Ins100LBlk12P285345
272 | Scene : 0
273 | Scenes : glTFLoader.Schema.Scene[]
274 | ===
275 | ( 0 ) [Scene]
276 | Nodes : System.Int32[]
277 | ===
278 | ( 0 ) '0'
279 |
280 |
--------------------------------------------------------------------------------
/XbimPlugin.Gltf.IO/XplorerGltfExporter/XplorerGltfExporter.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 | PluginVersion
14 |
15 | GLTF Schema version 2.0
16 |
17 |
18 | This library is undergoing significant development. Your feedback and engagement is welcome.
19 |
20 |
21 | To provide feedback or getting in touch with the developers,
22 |
27 | please contact
28 | claudio.benghi@gmail.com.
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | The whole model is exported to a single file in the same folder of the currently open model.
39 |
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 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | Export elements individually
77 |
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 |
--------------------------------------------------------------------------------