Пример #1
0
        public static StadiaParameters StadiaParameters(double structBayWidth = 7.5, double cornerRadius = 10.0, double sideBound  = 6.7,
                                                        double endBound       = 7.8, double sideRadius   = 240.0, double endRadius = 200.0, double theatronRadius = 100.0, int numCornerBays = 7,
                                                        StadiaType typeOfBowl = StadiaType.EightArc, double cornerFraction = 0.5, ActivityArea activityArea = null, double pitchLength = 90, double pitchWidth = 45)
        {
            if (activityArea == null)
            {
                activityArea = Create.ActivityArea(1);
            }

            return(new StadiaParameters
            {
                StructBayWidth = structBayWidth,

                CornerRadius = cornerRadius,

                SideBound = sideBound,

                EndBound = endBound,

                SideRadius = sideRadius,

                EndRadius = endRadius,

                TheatronRadius = theatronRadius,

                NumCornerBays = numCornerBays,

                TypeOfBowl = typeOfBowl,

                CornerFraction = cornerFraction,

                ActivityArea = activityArea,

                PitchLength = pitchLength,

                PitchWidth = pitchWidth,
            });
        }
Пример #2
0
        /***************************************************/
        /**** Private Methods                           ****/
        /***************************************************/
        private static void NoCornerPlanSetUp(ref TheatronPlan plan, double length, double width, double endBound, double structBayW, double sideBound)
        {
            int nSideBays = (int)(Math.Floor(((length + endBound) / 2) / structBayW) * 2);
            int nEndBays  = (int)(Math.Floor(((width + sideBound) / 2) / structBayW) * 2);

            plan.SectionOrigins = new List <ProfileOrigin>();

            double actualBayW;
            double xMin;
            double yMin;
            double oX, oY, dX, dY;
            int    count  = 0;
            Point  origin = new Point();
            Vector xdir   = new Vector();

            ProfileOrigin tempPlane = new ProfileOrigin();
            BayType       bayType   = BayType.Side;//0 = side, 1= end, 2 =corner

            for (int i = 0; i < 4; i++)
            {
                if (i % 2 == 0)//side bay
                {
                    bayType    = 0;
                    actualBayW = (length + endBound) / nSideBays;
                    for (int d = 0; d <= nSideBays; d++)
                    {
                        plan.StructBayType.Add(bayType);
                        if (i == 0)//right side
                        {
                            yMin = (nSideBays * actualBayW) / -2;
                            //origin xyz
                            oX = ((width + sideBound) / 2);
                            oY = yMin + (actualBayW * d);
                            dX = 1;
                            dY = 0;
                        }
                        else//left side
                        {
                            yMin = (nSideBays * actualBayW) / 2;
                            //origin xyz
                            oX = -((width + sideBound) / 2);
                            oY = yMin - (actualBayW * d);
                            dX = -1;
                            dY = 0;
                        }
                        origin    = Geometry.Create.Point(oX, oY, 0);
                        xdir      = Geometry.Create.Vector(dX, dY, 0);
                        tempPlane = Create.ProfileOrigin(origin, xdir);
                        plan.SectionOrigins.Add(tempPlane);
                        count++;
                    }
                }

                else
                {
                    bayType    = BayType.End;
                    actualBayW = (width + sideBound) / nEndBays;
                    xMin       = (nEndBays * actualBayW) / 2;
                    //
                    for (int d = 0; d <= nEndBays; d++)
                    {
                        plan.StructBayType.Add(bayType);
                        if (i == 1)// northEnd
                        {
                            //origin xyz
                            oX = xMin - (actualBayW * d);
                            oY = ((length + endBound) / 2);

                            dX = 0;
                            dY = 1;// 0;
                        }
                        else
                        {
                            //origin xyz
                            oX = -xMin + (actualBayW * d);
                            oY = -((length + endBound) / 2);
                            dX = 0;
                            dY = -1;
                        }
                        origin    = Geometry.Create.Point(oX, oY, 0);
                        xdir      = Geometry.Create.Vector(dX, dY, 0);
                        tempPlane = Create.ProfileOrigin(origin, xdir);
                        plan.SectionOrigins.Add(tempPlane);
                        count++;
                    }
                }
            }
        }
Пример #3
0
        /***************************************************/

        private static ProfileOrigin DefineTierOrigin(List <Point> flrPoints)
        {
            ProfileOrigin profOrigin = Create.ProfileOrigin(flrPoints[0], flrPoints[1] - flrPoints[0]);

            return(profOrigin);
        }
Пример #4
0
        /***************************************************/
        /**** Private Methods                           ****/
        /***************************************************/
        private static void orthoPlanSetUp(ref TheatronPlan plan, double length, double width, double endBound, double sideBound, double cornerR, double structBayW, int nCornerBays)
        {
            int nSideBays = (int)(Math.Floor(((length + endBound) / 2 - cornerR) / structBayW) * 2);
            int nEndBays  = (int)(Math.Floor(((width + sideBound) / 2 - cornerR) / structBayW) * 2);

            plan.SectionOrigins = new List <ProfileOrigin>();

            double        cornA = Math.PI / 2 / (nCornerBays + 1);
            double        trueR = cornerR / Math.Cos(cornA / 2);
            double        xMin;
            double        yMin;
            double        oX, oY, dX, dY;
            int           count      = 0;
            Point         origin     = new Point();
            Vector        xdir       = new Vector();
            Vector        ydir       = Vector.ZAxis;
            Vector        normal     = new Vector();
            ProfileOrigin tempOrigin = new ProfileOrigin();
            BayType       bayType    = 0; //0 = side, 1= end, 2 =corner

            for (int i = 0; i < 8; i++)
            {
                if (i == 0 || i == 4)//side bay
                {
                    bayType = 0;
                    for (int d = 0; d <= nSideBays; d++)
                    {
                        plan.StructBayType.Add(bayType);
                        if (i == 0)//right side
                        {
                            yMin = (nSideBays * structBayW) / -2;
                            //origin xyz
                            oX = ((width + sideBound) / 2);
                            oY = yMin + (structBayW * d);
                            dX = 1;
                            dY = 0;
                        }
                        else//left side
                        {
                            yMin = (nSideBays * structBayW) / 2;
                            //origin xyz
                            oX = -((width + sideBound) / 2);
                            oY = yMin - (structBayW * d);
                            dX = -1;
                            dY = 0;
                        }
                        origin     = Geometry.Create.Point(oX, oY, 0);
                        xdir       = Geometry.Create.Vector(dX, dY, 0);
                        tempOrigin = Create.ProfileOrigin(origin, xdir);
                        plan.SectionOrigins.Add(tempOrigin);
                        count++;
                    }
                }
                else
                {
                    if (i == 2 || i == 6)//end bay
                    {
                        bayType = BayType.End;
                        xMin    = (nEndBays * structBayW) / 2;
                        //
                        for (int d = 0; d <= nEndBays; d++)
                        {
                            plan.StructBayType.Add(bayType);
                            if (i == 2)// northEnd
                            {
                                //origin xyz
                                oX = xMin - (structBayW * d);
                                oY = ((length + endBound) / 2);
                                dX = 0;
                                dY = 1;
                            }
                            else
                            {
                                //origin xyz
                                oX = -xMin + (structBayW * d);
                                oY = -((length + endBound) / 2);

                                dX = 0;
                                dY = -1;
                            }
                            origin     = Geometry.Create.Point(oX, oY, 0);
                            xdir       = Geometry.Create.Vector(dX, dY, 0);
                            tempOrigin = Create.ProfileOrigin(origin, xdir);
                            plan.SectionOrigins.Add(tempOrigin);
                            count++;
                        }
                    }
                    else//corners
                    {
                        //local centres cs at fillets
                        bayType = BayType.Corner;
                        double centreX    = (width + sideBound) / 2 - cornerR;
                        double centreY    = (length + endBound) / 2 - cornerR;
                        double startAngle = 0;
                        if (i == 1) //NE++
                        {
                        }
                        if (i == 3) //NW-+
                        {
                            centreX    = -centreX;
                            startAngle = Math.PI / 2;
                        }
                        if (i == 5) //SW--
                        {
                            centreY    = -centreY;
                            centreX    = -centreX;
                            startAngle = Math.PI;
                        }
                        if (i == 7) //SE+-
                        {
                            centreY    = -1 * centreY;
                            startAngle = Math.PI * 1.5;
                        }

                        //
                        for (int d = 0; d <= nCornerBays; d++)
                        {
                            plan.StructBayType.Add(bayType);
                            if (d == 0)//half bay on first
                            {
                                oX = centreX + trueR * Math.Cos(startAngle + cornA / 2);
                                oY = centreY + trueR * Math.Sin(startAngle + cornA / 2);
                                dX = trueR * Math.Cos(startAngle + cornA / 2);
                                dY = trueR * Math.Sin(startAngle + cornA / 2);
                            }
                            else
                            {
                                oX = centreX + trueR * Math.Cos(startAngle + (cornA * d + cornA / 2));
                                oY = centreY + trueR * Math.Sin(startAngle + (cornA * d + cornA / 2));
                                dX = trueR * Math.Cos(startAngle + (cornA * d + cornA / 2));
                                dY = trueR * Math.Sin(startAngle + (cornA * d + cornA / 2));
                            }
                            origin     = Geometry.Create.Point(oX, oY, 0);
                            xdir       = Geometry.Create.Vector(dX, dY, 0);
                            tempOrigin = Create.ProfileOrigin(origin, xdir);
                            plan.SectionOrigins.Add(tempOrigin);
                            count++;
                        }
                    }
                }
            }
        }