Ejemplo n.º 1
0
        public C_Raud(G.Line main, G.Line side, int nr, int d, string teras) : base(main, nr, d, teras)
        {
            G.Vector mainDir = main.getDirectionVector();
            G.Polar  mainPol = G.Converter.xy_to_la(mainDir);

            G.Vector sideDir = side.getDirectionVector();
            G.Polar  sidePol = G.Converter.xy_to_la(sideDir);

            _A = shorter(side.Length());
            _B = shorter(main.Length());
            _U = G.Converter.AngleDelta(mainPol.angle, sidePol.angle);

            _IP     = main.Start;
            _Length = _A + _B;

            //OVERRIDE
            G.Vector dir           = main.getDirectionVector();
            double   shorterLength = shorter(main.Length());

            _StartPoint = main.Start;
            _EndPoint   = _StartPoint.move(shorterLength, dir);
            //OVERRIDE

            G.Vector v1 = -1 * side.getDirectionVector();
            _SidePoint = _StartPoint.move(_A, v1);
        }
Ejemplo n.º 2
0
        public D_Raud(G.Line side1, int z_dist, int nr, int d, string teras) : base(side1, nr, d, teras)
        {
            _A  = shorter(side1.Length());
            _B  = shorter(z_dist); // parand magic
            _B2 = _B;              // parand magic
            _C  = shorter(side1.Length());

            _IP     = side1.getCenterPoint();
            _Length = _A + _B + _C;
        }
Ejemplo n.º 3
0
        private void define_side_D(LineSegment seg)
        {
            G.Line ln         = seg.getLine();
            G.Line offsetLine = ln.Offset(_V_.X_CONCRETE_COVER_1);

            G.Vector d1 = ln.getDirectionVector();
            G.Vector o1 = ln.getOffsetVector();

            double absX = Math.Abs(o1.X);
            double absY = Math.Abs(o1.Y);

            G.Vector absV = new G.Vector(absX, absY);
            G.Polar  p    = G.Converter.xy_to_la(absV);

            int spacing;
            int distance;
            int parand; // parand magic

            if (p.angle < Math.PI / 4)
            {
                spacing  = _V_.X_REINFORCEMENT_SIDE_D_SPACING;
                distance = _V_.X_REINFORCEMENT_SIDE_D_ANCHOR_LENGTH;
                parand   = _V_.X_REINFORCEMENT_SIDE_D_FIX;
            }
            else
            {
                spacing  = _V_.X_REINFORCEMENT_TOP_D_SPACING;
                distance = _V_.X_REINFORCEMENT_TOP_D_ANCHOR_LENGTH;
                parand   = _V_.X_REINFORCEMENT_TOP_D_FIX;
            }

            double nearEdge    = _V_.X_CONCRETE_COVER_1 * 2.5;
            double equalSpacer = ((ln.Length() - 2 * nearEdge) % spacing) / 2;

            double j   = nearEdge + equalSpacer;
            double len = ln.Length();

            if ((len - nearEdge * 2) > spacing)
            {
                R.Raud_Array rauad = new R.Raud_Array(spacing);
                knownArrayReinforcement.Add(rauad);

                while (j < len)
                {
                    G.Point start = offsetLine.Start.move(j, d1);
                    G.Point end   = start.move(distance, o1);

                    D_side_handler(start, end, parand); // parand magic
                    j = j + spacing;
                }

                D_side_garbage_collector();
            }
        }
Ejemplo n.º 4
0
        //B HANDLE
        private bool B_vs_C_handler(G.Point mainPoint, G.Point mainEnd, G.Point sideStart, G.Edge e, G.Corner oc)
        {
            G.Line main = new G.Line(mainPoint, mainEnd);
            G.Line side = new G.Line(sideStart, mainPoint);

            G.Line temp1 = trimLine_basepoint(main, mainPoint);
            if (temp1.Length() > main.Length() * _V_.M_TRIM_TOLERANCE)
            {
                main = temp1.Copy();
            }
            if (denier(main))
            {
                return(false);
            }

            G.Line temp2 = trimLine_basepoint(side, mainPoint);
            if (temp2.Length() > side.Length() * _V_.M_TRIM_TOLERANCE)
            {
                side = temp2.Copy();
            }
            if (denier(side))
            {
                return(false);
            }

            if (main.Length() < _V_.Y_REINFORCEMENT_MAIN_RADIUS)
            {
                return(false);
            }
            if (side.Length() < _V_.Y_REINFORCEMENT_MAIN_RADIUS)
            {
                return(false);
            }

            G.Vector v1 = main.getDirectionVector();
            G.Vector v2 = side.getDirectionVector();

            double ang = G.Converter.AngleDeltaCW(v1, v2);

            if (Math.Abs(ang - Math.PI / 2) < _V_.M_B_BAR_TOLERANCE)
            {
                R.B_Raud reinf = new R.B_Raud(main, side, _V_.X_REINFORCEMENT_NUMBER, _V_.X_REINFORCEMENT_MAIN_DIAMETER, _V_.X_REINFORCEMENT_MARK);
                keep(reinf, e, oc, null);
            }
            else
            {
                R.C_Raud reinf = new R.C_Raud(main, side, _V_.X_REINFORCEMENT_NUMBER, _V_.X_REINFORCEMENT_MAIN_DIAMETER, _V_.X_REINFORCEMENT_MARK);
                keep(reinf, e, oc, null);
            }

            return(true);
        }
        private void define_side_U(LineSegment seg)
        {
            G.Line mainLine  = seg.getLine();
            G.Line otherLine = seg.getOtherLine();

            if (setLineSegment.Contains(seg))
            {
                return;
            }
            if (isLineRight(mainLine) == false && isLineRight(otherLine) == true)
            {
                return;
            }

            G.Vector d1      = mainLine.getDirectionVector();
            G.Vector o1      = mainLine.getOffsetVector();
            int      spacing = _V_.X_REINFORCEMENT_STIRRUP_SPACING;

            double nearEdge    = _V_.X_CONCRETE_COVER_1 * 1.2;
            double equalSpacer = ((mainLine.Length() - 2 * nearEdge) % spacing) / 2;

            double j   = nearEdge + equalSpacer;
            double len = mainLine.Length();

            if ((len - nearEdge * 2) > spacing)
            {
                R.Raud_Array rauad = new R.Raud_Array(spacing);
                knownArrayReinforcement.Add(rauad);

                while (j < len)
                {
                    G.Point start    = mainLine.Start.move(j, d1);
                    G.Point extended = start.move(_V_.Y_STIRRUP_MAX_LENGTH * 1.1, o1);
                    G.Line  temp     = new G.Line(start, extended);
                    G.Point end      = G.Line.getIntersectionPoint(temp, otherLine);

                    temp = new G.Line(start, end);

                    if (Math.Round(temp.Length(), 0) > _V_.X_CONCRETE_COVER_1 * 2)
                    {
                        temp = temp.extendDouble(-1 * _V_.X_CONCRETE_COVER_1);

                        U_side_handler(temp.Start, temp.End, seg);
                    }

                    j = j + spacing;
                }

                U_side_garbage_collector();
            }
        }
Ejemplo n.º 6
0
        public D_Raud(G.Line main, G.Line side1, G.Line side2, int nr, int d, string teras, int parand = 0) : base(main, nr, d, teras)
        {
            _A  = shorter(side1.Length());
            _B  = shorter(main.Length());
            _B2 = shorter(main.Length() + parand); // parand magic
            _C  = shorter(side2.Length());

            _IP     = main.getCenterPoint();
            _Length = _A + _B2 + _C; // parand magic

            G.Vector v1 = -1 * side1.getDirectionVector();
            _Side1Point = _StartPoint.move(_A, v1);

            G.Vector v2 = side2.getDirectionVector();
            _Side2Point = _EndPoint.move(_C, v2);
        }
Ejemplo n.º 7
0
        public A_Raud(G.Line main, int nr, int d, string teras) : base(main, nr, d, teras)
        {
            _A = shorter(main.Length());

            _IP     = main.getCenterPoint();
            _Length = _A;
        }
Ejemplo n.º 8
0
        public static E_Raud mergeTwoRebar_long(C_Raud one, C_Raud two)
        {
            G.Point a = one._SidePoint;
            G.Point b = one.StartPoint;
            G.Point c = two.StartPoint;
            G.Point d = two._EndPoint;

            G.Line temp1 = new G.Line(a, b);
            G.Line main  = new G.Line(b, c);
            G.Line temp2 = new G.Line(c, d);

            double s1  = temp1.Length();
            double s2  = temp2.Length();
            double max = Math.Max(s1, s2);

            G.Vector v1 = (-1) * temp1.getDirectionVector();
            G.Vector v2 = temp2.getDirectionVector();

            G.Point new_a = b.move(max, v1);
            G.Point new_d = c.move(max, v2);

            G.Line side1 = new G.Line(new_a, b);
            G.Line side2 = new G.Line(c, new_d);

            E_Raud raud = new E_Raud(main, side1, side2, one.Number, one.Diameter, one.Materjal);

            return(raud);
        }
Ejemplo n.º 9
0
        private double calcAngle(Edge end, Edge start)
        {
            Vector p1 = end.Line.getDirectionVector();
            Vector p2 = start.Line.getDirectionVector();

            if (p1 == p2)
            {
                return(Math.PI);
            }

            Line   la = new Line(end.Line.Start, start.Line.End);
            double b  = end.Line.Length();
            double c  = start.Line.Length();
            double a  = la.Length();

            double cosA    = (Math.Pow(b, 2) + Math.Pow(c, 2) - Math.Pow(a, 2)) / (2 * b * c);
            double cosAmod = Math.Max(Math.Min(cosA, 0.9999999999999), -0.9999999999999);

            double A = Math.Acos(cosAmod);

            Point ccp = la.getCenterPoint();
            Point ecp = end.Line.Offset(10).getCenterPoint();

            Line aa = new Line(ccp, ecp);
            Line bb = end.Line.extendDouble(10 * start.Line.Length());

            if (Line.hasIntersection(aa, bb))
            {
                A = 2 * Math.PI - A;
            }

            return(A);
        }
Ejemplo n.º 10
0
        public E_Raud(G.Line main, G.Line side1, G.Line side2, int nr, int d, string teras, int parand = 0) : base(main, nr, d, teras)
        {
            G.Vector mainDir = main.getDirectionVector();
            G.Polar  mainPol = G.Converter.xy_to_la(mainDir);

            G.Vector sideDir1 = side1.getDirectionVector();
            G.Polar  sidePol1 = G.Converter.xy_to_la(sideDir1);

            G.Vector sideDir2 = side2.getDirectionVector();
            G.Polar  sidePol2 = G.Converter.xy_to_la(sideDir2);

            _A  = shorter(side1.Length());
            _B  = shorter(main.Length());
            _B2 = shorter(main.Length() + parand); // parand magic
            _C  = shorter(side2.Length());

            G.Vector perpendVector = mainDir.rotate(-Math.PI / 2);
            double   maxDist       = Math.Max(_A, _C) * 2;

            G.Line mainExtended = main.extendDouble(maxDist);

            G.Point movePoint1   = side1.Start.move(maxDist, perpendVector);
            G.Line  perpendLine1 = new G.Line(side1.Start, movePoint1);
            G.Point interPoint1  = G.Line.getIntersectionPoint(mainExtended, perpendLine1);
            G.Line  XLine        = new G.Line(side1.Start, interPoint1);

            G.Point movePoint2   = side2.End.move(maxDist, perpendVector);
            G.Line  perpendLine2 = new G.Line(side2.End, movePoint2);
            G.Point interPoint2  = G.Line.getIntersectionPoint(mainExtended, perpendLine2);
            G.Line  YLine        = new G.Line(side2.End, interPoint2);

            _U = G.Converter.AngleDelta(mainPol.angle, sidePol1.angle);
            _V = G.Converter.AngleDelta(mainPol.angle, sidePol2.angle);
            _X = XLine.Length();
            _Y = YLine.Length();

            _IP     = main.getCenterPoint();
            _Length = _A + _B2 + _C; // parand magic

            G.Vector v1 = -1 * side1.getDirectionVector();
            _Side1Point = _StartPoint.move(_A, v1);

            G.Vector v2 = side2.getDirectionVector();
            _Side2Point = _EndPoint.move(_C, v2);
        }
Ejemplo n.º 11
0
        public Raud(G.Line main, int nr, int d, string teras)
        {
            G.Vector dir = main.getDirectionVector();
            G.Polar  pol = G.Converter.xy_to_la(dir);

            _Rotation = G.Converter.Wrap(pol.angle, Math.PI * 2, 0.0);

            _Number   = nr;
            _Diameter = d;
            _Materjal = teras;

            double shorterLength  = shorter(main.Length());
            double originalLength = main.Length();
            double delta          = (originalLength - shorterLength) / 2;

            _StartPoint = main.Start.move(delta, dir);
            _EndPoint   = _StartPoint.move(shorterLength, dir);
        }
Ejemplo n.º 12
0
        public B_Raud(G.Line main, G.Line side, int nr, int d, string teras) : base(main, nr, d, teras)
        {
            _A = shorter(side.Length());
            _B = shorter(main.Length());

            _IP     = main.Start;
            _Length = _A + _B;

            //OVERRIDE
            G.Vector dir           = main.getDirectionVector();
            double   shorterLength = shorter(main.Length());

            _StartPoint = main.Start;
            _EndPoint   = _StartPoint.move(shorterLength, dir);
            //OVERRIDE

            G.Vector v1 = -1 * side.getDirectionVector();
            _SidePoint = _StartPoint.move(_A, v1);
        }
Ejemplo n.º 13
0
        private List <LineSegment> line_segmentator(G.Edge e)
        {
            List <LineSegment> tempList    = new List <LineSegment>();
            List <LineSegment> segmentList = new List <LineSegment>();

            G.Line main = e.Line.Offset(G._Variables.EQUALS_TOLERANCE + 0.001);

            G.Vector d1 = e.Line.getDirectionVector();
            G.Vector o1 = e.Line.getOffsetVector();

            double delta = _V_.M_LINE_SEGMENTATOR_STEP;
            double j     = 1;
            double len   = main.Length() - (j * 2);

            while (j < len)
            {
                G.Point checkStartPoint = main.Start.move(j, d1);
                G.Point checkEndPoint   = checkStartPoint.move(_V_.Y_STIRRUP_MAX_LENGTH, o1);
                G.Line  checkLine       = new G.Line(checkStartPoint, checkEndPoint);

                G.Edge trimmerEdge = null;
                bool   check       = trimmer_basepoint(checkLine, checkStartPoint, ref trimmerEdge);

                if (tempList.Count == 0)
                {
                    LineSegment temp = new LineSegment(checkStartPoint, e, trimmerEdge);
                    tempList.Add(temp);
                }
                else
                {
                    if (tempList[tempList.Count - 1].compareSegments(trimmerEdge))
                    {
                        tempList[tempList.Count - 1].updateSegment(checkStartPoint);
                    }
                    else
                    {
                        LineSegment temp = new LineSegment(checkStartPoint, e, trimmerEdge);
                        tempList.Add(temp);
                    }
                }

                j = j + delta;
            }

            foreach (LineSegment temp in tempList)
            {
                if (temp.checkValid())
                {
                    segmentList.Add(temp);
                }
            }

            return(segmentList);
        }
Ejemplo n.º 14
0
        public U_Raud(G.Line side1, int z_dist, int nr, int d, string teras) : base(side1, nr, d, teras)
        {
            if (d > 16)
            {
                _A = shorter(d * 14.5);
            }
            else
            {
                _A = shorter(d * 13);
            }

            _B = shorter(z_dist);
            _C = shorter(side1.Length());

            _IP     = side1.getCenterPoint();
            _Length = _A + _B + _C;
        }
Ejemplo n.º 15
0
        private bool U_side_handler(G.Point start, G.Point end, LineSegment ls)
        {
            G.Line side = new G.Line(start, end);
            if (side.Length() < _V_.Y_REINFORCEMENT_STIRRUP_RADIUS * 2)
            {
                return(false);
            }

            if (denier(side))
            {
                return(false);
            }

            //reinf_geometry_debug.Add(side);

            R.U_Raud cur = new R.U_Raud(side, _V_.Y_ELEMENT_WIDTH_COVER, 1, _V_.X_REINFORCEMENT_STIRRUP_DIAMETER, _V_.X_REINFORCEMENT_MARK);

            int currentIndex = knownArrayReinforcement.Count - 1;

            knownArrayReinforcement[currentIndex].add_one(cur);
            keep_array(cur, ls);

            return(true);
        }
Ejemplo n.º 16
0
        //D HANDLE
        private bool D_vs_E_handler(G.Point mainPoint, G.Point mainEnd, G.Point side1Start, G.Point side2End, G.Edge e, G.Corner c1, G.Corner c2, int parand, G.Edge other = null, G.Edge other2 = null)
        {
            G.Line main  = new G.Line(mainPoint, mainEnd);
            G.Line side1 = new G.Line(side1Start, mainPoint);
            G.Line side2 = new G.Line(mainEnd, side2End);

            if (main.Length() < _V_.Y_REINFORCEMENT_MAIN_RADIUS * 1.99)
            {
                return(false);
            }

            //reinf_geometry_debug.Add(main);
            //reinf_geometry_debug.Add(side1);
            //reinf_geometry_debug.Add(side2);

            G.Vector v1 = main.getDirectionVector();
            G.Vector v2 = side1.getDirectionVector();
            G.Vector v3 = side2.getDirectionVector();

            double ang1 = G.Converter.AngleDeltaCW(v1, v2);
            double ang2 = G.Converter.AngleDeltaCW(v1, v3);

            bool d1 = Math.Abs(ang1 - Math.PI / 2) < _V_.M_B_BAR_TOLERANCE;
            bool d2 = Math.Abs(ang2 - 3 * Math.PI / 2) < _V_.M_B_BAR_TOLERANCE;

            if (d1 && d2)
            {
                R.D_Raud reinf = new R.D_Raud(main, side1, side2, _V_.X_REINFORCEMENT_NUMBER, _V_.X_REINFORCEMENT_MAIN_DIAMETER, _V_.X_REINFORCEMENT_MARK, parand);

                if (denier(reinf.makeMainLine()))
                {
                    return(false);
                }
                if (denier(reinf.makeSide1Line()))
                {
                    return(false);
                }
                if (denier(reinf.makeSide2Line()))
                {
                    return(false);
                }

                keep(reinf, e, c1, c2);
                keep_double(reinf, other);
                keep_double(reinf, other2);
            }
            else
            {
                R.E_Raud reinf = new R.E_Raud(main, side1, side2, _V_.X_REINFORCEMENT_NUMBER, _V_.X_REINFORCEMENT_MAIN_DIAMETER, _V_.X_REINFORCEMENT_MARK, parand);

                if (denier(reinf.makeMainLine()))
                {
                    return(false);
                }
                if (denier(reinf.makeSide1Line()))
                {
                    return(false);
                }
                if (denier(reinf.makeSide2Line()))
                {
                    return(false);
                }

                keep(reinf, e, c1, c2);
                keep_double(reinf, other);
                keep_double(reinf, other2);
            }

            return(true);
        }
Ejemplo n.º 17
0
        private void create_trimmed_short_A()
        {
            List <G.Edge> emptyEdges = allEdges.Where(x => !setEdges.Keys.Contains(x)).ToList();

            emptyEdges = emptyEdges.OrderBy(b => b.Line.Length()).ToList();

            foreach (G.Edge e in emptyEdges)
            {
                if (setEdges.Keys.Contains(e))
                {
                    continue;
                }
                if (narrow_denier(e))
                {
                    continue;
                }


                G.Edge temp = null;
                G.Line main = e.edgeOffset(_V_.X_CONCRETE_COVER_1, _V_.X_CONCRETE_COVER_1, _V_.X_CONCRETE_COVER_1);
                main = trimLine_baseline(main, main.Copy(), _V_.X_CONCRETE_COVER_2, e, ref temp);


                bool   startTrimmed     = false;
                G.Edge startTrimmerEdge = null;
                if (e.StartCorner.Angle > Math.PI)
                {
                    G.Line extended = main.extendStart(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH);
                    G.Line trimmed  = trimLine_basepoint(extended, main.End, _V_.X_CONCRETE_COVER_2, e, ref startTrimmerEdge);
                    if (trimmed.Length() < main.Length() + _V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * _V_.M_TRIM_TOLERANCE)
                    {
                        startTrimmed = true;
                    }
                    main = trimmed;
                }


                bool   endTrimmed     = false;
                G.Edge endTrimmerEdge = null;
                if (e.EndCorner.Angle > Math.PI)
                {
                    G.Line extended = main.extendEnd(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH);
                    G.Line trimmed  = trimLine_basepoint(extended, main.Start, _V_.X_CONCRETE_COVER_2, e, ref endTrimmerEdge);
                    if (trimmed.Length() < main.Length() + _V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * _V_.M_TRIM_TOLERANCE)
                    {
                        endTrimmed = true;
                    }
                    main = trimmed;
                }


                if (main.Length() <= _V_.Y_REINFORCEMENT_MAIN_MIN_LENGTH)
                {
                    if (startTrimmed && endTrimmed)
                    {
                        bool got_D = define_D(e, startTrimmerEdge, endTrimmerEdge);

                        if (got_D == false)
                        {
                            G.Vector v1 = main.getOffsetVector();
                            G.Vector v2 = startTrimmerEdge.Line.getCoolVector(v1);
                            G.Vector v3 = endTrimmerEdge.Line.getCoolVector(v1);

                            G.Point side1Point = main.Start.move(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * 1.05, v2);
                            G.Point side2Point = main.End.move(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * 1.05, v3);

                            G.Line side1 = new G.Line(side1Point, main.Start);
                            G.Line side2 = new G.Line(main.End, side2Point);

                            if (denier(side1) && denier(side2))
                            {
                                G.Point AP     = main.Start.move(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * 1.5, v2);
                                G.Line  b_line = new G.Line(main.Start, AP);

                                G.Edge side1TrimmerEdge = null;
                                G.Line side1Main        = trimLine_basepoint(b_line, main.Start, _V_.X_CONCRETE_COVER_2, e, ref side1TrimmerEdge);

                                G.Point AP2     = main.End.move(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * 1.5, v3);
                                G.Line  b_line2 = new G.Line(main.End, AP2);

                                G.Edge side2TrimmerEdge = null;
                                G.Line side2Main        = trimLine_basepoint(b_line2, main.End, _V_.X_CONCRETE_COVER_2, e, ref side2TrimmerEdge);

                                A_handler(main.Start, main.End, e, null, _V_.X_REINFORCEMENT_MAIN_DIAMETER);
                                define_D(startTrimmerEdge, side1TrimmerEdge, e);
                                define_D(endTrimmerEdge, e, side2TrimmerEdge);
                            }
                            else if (denier(side1))
                            {
                                G.Point AP     = main.Start.move(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * 1.5, v2);
                                G.Line  b_line = new G.Line(main.Start, AP);

                                G.Edge sideTrimmerEdge = null;
                                G.Line newMain         = trimLine_basepoint(b_line, main.Start, _V_.X_CONCRETE_COVER_2, e, ref sideTrimmerEdge);

                                B_vs_C_handler(main.End, side2Point, main.Start, e, null);
                                define_D(startTrimmerEdge, sideTrimmerEdge, e);
                            }
                            else if (denier(side2))
                            {
                                G.Point AP     = main.End.move(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * 1.5, v2);
                                G.Line  b_line = new G.Line(main.End, AP);

                                G.Edge sideTrimmerEdge = null;
                                G.Line newMain         = trimLine_basepoint(b_line, main.End, _V_.X_CONCRETE_COVER_2, e, ref sideTrimmerEdge);

                                define_D(endTrimmerEdge, e, sideTrimmerEdge);
                                B_vs_C_handler(main.Start, main.End, side1Point, e, null);
                            }
                        }
                    }
                    else if (startTrimmed)
                    {
                        bool got_B = define_B(e, startTrimmerEdge);

                        if (got_B == false)
                        {
                            G.Vector v1 = e.Line.getOffsetVector();
                            G.Vector v2 = startTrimmerEdge.Line.getCoolVector(v1);

                            G.Point AP     = main.Start.move(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * 2, v2);
                            G.Line  b_line = new G.Line(main.Start, AP);

                            G.Edge sideTrimmerEdge = null;
                            G.Line newMain         = trimLine_basepoint(b_line, main.Start, _V_.X_CONCRETE_COVER_2, e, ref sideTrimmerEdge);

                            if (sideTrimmerEdge != null)
                            {
                                bool got_D = define_D(startTrimmerEdge, sideTrimmerEdge, e);
                                if (got_D)
                                {
                                    A_handler(main.Start, main.End, e, null, _V_.X_REINFORCEMENT_MAIN_DIAMETER);
                                }
                            }
                            else
                            {
                                G.Corner ec = e.EndCorner;
                                if (ec.Angle < Math.PI)
                                {
                                    G.Edge otherEdge = ec.getOtherEdge(e);
                                    define_D(e, startTrimmerEdge, otherEdge);
                                }
                            }
                        }
                    }
                    else if (endTrimmed)
                    {
                        bool got_B = define_B(endTrimmerEdge, e);

                        if (got_B == false)
                        {
                            G.Vector v1 = e.Line.getOffsetVector();
                            G.Vector v2 = endTrimmerEdge.Line.getCoolVector(v1);

                            G.Point AP     = main.End.move(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * 2, v2);
                            G.Line  b_line = new G.Line(main.End, AP);

                            G.Edge sideTrimmerEdge = null;
                            G.Line newMain         = trimLine_basepoint(b_line, main.End, _V_.X_CONCRETE_COVER_2, e, ref sideTrimmerEdge);

                            if (sideTrimmerEdge != null)
                            {
                                bool got_D = define_D(endTrimmerEdge, e, sideTrimmerEdge);
                                if (got_D)
                                {
                                    A_handler(main.Start, main.End, e, null, _V_.X_REINFORCEMENT_MAIN_DIAMETER);
                                }
                            }
                            else
                            {
                                G.Corner sc = e.StartCorner;
                                if (sc.Angle < Math.PI)
                                {
                                    G.Edge otherEdge = sc.getOtherEdge(e);
                                    define_D(e, otherEdge, endTrimmerEdge);
                                }
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 18
0
        private void create_trimmed_long_A()
        {
            List <G.Edge> emptyEdges = allEdges.Where(x => !setEdges.Keys.Contains(x)).ToList();

            emptyEdges = emptyEdges.OrderBy(b => b.Line.Length()).Reverse().ToList();

            foreach (G.Edge e in emptyEdges)
            {
                if (setEdges.Keys.Contains(e))
                {
                    continue;
                }
                if (narrow_denier(e))
                {
                    continue;
                }

                G.Edge temp = null;
                G.Line main = e.edgeOffset(_V_.X_CONCRETE_COVER_1, _V_.X_CONCRETE_COVER_1, _V_.X_CONCRETE_COVER_1);
                main = trimLine_baseline(main, main.Copy(), _V_.X_CONCRETE_COVER_1, e, ref temp);


                bool   startTrimmed     = false;
                G.Edge startTrimmerEdge = null;
                if (e.StartCorner.Angle > Math.PI)
                {
                    G.Line extended = main.extendStart(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH);
                    G.Line trimmed  = trimLine_basepoint(extended, main.End, _V_.X_CONCRETE_COVER_2, e, ref startTrimmerEdge);
                    if (trimmed.Length() < main.Length() + _V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * _V_.M_TRIM_TOLERANCE)
                    {
                        startTrimmed = true;
                    }
                    main = trimmed;
                }


                bool   endTrimmed     = false;
                G.Edge endTrimmerEdge = null;
                if (e.EndCorner.Angle > Math.PI)
                {
                    G.Line extended = main.extendEnd(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH);
                    G.Line trimmed  = trimLine_basepoint(extended, main.Start, _V_.X_CONCRETE_COVER_2, e, ref endTrimmerEdge);
                    if (trimmed.Length() < main.Length() + _V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * _V_.M_TRIM_TOLERANCE)
                    {
                        endTrimmed = true;
                    }
                    main = trimmed;
                }


                if (main.Length() > _V_.Y_REINFORCEMENT_MAIN_MIN_LENGTH)
                {
                    A_handler(main.Start, main.End, e, null, _V_.X_REINFORCEMENT_MAIN_DIAMETER);

                    if (startTrimmed)
                    {
                        bool got_B = define_simple_B(e, startTrimmerEdge);

                        if (got_B == false)
                        {
                            G.Vector v1 = e.Line.getOffsetVector();
                            G.Vector v2 = startTrimmerEdge.Line.getCoolVector(v1);

                            G.Point AP     = main.Start.move(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * 1.5, v2);
                            G.Line  b_line = new G.Line(main.Start, AP);

                            G.Edge sideTrimmerEdge = null;
                            G.Line newMain         = trimLine_basepoint(b_line, main.Start, _V_.X_CONCRETE_COVER_2, e, ref sideTrimmerEdge);

                            if (sideTrimmerEdge != null)
                            {
                                define_D(startTrimmerEdge, sideTrimmerEdge, e);
                            }
                        }
                    }

                    if (endTrimmed)
                    {
                        bool got_B = define_simple_B(endTrimmerEdge, e);

                        if (got_B == false)
                        {
                            G.Vector v1 = e.Line.getOffsetVector();
                            G.Vector v2 = endTrimmerEdge.Line.getCoolVector(v1);

                            G.Point AP     = main.End.move(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * 1.5, v2);
                            G.Line  b_line = new G.Line(main.End, AP);

                            G.Edge sideTrimmerEdge = null;
                            G.Line newMain         = trimLine_basepoint(b_line, main.End, _V_.X_CONCRETE_COVER_2, e, ref sideTrimmerEdge);

                            if (sideTrimmerEdge != null)
                            {
                                define_D(endTrimmerEdge, e, sideTrimmerEdge);
                            }
                        }
                    }
                }
            }
        }