Beispiel #1
0
        public static BHG.Polyline StoreyGeometry(this BH.oM.Architecture.Elements.Level level, List <List <BHE.BuildingElement> > spaces)
        {
            List <List <BHE.BuildingElement> > spacesAtLevel = spaces.FindAll(x => x.Level(level) != null).ToList();

            if (spacesAtLevel.Count == 0)
            {
                return(null);
            }

            List <BHG.Point> ctrlPoints = new List <BHG.Point>();

            foreach (List <BHE.BuildingElement> space in spacesAtLevel)
            {
                foreach (BHE.BuildingElement element in space)
                {
                    foreach (BHG.Point pt in element.PanelCurve.IControlPoints())
                    {
                        if (pt.Z > (level.Elevation - BH.oM.Geometry.Tolerance.Distance) && pt.Z < (level.Elevation + BH.oM.Geometry.Tolerance.Distance))
                        {
                            ctrlPoints.Add(pt);
                        }
                    }
                }
            }

            return(BH.Engine.Geometry.Create.ConvexHull(ctrlPoints.CullDuplicates()));
        }
Beispiel #2
0
        public static BH.oM.Architecture.Elements.Level Level(this List <Panel> panelsAsSpace, List <BH.oM.Architecture.Elements.Level> levels)
        {
            foreach (BH.oM.Architecture.Elements.Level l in levels)
            {
                BH.oM.Architecture.Elements.Level match = panelsAsSpace.Level(l);
                if (match != null)
                {
                    return(match);
                }
            }

            return(null);
        }
Beispiel #3
0
        /***************************************************/
        /**** Public Methods                            ****/
        /***************************************************/

        public static BHG.Polyline StoreyGeometry(this BH.oM.Architecture.Elements.Level level, List <BHE.Space> spaces)
        {
            /*List<BHE.Space> spacesAtLevel = spaces.FindAll(x => x.Level.Elevation == level.Elevation).ToList();
             *
             * if (spacesAtLevel.Count == 0)
             *  return null;
             *
             * List<BHE.BuildingElement> bHoMBuildingElement = spacesAtLevel.SelectMany(x => x.BuildingElements).ToList();
             * List<BHG.Point> ctrlPoints = new List<BHG.Point>();
             *
             * foreach (BHE.BuildingElement element in bHoMBuildingElement)
             * {
             *  foreach (BHG.Point pt in element.BuildingElementGeometry.ICurve().IControlPoints())
             *  {
             *      if (pt.Z > (level.Elevation - BH.oM.Geometry.Tolerance.Distance) && pt.Z < (level.Elevation + BH.oM.Geometry.Tolerance.Distance))
             *          ctrlPoints.Add(pt);
             *
             *  }
             * }
             *
             * return BH.Engine.Geometry.Create.ConvexHull(ctrlPoints.CullDuplicates());*/

            return(new oM.Geometry.Polyline());
        }
Beispiel #4
0
 public static List <Panel> PanelsByMaximumLevel(this List <Panel> panels, BH.oM.Architecture.Elements.Level searchLevel)
 {
     return(panels.PanelsByMaximumLevel(searchLevel.Elevation));
 }
Beispiel #5
0
        public static BH.oM.Architecture.Elements.Level Level(this List <Panel> panelsAsSpace, BH.oM.Architecture.Elements.Level level)
        {
            Polyline floor = panelsAsSpace.FloorGeometry();

            if (floor == null)
            {
                return(null);
            }

            List <Point> floorPts = floor.IControlPoints();

            bool allPointsOnLevel = true;

            foreach (Point pt in floorPts)
            {
                allPointsOnLevel &= (pt.Z > (level.Elevation - BH.oM.Geometry.Tolerance.Distance) && pt.Z < (level.Elevation + BH.oM.Geometry.Tolerance.Distance));
            }

            if (!allPointsOnLevel)
            {
                return(null);
            }
            return(level);
        }