Exemple #1
0
        public static global::OpenStudio.SubSurface ToOSM(this BHE.Opening opening, global::OpenStudio.Surface hostSurface, global::OpenStudio.Construction construction, global::OpenStudio.Model referenceModel)
        {
            Point3dVector openingPts = opening.Polyline().IDiscontinuityPoints().ToOSM();
            SubSurface    osmOpening = new SubSurface(openingPts, referenceModel);

            osmOpening.setSubSurfaceType(opening.Type.ToOSMFenestrationType());

            osmOpening.setSurface(hostSurface);
            osmOpening.setConstruction(construction);

            double oA = osmOpening.azimuth();
            double hA = hostSurface.azimuth();

            if (oA != hA)
            {
                osmOpening.setName("NOT EQUAL AZIMUTH - " + osmOpening.name());
            }

            if (osmOpening.azimuth() < (hostSurface.azimuth() - 1) || osmOpening.azimuth() > (hostSurface.azimuth() + 1))
            {
                osmOpening.setVertices(opening.Polyline().IFlip().ICollapseToPolyline(BHG.Tolerance.Angle).ToOSM());
            }

            return(osmOpening);
        }
Exemple #2
0
        public static BHG.Polyline ToBHoM(this Point3dVector osmLine)
        {
            BHG.Polyline pLine = new BHG.Polyline();

            foreach (Point3d p in osmLine)
            {
                pLine.ControlPoints.Add(p.ToBHoM());
            }

            return(pLine);
        }
Exemple #3
0
        public static Point3dVector ToOSM(this List <BHG.Point> pts)
        {
            Point3dVector vector = new Point3dVector();

            pts.Remove(pts.Last());

            foreach (BHG.Point p in pts)
            {
                vector.Add(p.ToOSM());
            }

            return(vector);
        }
Exemple #4
0
        public static Point3dVector ToOSM(this BHG.Polyline pLine)
        {
            Point3dVector osmLine = new Point3dVector();

            foreach (BHG.Point p in pLine.ControlPoints)
            {
                osmLine.Add(p.ToOSM());
            }

            osmLine.RemoveAt(pLine.ControlPoints.Count - 1);

            return(osmLine);
        }