/***************************************************/ /**** Public Methods ****/ /***************************************************/ public static double Altitude(this BHEI.IBuildingObject buildingElementGeometry) { BHG.BoundingBox panelBoundingBox = BH.Engine.Geometry.Query.IBounds(buildingElementGeometry.ICurve()); double altitude = panelBoundingBox.Min.Z; return(altitude); }
/***************************************************/ /**** Public Methods ****/ /***************************************************/ public static double Azimuth(this BHEI.IBuildingObject buildingElementGeometry, BHG.Vector refVector) { BHG.Polyline pline = new BHG.Polyline { ControlPoints = BH.Engine.Geometry.Query.IControlPoints(buildingElementGeometry.ICurve()) }; double azimuth = Azimuth(pline, refVector); return(azimuth); }
/***************************************************/ /**** Public Methods ****/ /***************************************************/ public static double Tilt(this BHEI.IBuildingObject buildingElementGeometry) { double tilt; BHG.Polyline pline = new BHG.Polyline { ControlPoints = BH.Engine.Geometry.Query.IControlPoints(buildingElementGeometry.ICurve()) }; tilt = Tilt(pline); return(tilt); }
/***************************************************/ /**** Public Methods ****/ /***************************************************/ public static double Inclination(BHEI.IBuildingObject buildingElementPanel) { Panel panel = buildingElementPanel as Panel; BHG.Polyline pLine = new oM.Geometry.Polyline { ControlPoints = panel.PanelCurve.IControlPoints() }; List <BHG.Point> pts = pLine.DiscontinuityPoints(); BHG.Plane plane = BH.Engine.Geometry.Create.Plane(pts[0], pts[1], pts[2]); //Some protection on this needed maybe? BHG.Vector xyNormal = BH.Engine.Geometry.Create.Vector(0, 0, 1); return(BH.Engine.Geometry.Query.Angle(plane.Normal, xyNormal) * (180 / Math.PI)); }