Пример #1
0
        public static List <Brep> AvailableFloorSpace(List <Brep> floorRegions, TestFitPackage tf, CirculationPackage circ)
        {
            //Parse exemption profiles.
            List <Curve> exemptionCurves  = tf.FloorPlanPackage.ExemptionProfiles;
            List <Brep>  exemptionRegions = new List <Brep>();

            foreach (Curve exemption in exemptionCurves)
            {
                Brep exemptionSurface = Brep.CreatePlanarBreps(exemption)[0];
                exemptionRegions.Add(exemptionSurface);
            }

            //Remove spaces designated by exemptions.
            List <Brep> nonExemptRegions = Select.NotExemptRegions(floorRegions, exemptionRegions);


            //Parse regions of core that need egress and circulation axis.
            List <Curve> coreAccessCurves  = tf.FloorPlanPackage.CoreAccessCurves;
            List <Curve> circulationCurves = tf.FloorPlanPackage.CirculationAxisCurves;

            //Remove space for core access and egress requirements. Only if circulation axis do not already connect all egress requirements.
            List <Curve> coreCurvesToGiveEgress = Select.CoreCurvesWithoutEgress(coreAccessCurves, circulationCurves);

            if (coreCurvesToGiveEgress.Count != 0)
            {
                List <Curve> bestSourceOfEgress     = Select.BestSourceOfEgress(coreCurvesToGiveEgress, circulationCurves);
                List <Brep>  newExemptionsForEgress = Select.OrthogonalEgress(coreCurvesToGiveEgress, bestSourceOfEgress);

                //nonExemptRegions = newExemptionsForEgress;
                nonExemptRegions = Select.NotExemptRegions(nonExemptRegions, newExemptionsForEgress);
            }

            //Remove circulation zones of main circulation items.
            List <Curve> mainCirculationSegments = circ.MainCurves;
            List <Brep>  circulationExemptions   = new List <Brep>();

            foreach (Curve segment in mainCirculationSegments)
            {
                int   minDist         = 4;
                Curve extendedSegment = segment.Extend(CurveEnd.Both, minDist / 2, CurveExtensionStyle.Line);
                Brep  circRegion      = Brep.CreatePlanarBreps(Curves.OffsetClosed(extendedSegment, minDist / 2, true))[0];
                circulationExemptions.Add(circRegion);
            }

            //nonExemptRegions = Select.NotCirculationRegions(nonExemptRegions, circulationExemptions);
            nonExemptRegions = Select.NotExemptRegions(nonExemptRegions, circulationExemptions);

            //Remove columns. Still unsure if this is the best move.
            //Disabled for now, for performance reasons. Maybe check collision on population?
            List <Curve> structureObstacles  = tf.FloorPlanPackage.StructureProfiles;
            List <Brep>  structureExemptions = new List <Brep>();

            foreach (Curve str in structureObstacles)
            {
                structureExemptions.Add(Brep.CreatePlanarBreps(str)[0]);
            }

            //nonExemptRegions = Select.NotExemptRegions(nonExemptRegions, structureExemptions);

            return(nonExemptRegions);
        }