Example #1
0
        public void D_Raud_Init_test_parand2()
        {
            G.Point start  = new G.Point(0.0, 0.0);
            G.Point mainp  = start.move(25, new G.Vector(1, 0));
            G.Point side1p = start.move(10, new G.Vector(0, 1));
            G.Point side2p = mainp.move(15, new G.Vector(0, 1));

            G.Line main  = new G.Line(start, mainp);
            G.Line side1 = new G.Line(side1p, start);
            G.Line side2 = new G.Line(mainp, side2p);

            R.D_Raud reinf = new R.D_Raud(main, side1, side2, 2, 8, "B500B", -20);

            Assert.AreEqual(reinf.StartPoint.X, 0.0, 0.001);
            Assert.AreEqual(reinf.StartPoint.Y, 0.0, 0.001);
            Assert.AreEqual(reinf.Rotation, 0.0, 0.001);

            Assert.AreEqual(reinf.A, 10, 0.001);
            Assert.AreEqual(reinf.B, 25, 0.001);
            Assert.AreEqual(reinf.B2, 5, 0.001);
            Assert.AreEqual(reinf.C, 15, 0.001);

            Assert.AreEqual(reinf.Length, 30, 0.001);
            Assert.AreEqual(reinf.Diameter, 8, 0.001);
            Assert.AreEqual(reinf.Materjal, "B500B");
        }
Example #2
0
        public static D_Raud mergeTwoRebar_long(B_Raud one, B_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);

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

            return(raud);
        }
Example #3
0
        public void D_Raud_Init_test3()
        {
            G.Point start  = new G.Point(6.0, 2.0);
            G.Point mainp  = start.move(5, new G.Vector(1, -1));
            G.Point side1p = start.move(10, new G.Vector(1, 1));
            G.Point side2p = mainp.move(15, new G.Vector(1, 1));

            G.Line main  = new G.Line(start, mainp);
            G.Line side1 = new G.Line(side1p, start);
            G.Line side2 = new G.Line(mainp, side2p);

            R.D_Raud reinf = new R.D_Raud(main, side1, side2, 2, 8, "B500B");

            Assert.AreEqual(reinf.StartPoint.X, 6.0, 0.001);
            Assert.AreEqual(reinf.StartPoint.Y, 2.0, 0.001);
            Assert.AreEqual(reinf.Rotation, Math.PI + 3 * Math.PI / 4, 0.001);

            Assert.AreEqual(reinf.A, 10, 0.001);
            Assert.AreEqual(reinf.B, 5, 0.001);
            Assert.AreEqual(reinf.C, 15, 0.001);

            Assert.AreEqual(reinf.Length, 30, 0.001);
            Assert.AreEqual(reinf.Diameter, 8, 0.001);
            Assert.AreEqual(reinf.Materjal, "B500B");
        }
Example #4
0
 public bool Equals(D_Raud other)
 {
     if (other == null)
     {
         return(false);
     }
     return(this.A == other.A &&
            this.B2 == other.B2 &&  // parand magic
            this.C == other.C &&
            this.Diameter == other.Diameter &&
            this.Materjal == other.Materjal);
 }
        //definer
        private bool D_side_handler(G.Point start, G.Point end, int parand)
        {
            G.Line side = new G.Line(start, end);

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

            //reinf_geometry_debug.Add(side);

            G.Vector o1   = side.getDirectionVector();
            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);

            R.D_Raud cur;
            if (p.angle < Math.PI / 4)
            {
                if (_V_.X_REINFORCEMENT_SIDE_D_CREATE == 1)
                {
                    cur = new R.D_Raud(side, _V_.Y_ELEMENT_WIDTH_COVER + parand, 1, _V_.X_REINFORCEMENT_SIDE_D_DIAMETER, _V_.X_REINFORCEMENT_MARK);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                if (_V_.X_REINFORCEMENT_TOP_D_CREATE == 1)
                {
                    cur = new R.D_Raud(side, _V_.Y_ELEMENT_WIDTH_COVER + parand, 1, _V_.X_REINFORCEMENT_TOP_D_DIAMETER, _V_.X_REINFORCEMENT_MARK);
                }
                else
                {
                    return(false);
                }
            }

            int currentIndex = knownArrayReinforcement.Count - 1;

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

            return(true);
        }
Example #6
0
        public static D_Raud mergeTwoRebar(B_Raud one, B_Raud two)
        {
            G.Point a = one._SidePoint;
            G.Point b = one.StartPoint;
            G.Point c = two.StartPoint;
            G.Point d = two._EndPoint;

            G.Line side1 = new G.Line(a, b);
            G.Line main  = new G.Line(b, c);
            G.Line side2 = new G.Line(c, d);

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

            return(raud);
        }
Example #7
0
        public void D_Raud_class_test()
        {
            G.Point start  = new G.Point(0.0, 0.0);
            G.Point mainp  = start.move(5, new G.Vector(1, 0));
            G.Point side1p = start.move(10.0, new G.Vector(0, 1));
            G.Point side2p = mainp.move(15, new G.Vector(0, 1));

            G.Line main  = new G.Line(start, mainp);
            G.Line side1 = new G.Line(side1p, start);
            G.Line side2 = new G.Line(mainp, side2p);

            R.D_Raud reinf = new R.D_Raud(main, side1, side2, 2, 8, "B500B");

            Assert.IsTrue(reinf is R.Raud);
            Assert.IsTrue(reinf is R.D_Raud);
        }
Example #8
0
        private void setBendingBlockParameters(_Db.AttributeReference ar, R.Raud _ALFA_)
        {
            if (ar != null)
            {
                if (ar.Tag == "Teraseklass")
                {
                    ar.TextString = _ALFA_.Materjal.ToString();
                }
                if (ar.Tag == "Positsioon")
                {
                    ar.TextString = _ALFA_.ToStringNoCount();
                }

                if (_ALFA_ is R.A_Raud)
                {
                    R.A_Raud _BETA_ = _ALFA_ as R.A_Raud;
                    if (ar.Tag == "A")
                    {
                        ar.TextString = _BETA_.A.ToString();
                    }
                }

                if (_ALFA_ is R.B_Raud)
                {
                    R.B_Raud _BETA_ = _ALFA_ as R.B_Raud;
                    if (ar.Tag == "A")
                    {
                        ar.TextString = _BETA_.A.ToString();
                    }
                    else if (ar.Tag == "B")
                    {
                        ar.TextString = _BETA_.B.ToString();
                    }
                }

                if (_ALFA_ is R.C_Raud)
                {
                    R.C_Raud _BETA_ = _ALFA_ as R.C_Raud;
                    if (ar.Tag == "A")
                    {
                        ar.TextString = _BETA_.A.ToString();
                    }
                    else if (ar.Tag == "B")
                    {
                        ar.TextString = _BETA_.B.ToString();
                    }
                    else if (ar.Tag == "U")
                    {
                        ar.TextString = ((int)Math.Round(G.Converter.ToDeg(_BETA_.U), 0)).ToString();
                    }
                }

                if (_ALFA_ is R.D_Raud)
                {
                    R.D_Raud _BETA_ = _ALFA_ as R.D_Raud;
                    if (ar.Tag == "A")
                    {
                        ar.TextString = _BETA_.A.ToString();
                    }
                    else if (ar.Tag == "B")
                    {
                        ar.TextString = _BETA_.B2.ToString(); // parand magic
                    }
                    else if (ar.Tag == "C")
                    {
                        ar.TextString = _BETA_.C.ToString();
                    }
                }

                if (_ALFA_ is R.E_Raud)
                {
                    R.E_Raud _BETA_ = _ALFA_ as R.E_Raud;
                    if (ar.Tag == "A")
                    {
                        ar.TextString = _BETA_.A.ToString();
                    }
                    else if (ar.Tag == "B")
                    {
                        ar.TextString = _BETA_.B2.ToString(); // parand magic
                    }
                    else if (ar.Tag == "C")
                    {
                        ar.TextString = _BETA_.C.ToString();
                    }
                    else if (ar.Tag == "U")
                    {
                        ar.TextString = ((int)Math.Round(G.Converter.ToDeg(_BETA_.U), 0)).ToString();
                    }
                    else if (ar.Tag == "V")
                    {
                        ar.TextString = ((int)Math.Round(G.Converter.ToDeg(_BETA_.V), 0)).ToString();
                    }
                    else if (ar.Tag == "X")
                    {
                        ar.TextString = ((int)_BETA_.X).ToString();
                    }
                    else if (ar.Tag == "Y")
                    {
                        ar.TextString = ((int)_BETA_.Y).ToString();
                    }
                }

                if (_ALFA_ is R.U_Raud)
                {
                    R.U_Raud _BETA_ = _ALFA_ as R.U_Raud;
                    if (ar.Tag == "A")
                    {
                        ar.TextString = _BETA_.A.ToString();
                    }
                    else if (ar.Tag == "B")
                    {
                        ar.TextString = _BETA_.B.ToString();
                    }
                    else if (ar.Tag == "C")
                    {
                        ar.TextString = _BETA_.C.ToString();
                    }
                }
            }
        }
Example #9
0
        private void setReinforcementBlockParameters(_Db.BlockReference newBlockReference, R.Raud _ALFA_)
        {
            _Db.DynamicBlockReferencePropertyCollection aa = newBlockReference.DynamicBlockReferencePropertyCollection;
            foreach (_Db.DynamicBlockReferenceProperty a in aa)
            {
                if (a != null)
                {
                    if (_ALFA_ is R.A_Raud)
                    {
                        R.A_Raud _BETA_ = _ALFA_ as R.A_Raud;
                        if (a.PropertyName == "A")
                        {
                            a.Value = _BETA_.A;
                        }
                    }

                    else if (_ALFA_ is R.B_Raud)
                    {
                        R.B_Raud _BETA_ = _ALFA_ as R.B_Raud;
                        if (a.PropertyName == "A")
                        {
                            a.Value = _BETA_.A;
                        }
                        else if (a.PropertyName == "B")
                        {
                            a.Value = _BETA_.B;
                        }
                    }

                    else if (_ALFA_ is R.C_Raud)
                    {
                        R.C_Raud _BETA_ = _ALFA_ as R.C_Raud;
                        if (a.PropertyName == "A")
                        {
                            a.Value = _BETA_.A;
                        }
                        else if (a.PropertyName == "B")
                        {
                            a.Value = _BETA_.B;
                        }
                        else if (a.PropertyName == "U")
                        {
                            a.Value = Math.PI - _BETA_.U;                             // HERE
                        }
                    }

                    else if (_ALFA_ is R.D_Raud)
                    {
                        R.D_Raud _BETA_ = _ALFA_ as R.D_Raud;
                        if (a.PropertyName == "A")
                        {
                            a.Value = _BETA_.A;
                        }
                        else if (a.PropertyName == "B")
                        {
                            a.Value = _BETA_.B;
                        }
                        else if (a.PropertyName == "C")
                        {
                            a.Value = _BETA_.C;
                        }

                        else if (a.PropertyName == "A/C")
                        {
                            a.Value = _BETA_.A;
                        }
                    }

                    else if (_ALFA_ is R.E_Raud)
                    {
                        R.E_Raud _BETA_ = _ALFA_ as R.E_Raud;

                        if (a.PropertyName == "A")
                        {
                            a.Value = _BETA_.A;
                        }
                        else if (a.PropertyName == "B")
                        {
                            a.Value = _BETA_.B;
                        }
                        else if (a.PropertyName == "C")
                        {
                            a.Value = _BETA_.C;
                        }
                        else if (a.PropertyName == "U")
                        {
                            a.Value = Math.PI - _BETA_.U;                             // HERE
                        }
                        else if (a.PropertyName == "V")
                        {
                            if (_BETA_.B > 6000)
                            {
                                a.Value = _BETA_.V + Math.PI;
                            }
                            else
                            {
                                a.Value = _BETA_.V;
                            }
                        }
                        else if (a.PropertyName == "X")
                        {
                            a.Value = _BETA_.X;
                        }
                        else if (a.PropertyName == "Y")
                        {
                            a.Value = _BETA_.Y;
                        }
                    }
                    else if (_ALFA_ is R.U_Raud)
                    {
                        R.U_Raud _BETA_ = _ALFA_ as R.U_Raud;
                        if (a.PropertyName == "A")
                        {
                            a.Value = _BETA_.A;
                        }
                        else if (a.PropertyName == "B")
                        {
                            a.Value = _BETA_.B;
                        }
                        else if (a.PropertyName == "C")
                        {
                            a.Value = _BETA_.C;
                        }
                    }
                }
            }
        }
        //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);
        }
        private bool B_handler_replace(R.B_Raud a, R.B_Raud b)
        {
            R.D_Raud new_reinf_long = R.B_Raud.mergeTwoRebar_long(a, b);

            bool longD = true;

            if (denier(new_reinf_long.makeMainLine()))
            {
                longD = false;
            }
            if (denier(new_reinf_long.makeSide1Line()))
            {
                longD = false;
            }
            if (denier(new_reinf_long.makeSide2Line()))
            {
                longD = false;
            }

            if (new_reinf_long.A < _V_.Y_REINFORCEMENT_MAIN_RADIUS)
            {
                longD = false;
            }
            if (new_reinf_long.B2 < _V_.Y_REINFORCEMENT_MAIN_RADIUS * 1.99)
            {
                longD = false;
            }
            if (new_reinf_long.C < _V_.Y_REINFORCEMENT_MAIN_RADIUS)
            {
                longD = false;
            }
            if (new_reinf_long.Length > _V_.X_REINFORCEMENT_MAX_D_LENGTH)
            {
                longD = false;
            }

            if (longD == true)
            {
                keep_replace(new_reinf_long, a, b);
                return(true);
            }

            R.D_Raud new_reinf_normal = R.B_Raud.mergeTwoRebar(a, b);

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

            if (new_reinf_normal.A < _V_.Y_REINFORCEMENT_MAIN_RADIUS)
            {
                return(false);
            }
            if (new_reinf_normal.B2 < _V_.Y_REINFORCEMENT_MAIN_RADIUS * 1.99)
            {
                return(false);
            }
            if (new_reinf_normal.C < _V_.Y_REINFORCEMENT_MAIN_RADIUS)
            {
                return(false);
            }
            if (new_reinf_long.Length > _V_.X_REINFORCEMENT_MAX_D_LENGTH)
            {
                return(false);
            }

            keep_replace(new_reinf_normal, a, b);

            return(true);
        }