private Brep ApplyWallOpen(IEnumerable <StbOpen> opens, StbWall wall, IReadOnlyList <Point3d> wallPts, Brep brep)
        {
            if (brep == null)
            {
                return(brep);
            }

            double   thickness   = BrepMaker.Wall.GetThickness(_sections, wall);
            var      centerCurve = new PolylineCurve(wallPts);
            Vector3d normal      = Vector3d.CrossProduct(centerCurve.TangentAtEnd, centerCurve.TangentAtStart);
            var      openIds     = new List <string>();

            if (wall.StbOpenIdList != null)
            {
                openIds.AddRange(wall.StbOpenIdList.Select(openId => openId.id));
                foreach (string id in openIds)
                {
                    StbOpen         open         = opens.First(o => o.id == id);
                    Point3d[]       openCurvePts = GetOpenCurvePts(wallPts, open);
                    PolylineCurve[] openCurve    = GetOpenCurve(thickness, normal, openCurvePts);
                    Brep            openBrep     = Brep.CreateFromLoft(openCurve, Point3d.Unset, Point3d.Unset, LoftType.Straight, false)[0].CapPlanarHoles(_tolerance[0]);
                    CheckBrepOrientation(openBrep);

                    brep = Brep.CreateBooleanDifference(brep, openBrep, 1)[0];
                }
            }

            return(brep);
        }
Beispiel #2
0
 public static double GetThickness(StbSections sections, StbWall wall)
 {
     return(sections.StbSecWall_RC.First(sec => sec.id == wall.id_section)
            .StbSecFigureWall_RC.StbSecWall_RC_Straight.t);
 }