Beispiel #1
0
        public static FloorSlab GetFloorsData(IIfcSlab floor)
        {
            Point location = new Point()
            {
                X = ((floor.ObjectPlacement as IIfcLocalPlacement)
                     .RelativePlacement as IIfcAxis2Placement3D).Location.X,

                Y = ((floor.ObjectPlacement as IIfcLocalPlacement)
                     .RelativePlacement as IIfcAxis2Placement3D).Location.Y,
                Z = 0
            };

            Point refDir = new Point()
            {
                X = ((floor.ObjectPlacement as IIfcLocalPlacement).RelativePlacement as IIfcAxis2Placement3D).RefDirection.X,

                Y = ((floor.ObjectPlacement as IIfcLocalPlacement).RelativePlacement as IIfcAxis2Placement3D).RefDirection.Y,

                Z = 0
            };

            Vector3D refd  = new Vector3D(refDir.X, refDir.Y, refDir.Z);
            Vector3D yaxis = Vector3D.CrossProduct(new Vector3D(0, 0, 1), refd);

            yaxis.Normalize();

            Matrix3D transform = new Matrix3D(
                refDir.X, refDir.Y, 0, 0,
                yaxis.X, yaxis.Y, 0, 0,
                0, 0, 1.0, 0,
                location.X, location.Y, location.Z, 1.0);

            FloorSlab f = new FloorSlab()
            {
                Name = floor.Name.Value.ToString(),

                Location = location,

                RefDirection = refDir,

                Mat = transform,

                Level = (floor.ContainedInStructure.FirstOrDefault().RelatingStructure as IIfcBuildingStorey).Elevation.Value,

                Profile = (((floor.Representation.Representations.FirstOrDefault().Items.FirstOrDefault() as IIfcExtrudedAreaSolid)
                            .SweptArea as IIfcArbitraryClosedProfileDef).OuterCurve as IIfcPolyline)
                          .Points.Select(pt => new Point()
                {
                    X = pt.X, Y = pt.Y, Z = 0
                }).ToList(),

                Depth = (floor.Representation.Representations.FirstOrDefault().Items.FirstOrDefault() as IIfcExtrudedAreaSolid).Depth,
            };

            return(f);
        }
Beispiel #2
0
        /***************************************************/
        /****              Public Methods               ****/
        /***************************************************/

        public static IEnumerable <IBHoMObject> FromIfc(this IIfcSlab element, Discipline discipline, IfcSettings settings)
        {
            switch (discipline)
            {
            default:
                return(new List <IBHoMObject> {
                    element.FloorFromIfc(settings)
                });
            }
        }
Beispiel #3
0
        /***************************************************/
        /****              Public Methods               ****/
        /***************************************************/

        public static Floor FloorFromIfc(this IIfcSlab element, IfcSettings settings)
        {
            if (element == null)
            {
                BH.Engine.Reflection.Compute.RecordError("The IFC element could not be converted because it was null.");
                return(null);
            }

            settings = settings.DefaultIfNull();

            //TODO: refine this!
            return(new Floor {
                Name = element.Name
            });
        }
        public static (double Bc, double Tc, double Hh) ParseDeckDimensions(IIfcSlab deck)
        {
            var deckSolid = ParseDeckPlateSolid(deck);

            (double Bc, double Tc, double Hh)deckInfo;
            deckInfo.Bc = 0;
            deckInfo.Tc = 0;
            deckInfo.Hh = 0;
            if (deckSolid.CrossSections[0] is IIfcArbitraryClosedProfileDef acp && acp.OuterCurve is IIfcPolyline pl)
            {
                var pointSet = pl.Points.ToList();
                deckInfo.Bc = Math.Abs((pointSet[3].X + pointSet[4].X) / 2.0 - (pointSet[7].X + pointSet[8].X) / 2.0);
                deckInfo.Tc = Math.Abs(pointSet[0].Y - pointSet[1].Y);
                deckInfo.Hh = Math.Abs(pointSet[2].Y - pointSet[3].Y);
            }
            return(deckInfo);
        }
Beispiel #5
0
 public IfFloor(IfModel ifModel, IIfcSlab ifcSlab) : base(ifModel)
 {
     IfcSlab = ifcSlab;
     Initialize();
 }
        public static IIfcSectionedSolidHorizontal ParseDeckPlateSolid(IIfcSlab deck)
        {
            var deckSolid = deck.Representation.Representations[0].Items.FirstOrDefault();

            return((IIfcSectionedSolidHorizontal)deckSolid);
        }