示例#1
0
        public void Floor()
        {
            var planShape = Polygon.L(2, 4, 1.5);
            var floor     = new Floor(planShape, 0.1);
            var floor1    = new Floor(planShape, 0.1, new Transform(0, 0, 2));
            var o         = new Opening(0.5, 0.5, 0.5, 0.5);

            floor.Openings.Add(o);

            var model = new Model();

            model.AddElement(floor);
            model.AddElement(floor1);

            var ifcPath = ConstructIfcPath("IfcFloor");

            model.ToIFC(ifcPath);
            model.ToGlTF(ConstructGlbPath("IfcFloor"));

            var newModel = IFCModelExtensions.FromIFC(ifcPath);

            // We expect two floors, one material, and one profile.
            // TODO(Ian): Update this when we're not duplicating profiles
            // in the output IFC.
            Assert.Equal(8, newModel.Elements.Values.Count);
            newModel.ToGlTF(ConstructGlbPath("IfcFloor2"));
        }
示例#2
0
        public void Floor()
        {
            var planShape = Polygon.L(2, 4, 1.5);
            var floor     = new Floor(planShape, 0.1);
            var floor1    = new Floor(planShape, 0.1, new Transform(0, 0, 2));
            var o         = new Opening(Polygon.Rectangle(0.5, 0.5), transform: new Transform(0.5, 0.5, 0));

            floor.Openings.Add(o);

            var model = new Model();

            model.AddElement(floor);
            model.AddElement(floor1);

            var ifcPath = ConstructIfcPath("IfcFloor");

            model.ToIFC(ifcPath);
            model.ToGlTF(ConstructGlbPath("IfcFloor"));

            var ctorErrors = new List <string>();
            var newModel   = IFCModelExtensions.FromIFC(ifcPath, out ctorErrors);

            foreach (var e in ctorErrors)
            {
                this.output.WriteLine(e);
            }

            Assert.Equal(model.Elements.Values.Count, newModel.Elements.Values.Count);
            newModel.ToGlTF(ConstructGlbPath("IfcFloor2"));
        }
示例#3
0
        public void IFC2X3(string name, string ifcPath, string[] idsToConvert = null)
        {
            var ctorErrors = new List <string>();
            var model      = IFCModelExtensions.FromIFC(Path.Combine(Environment.CurrentDirectory, ifcPath), out ctorErrors, idsToConvert);

            foreach (var e in ctorErrors)
            {
                this.output.WriteLine(e);
            }
            model.ToGlTF(ConstructGlbPath(name));
        }
示例#4
0
 /// <summary>
 /// Deserialize a model from IFC.
 /// </summary>
 /// <param name="path">The path to the IFC file.</param>
 /// <param name="idsToConvert">An optional collection of IFC identifiers to convert.</param>
 public static Model FromIFC(string path, string[] idsToConvert = null)
 {
     return(IFCModelExtensions.FromIFC(path, idsToConvert));
 }
示例#5
0
 /// <summary>
 /// Serialize the model to IFC.
 /// </summary>
 /// <param name="path">The output path for the IFC file.</param>
 public void ToIFC(string path)
 {
     IFCModelExtensions.ToIFC(this, path);
 }
示例#6
0
        public void IFC2X3(string name, string ifcPath, string[] idsToConvert = null)
        {
            var model = IFCModelExtensions.FromIFC(Path.Combine(Environment.CurrentDirectory, ifcPath), idsToConvert);

            model.ToGlTF(ConstructGlbPath(name));
        }
示例#7
0
        // [InlineData("20160125WestRiverSide Hospital - IFC4-Autodesk_Hospital_Sprinkle", "../../../models/20160125WestRiverSide Hospital - IFC4-Autodesk_Hospital_Sprinkle.ifc")]
        public void IFC4(string name, string ifcPath)
        {
            var model = IFCModelExtensions.FromIFC(Path.Combine(Environment.CurrentDirectory, ifcPath));

            model.ToGlTF(ConstructGlbPath(name));
        }