예제 #1
0
        protected void DrawIsoFoot()
        {
            DimensionLine dim = new DimensionLine();

            DiagramGraphics = new DovDrawings(diagramContext);
            diagramChart    = new ChartStyle();
            float footW = 0.4f * DiagramCanvWidth;
            float footH = 0.4f * DiagramCanvHeight;

            diagramChart.ChartArea = new RectangleF(0, 0, footW, footH);
            float startX = 0;
            float startY = 0;

            DiagramGraphics.Clear(startX, startY, footW, footH);
            float limit = (footingData.Width > footingData.Length ? footingData.Width : footingData.Length);
            float xMax  = 0.5f * limit;
            float xMin  = -0.5f * limit;
            float yMax  = 0.5f * limit;
            float yMin  = -0.5f * limit;

            SetGraphicLayout(footW, footH, startX, startY, diagramChart, new float[] { xMin, xMax, yMin, yMax });
            PointF fPt1 = new PointF(-0.5f * footingData.Width, 0.5f * footingData.Length);
            PointF fPt2 = new PointF(0.5f * footingData.Width, -0.5f * footingData.Length);

            fPt1 = diagramChart.Point2D(fPt1);
            fPt2 = diagramChart.Point2D(fPt2);
            DiagramGraphics.FillColorOpt = "lightslategrey";
            DiagramGraphics.FillColor(fPt1, fPt2);
            DiagramGraphics.DrwColor = "dimgrey";
            DiagramGraphics.DrawRec(fPt1, fPt2);
            SetGraphicLayout(footW, footH, startX, startY, diagramChart, new float[] { xMin, xMax, yMin, yMax });
            PointF cPt1   = new PointF(footingData.ColLocX - 0.5f * footingData.Width + footingData.ColumnWidth * 0.5f, footingData.ColLocY - footingData.Length * 0.5f - 0.5f * footingData.ColumnLength);
            PointF cPt2   = new PointF(footingData.ColLocX - 0.5f * footingData.Width - footingData.ColumnWidth * 0.5f, footingData.ColLocY - footingData.Length * 0.5f + 0.5f * footingData.ColumnLength);
            PointF center = new PointF(footingData.ColLocX - 0.5f * footingData.Width, footingData.ColLocY - footingData.Length * 0.5f);

            cPt1   = diagramChart.Point2D(cPt1);
            cPt2   = diagramChart.Point2D(cPt2);
            center = diagramChart.Point2D(center);
            DiagramGraphics.FillColorOpt = "darkslategrey";
            DiagramGraphics.FillColor(cPt1, cPt2);
            DiagramGraphics.DrwColor = "dimgrey";
            DiagramGraphics.DrawRec(cPt1, cPt2);
            DiagramGraphics.DrwColor = "cadetblue";
            dim.Graphic = DiagramGraphics;
            dim.DimLoc  = DimensionLine.DimensionLocation.end;
            dim.DrawAdjDimLine(fPt1, fPt2, string.Format("W={0}", footingData.Width));
            dim.DimDir = DimensionLine.DimensionDirection.right;
            DiagramGraphics.TextBase = TextBaseline.Bottom;
            dim.DrawOppoDimLine(fPt1, fPt2, string.Format("L={0}", footingData.Length));
            dim.DimDir = DimensionLine.DimensionDirection.right;
            dim.DrawOppoDimLine(fPt1, center, string.Format("y={0}", footingData.ColLocY));
            dim.DimLoc = DimensionLine.DimensionLocation.start;
            dim.DrawAdjDimLine(fPt1, center, string.Format("x={0}", footingData.ColLocX));
        }
예제 #2
0
        protected void DrawAxis(DovDrawings graphic, ChartStyle cs)
        {
            float axisH = 0.5f * secRec.Height * 0.8f;
            float axisV = 0.5f * secRec.Width * 0.8f;

            graphic.DrwColor = "white";
            graphic.TextBase = TextBaseline.Bottom;
            PointF origin = cs.Point2D(new PointF(0, 0));
            PointF xEnd   = cs.Point2D(new PointF(axisH, 0));
            PointF yEnd   = cs.Point2D(new PointF(0, axisV));

            graphic.DrawLine(origin, xEnd, true);
            graphic.DrawLine(origin, yEnd, true, true);
            graphic.DrawText("X", xEnd);
            graphic.DrawText("Y", yEnd);
        }
예제 #3
0
        public void DrawUniInterChart()
        {
            float[]        resultantMoment = new float[] { };
            float[]        axialForce      = new float[] { };
            List <float[]> data            = ColumnInter.BiaxialTableatAngle;
            List <float>   bendingx        = data[0].ToList();
            List <float>   bendingy        = data[1].ToList();
            List <float>   axial           = data[2].ToList();

            resultantMoment = new float[bendingx.Count];
            axialForce      = new float[bendingx.Count];
            for (int i = 0; i < bendingx.Count; i++)
            {
                resultantMoment[i] = (float)Math.Sqrt((bendingx[i] * bendingx[i]) + (bendingy[i] * bendingy[i]));
            }
            axialForce = axial.ToArray();
            PointF[] diagramPoints = new PointF[resultantMoment.Length];
            for (int i = 0; i < resultantMoment.Length; i++)
            {
                diagramPoints[i] = diagramChart.Point2D(new PointF(resultantMoment[i], axialForce[i]));
            }
            DiagramGraphics.DrwColor      = "white";
            DiagramGraphics.LineThickness = 2;
            DiagramGraphics.DrawPolyLine(diagramPoints);
        }
예제 #4
0
        protected void DrawRecSecStrain()
        {
            float dsgnStrW = 0.3f * DsgnCanvWidth;

            float tensStr   = (float)Math.Round(BeamDsgnRslt.TensStrainY, 6);
            float compStr   = (float)Math.Round(BeamDsgnRslt.CompStrain, 6);
            float h         = secRec.Height;
            float c         = BeamDsgnRslt.NeutralAxisY;
            float d         = BeamDsgnRslt.TensEffDepth;
            float dComp     = BeamDsgnRslt.CompEffDepth;
            float txtWidth  = 30.56f;
            float txtOffset = 5;
            float txtHeight = 10;
            float cb        = h - c;

            designChart.XMin           = 0;
            designChart.XMax           = BeamDsgnRslt.CompStrain + BeamDsgnRslt.TensStrainY + (txtWidth * (compStr + tensStr) / dsgnStrW);
            designChart.YMin           = 0;
            designChart.YMax           = h + txtHeight;
            DsgnGraphics.DrwColor      = "red";
            DsgnGraphics.LineThickness = 2;

            PointF pt0 = designChart.Point2D(new PointF(0, h - d));
            PointF pt1 = designChart.Point2D(new PointF(tensStr, h - d));
            PointF pt2 = designChart.Point2D(new PointF(tensStr, h));
            PointF pt3 = designChart.Point2D(new PointF(tensStr + compStr, h));
            PointF pt4 = designChart.Point2D(new PointF(tensStr, cb));
            PointF pt5 = designChart.Point2D(new PointF(0, h - d));
            PointF pt6 = designChart.Point2D(new PointF(tensStr, 0));

            DsgnGraphics.DrawPolyLine(new[] { pt0, pt1, pt2, pt3, pt4, pt5 });
            DsgnGraphics.DrawLine(pt1, pt6);
            if (dComp > 0)
            {
                float  stcomp = (compStr * (c - dComp)) / c;
                PointF pt7    = designChart.Point2D(new PointF(tensStr, h - dComp));
                PointF pt8    = designChart.Point2D(new PointF(tensStr + stcomp, h - dComp));
                DsgnGraphics.DrawLine(pt7, pt8);
            }
            //Draw texts

            string font = "pt Verenda";

            font = txtHeight + font;
            string txtTensStr = Math.Round(tensStr, 6).ToString();
            string txtCompStr = Math.Round(compStr, 5).ToString();

            DsgnGraphics.TextFont      = font;
            DsgnGraphics.TextBase      = TextBaseline.Bottom;
            DsgnGraphics.TextAlignment = TextAlign.Right;
            PointF txtpt = designChart.Point2D(new PointF(tensStr + compStr, h + txtOffset));

            DsgnGraphics.DrawText(compStr.ToString(), txtpt);
            txtpt = designChart.Point2D(new PointF(tensStr, h - d - txtOffset));
            DsgnGraphics.TextBase = TextBaseline.Top;
            DsgnGraphics.DrawText(tensStr.ToString(), txtpt);
            DimensionLine dim = new DimensionLine();

            ///
            DsgnGraphics.TextBase      = TextBaseline.Top;
            DsgnGraphics.TextAlignment = TextAlign.Center;
            DsgnGraphics.LineThickness = 1;
            DsgnGraphics.DrwColor      = "hotpink";
            dim.Graphic = DsgnGraphics;
            dim.DimDir  = DimensionLine.DimensionDirection.left;
            dim.DrawDimLineAligned(pt1, pt4, Math.Round(cb, 1).ToString());
            DsgnGraphics.TextBase = TextBaseline.Bottom;
            dim.DimDir            = DimensionLine.DimensionDirection.right;
            dim.DrawDimLineAligned(pt4, pt2, Math.Round(c, 1).ToString());
            dim.DrawOppoDimLine(pt0, pt2, Math.Round(d, 1).ToString());
        }
예제 #5
0
        protected void DrawRebar(DovDrawings graphic, ChartStyle cs)
        {
            float  x;
            float  y;
            float  radius;
            float  limitXNeg = -secRec.Width * 0.5f;
            float  limitXPos = secRec.Width * 0.5f;
            float  limitYNeg = -secRec.Height * 0.5f;
            float  limitYPos = secRec.Height * 0.5f;
            PointF loc;

            rebarLocLibrary = rebarLocLibrary.OrderBy(reb => reb.LocY).ToList();
            float locY  = 0;
            bool  start = true;

            RebarLocSorted.Clear();
            foreach (DovRebarLocation bars in rebarLocLibrary)
            {
                if (start)
                {
                    locY  = bars.LocY;
                    start = false;
                }
                if (locY == bars.LocY)
                {
                    if (!RebarLocSorted.ContainsKey(locY))
                    {
                        Stack <DovRebarLocation> bar = new Stack <DovRebarLocation>();
                        bar.Push(bars);
                        RebarLocSorted[locY] = bar;
                    }
                    else
                    {
                        RebarLocSorted[locY].Push(bars);
                    }
                }
                else
                {
                    locY = bars.LocY;
                    Stack <DovRebarLocation> bar = new Stack <DovRebarLocation>();
                    bar.Push(bars);
                    RebarLocSorted[locY] = bar;
                }
                x = bars.LocX;
                y = bars.LocY;
                if ((x < limitXNeg || x > limitXPos) || (y < limitYNeg || y > limitYPos))
                {
                    RebarLocationMessage = "Error: location is not within the boundary of the section";
                    RebarLocMsgColor     = "red";
                    continueDesign       = false;
                    break;
                }
                else
                {
                    graphic.DrwColor      = "white";
                    graphic.LineThickness = 2;
                    graphic.FillColorOpt  = "red";
                    RebarLocMsgColor      = "";
                    RebarLocationMessage  = "Enter Location of rebars";
                    radius = bars.Diameter * 0.5f;
                    radius = cs.ScaleX(radius);
                    loc    = cs.Point2D(new PointF(x, y));
                    graphic.DrawArc(loc.X, loc.Y, radius, 0, 2 * Math.PI);
                    continueDesign = true;
                }

                foreach (KeyValuePair <float, Stack <DovRebarLocation> > rebar in RebarLocSorted)
                {
                    re = rebar.Value.ToArray();
                    for (int i = 0; i < re.Length - 1; i++)
                    {
                        float xl = re[i].LocX;
                        for (int j = i + 1; j < re.Length; j++)
                        {
                            if (xl == re[j].LocX)
                            {
                                RebarLocationMessage = "Warning: There are dublicate of bars, one of them will be used.";
                                RebarLocMsgColor     = "red";
                            }
                        }
                    }
                }
            }
        }
예제 #6
0
        protected void IsoFootDetailOnPlan()
        {
            DimensionLine dim = new DimensionLine();

            DetailingGraphics = new DovDrawings(detailingContext);
            detailingChart    = new ChartStyle();
            float footW = DetailingCanvWidth;
            float footH = 0.6f * DetailingCanvHeight;

            detailingChart.ChartArea = new RectangleF(0, 0, footW, footH);
            float startX = 0;
            float startY = 0;

            DetailingGraphics.Clear(startX, startY, footW, footH);
            float limit = (footingData.Width > footingData.Length ? footingData.Width : footingData.Length);
            float xMax  = 0.5f * limit;
            float xMin  = -0.5f * limit;
            float yMax  = 0.5f * limit;
            float yMin  = -0.5f * limit;

            SetGraphicLayout(footW, footH, startX, startY, detailingChart, new float[] { xMin, xMax, yMin, yMax });
            PointF fPt1 = new PointF(-0.5f * footingData.Width, 0.5f * footingData.Length);
            PointF fPt2 = new PointF(0.5f * footingData.Width, -0.5f * footingData.Length);

            fPt1 = detailingChart.Point2D(fPt1);
            fPt2 = detailingChart.Point2D(fPt2);
            DetailingGraphics.FillColorOpt = "lightslategrey";
            DetailingGraphics.FillColor(fPt1, fPt2);
            DetailingGraphics.DrwColor = "dimgrey";
            DetailingGraphics.DrawRec(fPt1, fPt2);
            SetGraphicLayout(footW, footH, startX, startY, detailingChart, new float[] { xMin, xMax, yMin, yMax });
            PointF cPt1   = new PointF(footingData.ColLocX - 0.5f * footingData.Width + footingData.ColumnWidth * 0.5f, footingData.ColLocY - footingData.Length * 0.5f - 0.5f * footingData.ColumnLength);
            PointF cPt2   = new PointF(footingData.ColLocX - 0.5f * footingData.Width - footingData.ColumnWidth * 0.5f, footingData.ColLocY - footingData.Length * 0.5f + 0.5f * footingData.ColumnLength);
            PointF center = new PointF(footingData.ColLocX - 0.5f * footingData.Width, footingData.ColLocY - footingData.Length * 0.5f);

            cPt1   = detailingChart.Point2D(cPt1);
            cPt2   = detailingChart.Point2D(cPt2);
            center = detailingChart.Point2D(center);
            DetailingGraphics.FillColorOpt = "darkslategrey";
            DetailingGraphics.FillColor(cPt1, cPt2);
            DetailingGraphics.DrwColor = "dimgrey";
            DetailingGraphics.DrawRec(cPt1, cPt2);
            DetailingGraphics.DrwColor = "cadetblue";
            dim.Graphic = DetailingGraphics;
            dim.DimLoc  = DimensionLine.DimensionLocation.end;
            dim.DrawAdjDimLine(fPt1, fPt2, string.Format("W={0}", footingData.Width));
            dim.DimDir = DimensionLine.DimensionDirection.right;
            DetailingGraphics.TextBase = TextBaseline.Bottom;
            dim.DrawOppoDimLine(fPt1, fPt2, string.Format("L={0}", footingData.Length));
            fPt1 = new PointF(-0.5f * footingData.Width, -0.5f * footingData.Length);
            fPt1 = detailingChart.Point2D(fPt1);
            dim.DrawOppoDimLine(fPt1, center, string.Format("y={0}", footingData.ColLocY));
            ////dim.DimLoc = DimensionLine.DimensionLocation.end;
            //await dim.DrawAdjDimLine(fPt1, center, string.Format("x={0}", footingData.ColLocX));
            // drawing reinforcement
            // horizontal
            float thick      = footingData.Thickness;
            float w          = footingData.Width;
            float l          = footingData.Length;
            float c          = footingData.Cover * 0.1f;
            float dia        = footingData.Dia;
            float barArea    = (float)Math.PI * dia * dia / 4;
            int   nbar       = (int)Math.Ceiling(fDesign.Asy / barArea);
            int   barSpacing = 1000 / nbar;

            barSpacing = barSpacing.RoundDown();
            float  x   = footingData.ColLocX - 0.5f * w + 0.5f * footingData.ColumnWidth + thick - 2 * c;
            float  y1  = -(0.5f * l - c);
            float  y2  = (0.5f * l - c);
            PointF pt1 = new PointF(x, y1);
            PointF pt2 = new PointF(x, y2);
            PointF pt3 = new PointF(pt1.X - thick + 2 * c, pt1.Y);
            PointF pt4 = new PointF(pt2.X - thick + 2 * c, pt2.Y);

            pt1 = detailingChart.Point2D(pt1);
            pt2 = detailingChart.Point2D(pt2);
            pt3 = detailingChart.Point2D(pt3);
            pt4 = detailingChart.Point2D(pt4);
            DetailingGraphics.DrwColor = "red";
            DetailingGraphics.DrawLine(pt1, pt2);
            string spacing = string.Format("{0} c/c {1} mm", dia, barSpacing);

            DetailingGraphics.TextAlignment = TextAlign.Center;
            DetailingGraphics.TextBase      = TextBaseline.Hanging;
            DetailingGraphics.FillColorOpt  = "yellow";
            dim.DrawTextAtAngleMid(pt1, pt2, spacing);
            DetailingGraphics.DrawLine(pt1, pt3);
            DetailingGraphics.DrawLine(pt2, pt4);
            //vertical
            float y3 = footingData.ColLocY - 0.5f * l + 0.5f * footingData.ColumnLength + thick - 2 * c;
            float x1 = -(0.5f * w - c);
            float x2 = (0.5f * w - c);

            nbar       = (int)Math.Ceiling(fDesign.Asx / barArea);
            barSpacing = 1000 / nbar;
            barSpacing = barSpacing.RoundDown();
            pt1        = new PointF(x1, y3);
            pt2        = new PointF(x2, y3);
            pt3        = new PointF(pt1.X, pt1.Y - thick + 2 * c);
            pt4        = new PointF(pt2.X, pt2.Y - thick + 2 * c);
            pt1        = detailingChart.Point2D(pt1);
            pt2        = detailingChart.Point2D(pt2);
            pt3        = detailingChart.Point2D(pt3);
            pt4        = detailingChart.Point2D(pt4);
            DetailingGraphics.DrawLine(pt1, pt2);
            spacing = string.Format("{0} c/c {1} mm", dia, barSpacing);
            DetailingGraphics.TextAlignment = TextAlign.Center;
            DetailingGraphics.TextBase      = TextBaseline.Bottom;
            dim.DrawTextAtAngleMid(pt1, pt2, spacing);
            DetailingGraphics.DrawLine(pt1, pt3);
            DetailingGraphics.DrawLine(pt2, pt4);
        }
예제 #7
0
        protected void IsoFootDetailOnElev()
        {
            DimensionLine dim = new DimensionLine();

            DetailingGraphics = new DovDrawings(detailingContext);
            detailingChart    = new ChartStyle();
            dim.Graphic       = DetailingGraphics;
            float footW = DetailingCanvWidth;
            float footH = 0.4f * DetailingCanvHeight;

            detailingChart.ChartArea = new RectangleF(0, 0, footW, footH);
            float startX = 0;
            float startY = 0.6f * DetailingCanvHeight;

            DetailingGraphics.Clear(startX, startY, footW, footH);
            float limit = footingData.Width;
            float xMax  = 0.5f * limit;
            float xMin  = -0.5f * limit;
            float yMax  = 0.5f * footingData.Thickness;
            float yMin  = -2 * footingData.Thickness;

            SetGraphicLayout(footW, footH, startX, startY, detailingChart, new float[] { xMin, xMax, yMin, yMax });

            float  thick = footingData.Thickness;
            float  w     = footingData.Width;
            float  l     = footingData.Length;
            float  c     = footingData.Cover * 0.1f;
            float  dia   = footingData.Dia;
            float  locX  = footingData.ColLocX;
            float  locY  = footingData.ColLocY;
            float  cw    = footingData.ColumnWidth;
            float  cl    = footingData.ColumnLength;
            PointF fPt1  = new PointF(-0.5f * footingData.Width, 0f);
            PointF fPt2  = new PointF(0.5f * footingData.Width, -footingData.Thickness);

            fPt1 = detailingChart.Point2D(fPt1);
            fPt2 = detailingChart.Point2D(fPt2);
            DetailingGraphics.FillColorOpt = "lightslategrey";
            DetailingGraphics.FillColor(fPt1, fPt2);
            DetailingGraphics.DrwColor = "dimgrey";
            //await DetailingGraphics.DrawRecAsync(fPt1, fPt2);
            PointF pt1 = new PointF(-0.5f * w, 0f);
            PointF pt2 = new PointF(locX - 0.5f * w - 0.5f * cw, 0);
            PointF pt3 = new PointF(locX - 0.5f * w - 0.5f * cw, 0.5f * thick);
            PointF pt4 = new PointF(locX - 0.5f * w + 0.5f * cw, 0.5f * thick);
            PointF pt5 = new PointF(locX - 0.5f * w + 0.5f * cw, 0);
            PointF pt6 = new PointF(0.5f * w, 0);
            PointF pt7 = new PointF(0.5f * w, -thick);
            PointF pt8 = new PointF(-0.5f * w, -thick);

            PointF[] pts = new PointF[] { pt1, pt2, pt3, pt4, pt5, pt6, pt7, pt8 };
            for (int i = 0; i < pts.Length; i++)
            {
                pts[i] = detailingChart.Point2D(pts[i]);
            }
            DetailingGraphics.FillPolygone(pts);
            dim.DrawDimLineAligned(pts[0], pts[7], thick.ToString());
            dim.DrawDimLineAligned(pts[6], pts[7], w.ToString());
            dim.DimDir = DimensionLine.DimensionDirection.right;
            DetailingGraphics.TextBase = TextBaseline.Bottom;
            dim.DrawDimLineAligned(pts[0], pts[1], (footingData.ColLocX - 0.5f * cw).ToString());
            DetailingGraphics.DrwColor = "red";
            pt1 = new PointF(-0.5f * w + c, -thick + c);
            pt2 = new PointF(0.5f * w - c, -thick + c);
            pt3 = new PointF(pt1.X, pt1.Y + thick - 2 * c);
            pt4 = new PointF(pt2.X, pt2.Y + thick - 2 * c);
            pt1 = detailingChart.Point2D(pt1);
            pt2 = detailingChart.Point2D(pt2);
            DetailingGraphics.DrawLine(pt1, pt2);
            pt3 = detailingChart.Point2D(pt3);
            pt4 = detailingChart.Point2D(pt4);
            DetailingGraphics.DrawLine(pt1, pt3);
            DetailingGraphics.DrawLine(pt2, pt4);
            //Drawing column bars
            pt5 = new PointF(locX - 0.5f * w - 0.5f * cw + c, -thick + c + 3 * dia * 0.1f);
            pt6 = new PointF(locX - 0.5f * w - 0.5f * cw + c, 0.5f * thick);
            pt7 = new PointF(locX - 0.5f * w + 0.5f * cw - c, -thick + c + 3 * dia * 0.1f);
            pt8 = new PointF(locX - 0.5f * w + 0.5f * cw - c, 0.5f * thick);
            //47 factor for development length
            PointF pt9  = new PointF(pt5.X - 47 * dia * 0.1f, pt5.Y);
            PointF pt10 = new PointF(pt7.X + 47 * dia * 0.1f, pt7.Y);

            pt9  = detailingChart.Point2D(pt9);
            pt10 = detailingChart.Point2D(pt10);
            pt5  = detailingChart.Point2D(pt5);
            pt6  = detailingChart.Point2D(pt6);
            pt7  = detailingChart.Point2D(pt7);
            pt8  = detailingChart.Point2D(pt8);
            DetailingGraphics.DrawLine(pt5, pt6);
            DetailingGraphics.DrawLine(pt7, pt8);
            DetailingGraphics.DrawLine(pt5, pt9);
            DetailingGraphics.DrawLine(pt7, pt10);
            pt1 = detailingChart.Point2D(new PointF(-0.5f * w + c, -2 * thick));
            pt2 = detailingChart.Point2D(new PointF(0.5f * w - c, -2 * thick));
            pt3 = detailingChart.Point2D(new PointF(-0.5f * w + c, -thick - 2 * c));
            pt4 = detailingChart.Point2D(new PointF(0.5f * w - c, -thick - 2 * c));
            DetailingGraphics.DrawLine(pt1, pt2);
            DetailingGraphics.DrwColor = "dimgrey";
            dim.DimDir = DimensionLine.DimensionDirection.left;
            DetailingGraphics.TextBase = TextBaseline.Hanging;
            dim.DrawDimLineAligned(pt1, pt2, (w - 2 * c).ToString());
            DetailingGraphics.DrwColor = "red";
            DetailingGraphics.DrawLine(pt1, pt3);
            dim.DimDir = DimensionLine.DimensionDirection.right;
            DetailingGraphics.DrwColor = "dimgrey";
            DetailingGraphics.TextBase = TextBaseline.Bottom;
            dim.DrawDimLineAligned(pt1, pt3, (thick - 2 * c).ToString());
            DetailingGraphics.DrwColor = "red";
            DetailingGraphics.DrawLine(pt2, pt4);
            float barArea    = (float)Math.PI * dia * dia / 4;
            int   nbar       = (int)Math.Ceiling(fDesign.Asy / barArea);
            int   barSpacing = 1000 / nbar;

            barSpacing = barSpacing.RoundDown() / 10;
            for (int i = (int)(2 * c); i < (w - 2 * c); i += barSpacing)
            {
                float  start = -0.5f * (w - 2 * c);
                float  y     = -(thick - c - 1.5f * dia * 0.1f);
                float  x     = start + i;
                PointF pt    = new PointF(x, y);
                pt = detailingChart.Point2D(pt);
                DetailingGraphics.DrawArc(pt.X, pt.Y, 1.5f * dia * 0.1f, 0, 2 * Math.PI);
            }
        }
예제 #8
0
        public void DrawNeutralAxisLoc()
        {
            NeutralAxisGraphics.DrwColor      = "white";
            NeutralAxisGraphics.LineThickness = 2;
            neutralAxisChart.ChartArea        = new RectangleF(0, 0, ClmnNeutralAxisWidth, ClmnNeutralAxisHeight);
            float[] scaleLimits = new float[] { -0.5f * secRec.Width, 0.5f * secRec.Width,
                                                -0.5f * secRec.Height, 0.5f * secRec.Height };
            SetGraphicLayout(ClmnNeutralAxisWidth, ClmnNeutralAxisHeight, 0, neutralAxisChart, scaleLimits);
            float x1, x2, x3, x4, y1, y2, y3, y4;
            float angleRad = ((float)Math.PI * ColumnNeutralAxisAngle) / 180;
            float x, y;
            float x0, y0;
            float limitAngle = (float)Math.Atan(secRec.Height / secRec.Width);

            x0 = 0;
            y0 = 0;
            x  = 0.5f * secRec.Width;
            y  = 0.5f * secRec.Height;
            y1 = (float)Math.Tan(angleRad) * (-x - x0) + y0;
            x1 = -x;
            x2 = x;
            y2 = (float)Math.Tan(angleRad) * (x - x0) + y0;
            x3 = x;
            y3 = y;
            x4 = -x;
            y4 = y;
            if (angleRad > limitAngle)
            {
                x0 = 0;
                y0 = 0;
                x  = 0.5f * secRec.Width;
                y  = 0.5f * secRec.Height;
                y1 = -y;
                x1 = ((y1 - y0) / (float)Math.Tan(angleRad)) + x0;

                y2 = y;
                x2 = ((y2 - y0) / (float)Math.Tan(angleRad)) + x0;
                x3 = -x;
                y3 = y;
                x4 = -x;
                y4 = -y;
            }
            PointF pt1 = neutralAxisChart.Point2D(new PointF(x1, y1));
            PointF pt2 = neutralAxisChart.Point2D(new PointF(x2, y2));

            PointF[] pts = new PointF[] { neutralAxisChart.Point2D(new PointF(x1, y1)),
                                          neutralAxisChart.Point2D(new PointF(x2, y2)),
                                          neutralAxisChart.Point2D(new PointF(x3, y3)),
                                          neutralAxisChart.Point2D(new PointF(x4, y4)) };
            NeutralAxisGraphics.DrwColor     = "black";
            NeutralAxisGraphics.FillColorOpt = "red";

            NeutralAxisGraphics.FillColor(neutralAxisChart.Point2D(new PointF(x, y)), neutralAxisChart.Point2D(new PointF(-x, -y)));
            NeutralAxisGraphics.DrawLine(neutralAxisChart.Point2D(new PointF(x1, y1)), neutralAxisChart.Point2D(new PointF(x2, y2)));
            NeutralAxisGraphics.FillColorOpt = "yellow";
            NeutralAxisGraphics.FillPolygone(pts);
            NeutralAxisGraphics.DrawLine(neutralAxisChart.Point2D(new PointF(0, 0)), neutralAxisChart.Point2D(new PointF(x, 0)));
            PointF start       = neutralAxisChart.Point2D(new PointF(0, 0));
            float  r           = 30f;
            float  adj         = (float)Math.Round(pt2.X - pt1.X, 3);// this one has to be revised;
            float  opp         = pt2.Y - pt1.Y;
            float  scaledAngle = 90 * (float)Math.PI / 180;

            // this is a quation
            test1 = (float)Math.Tan(scaledAngle);
            if (adj != 0)
            {
                scaledAngle = (float)Math.Atan(opp / adj);
                if (scaledAngle != 0)
                {
                    PointF orig = neutralAxisChart.Point2D(new PointF(0, 0));
                    float  xa   = (r * (float)Math.Cos(scaledAngle));
                    float  xr   = orig.X + xa;
                    float  yr   = orig.Y + (r * (float)Math.Sin(scaledAngle));
                    float  incr = (r - xa) / 6;

                    float xc = xr;
                    float yc = yr;
                    for (float i = xr + incr; i <= orig.X + r; i += incr)
                    {
                        float rsq   = r * r;
                        float xsq   = (i - orig.X) * (i - orig.X);
                        float xnext = i;
                        float ynext = -(float)Math.Sqrt(rsq - xsq) + orig.Y;
                        NeutralAxisGraphics.DrawLine(xc, yc, xnext, ynext);
                        xc = xnext;
                        yc = ynext;
                    }
                }
            }
        }