Esempio n. 1
0
        private void CreateByAddLegUsingSegments_Click(object sender, EventArgs e)
        {
            try
            {
                if (bentPlate != null)
                {
                    bentPlate.Delete();
                }

                var contour1 = new Contour();
                contour1.AddContourPoint(new ContourPoint(new Point(0, 0, 0), null));
                contour1.AddContourPoint(new ContourPoint(new Point(3000.0, 0, 0), null));
                contour1.AddContourPoint(new ContourPoint(new Point(3000.0, 3000.0, 0), null));
                contour1.AddContourPoint(new ContourPoint(new Point(0, 3000.0, 0), null));

                ConnectiveGeometry geometry = new ConnectiveGeometry(contour1);

                var contour2 = new Contour();
                contour2.AddContourPoint(new ContourPoint(new Point(0, 6000.0, 1500.0), null));
                contour2.AddContourPoint(new ContourPoint(new Point(3000.0, 6000.0, 1500.0), null));
                contour2.AddContourPoint(new ContourPoint(new Point(3000.0, 6000.0, 4500.0), null));
                contour2.AddContourPoint(new ContourPoint(new Point(0, 6000.0, 4500.0), null));

                double radius = (double)RadiusForAddLegWithSegments.Value;

                LineSegment faceSegment1 = new LineSegment(new Point(500.0, 3000.0, 0), new Point(2500.0, 3000.0, 0));
                LineSegment faceSegment2 = new LineSegment(new Point(500.0, 6000.0, 1500.0), new Point(2500.0, 6000.0, 1500.0));

                BentPlateGeometrySolver solver = new BentPlateGeometrySolver();
                geometry = solver.AddLeg(geometry, faceSegment1, contour2, faceSegment2, radius);

                bentPlate = new BentPlate
                {
                    Name     = "Plate",
                    Material = { MaterialString = "S235JR" },
                    Profile  = { ProfileString = "PL20" }
                };

                bentPlate.Geometry = geometry;
                bentPlate.Insert();
                model.CommitChanges();
            }
            catch (Exception Ex)
            {
                Console.WriteLine("Exception : ", Ex.ToString());
            }
        }
Esempio n. 2
0
        private void CreatPlate(TSG.Point a, TSG.Point b, TSG.Point c, TSG.Point d, int thick)
        {
            ContourPlate curPlate = new ContourPlate();

            Profile pf = new Profile();

            pf.ProfileString = string.Format("PL{0}", thick);
            var contor = new Contour();

            contor.AddContourPoint(new ContourPoint(a, null));
            contor.AddContourPoint(new ContourPoint(b, null));
            contor.AddContourPoint(new ContourPoint(c, null));
            contor.AddContourPoint(new ContourPoint(d, null));

            curPlate.Contour = contor;
            curPlate.Profile = pf;
            curPlate.Insert();
        }
Esempio n. 3
0
        private void CreateSimpleBentPlate()
        {
            try
            {
                if (bentPlate != null)
                {
                    bentPlate.Delete();
                }

                var contour1 = new Contour();
                contour1.AddContourPoint(new ContourPoint(new Point(0, 0, 0), null));
                contour1.AddContourPoint(new ContourPoint(new Point(3000.0, 0, 0), null));
                contour1.AddContourPoint(new ContourPoint(new Point(3000.0, 3000.0, 0), null));
                contour1.AddContourPoint(new ContourPoint(new Point(0, 3000.0, 0), null));

                ConnectiveGeometry geometry = new ConnectiveGeometry(contour1);

                var contour2 = new Contour();
                contour2.AddContourPoint(new ContourPoint(new Point(0, 6000.0, 1500.0), null));
                contour2.AddContourPoint(new ContourPoint(new Point(3000.0, 6000.0, 1500.0), null));
                contour2.AddContourPoint(new ContourPoint(new Point(3000.0, 6000.0, 4500.0), null));
                contour2.AddContourPoint(new ContourPoint(new Point(0, 6000.0, 4500.0), null));

                BentPlateGeometrySolver solver = new BentPlateGeometrySolver();
                geometry = solver.AddLeg(geometry, contour2);

                bentPlate = new BentPlate
                {
                    Name       = "Plate"
                    , Material = { MaterialString = "S235JR" }
                    , Profile  = { ProfileString = "PL20" }
                };

                bentPlate.Geometry = geometry;
                bentPlate.Insert();
                model.CommitChanges();
            }
            catch (Exception EX)
            {
                Console.WriteLine("Exception : ", EX.ToString());
            }
        }
Esempio n. 4
0
        private void CreateSamplePlates()
        {
            var contour1 = new Contour();

            contour1.AddContourPoint(new ContourPoint(new Point(0, 0, 0), null));
            contour1.AddContourPoint(new ContourPoint(new Point(3000.0, 0, 0), null));
            contour1.AddContourPoint(new ContourPoint(new Point(3000.0, 3000.0, 0), null));
            contour1.AddContourPoint(new ContourPoint(new Point(0, 3000.0, 0), null));

            samplePlate1 = new ContourPlate
            {
                Name     = "Plate",
                Material = { MaterialString = "S235JR" },
                Profile  = { ProfileString = "PL20" },
                Position = { Depth = Position.DepthEnum.MIDDLE, DepthOffset = 0 }
            };

            samplePlate1.Contour = contour1;
            samplePlate1.Insert();

            var contour2 = new Contour();

            contour2.AddContourPoint(new ContourPoint(new Point(0, 6000.0, 1500.0), null));
            contour2.AddContourPoint(new ContourPoint(new Point(3000.0, 6000.0, 1500.0), null));
            contour2.AddContourPoint(new ContourPoint(new Point(3000.0, 6000.0, 4500.0), null));
            contour2.AddContourPoint(new ContourPoint(new Point(0, 6000.0, 4500.0), null));

            samplePlate2 = new ContourPlate
            {
                Name     = "Plate",
                Material = { MaterialString = "S235JR" },
                Profile  = { ProfileString = "PL20" },
                Position = { Depth = Position.DepthEnum.MIDDLE, DepthOffset = 0 }
            };

            samplePlate2.Contour = contour2;
            samplePlate2.Insert();

            model.CommitChanges();
        }
Esempio n. 5
0
        private void ModifyPlateSide_Click(object sender, EventArgs e)
        {
            ModifyPlateSide.Enabled = false;

            var geometryEnumerator = bentPlate.Geometry.GetGeometryEnumerator();

            while (geometryEnumerator.MoveNext())
            {
                if (geometryEnumerator.Current.GeometryNode is PolygonNode)
                {
                    break;
                }
            }

            if (geometryEnumerator.Current != null)
            {
                var contour1 = new Contour();
                contour1.AddContourPoint(new ContourPoint(new Point(500.0, 0, 0), null));
                contour1.AddContourPoint(new ContourPoint(new Point(2000.0, 0, 0), null));
                contour1.AddContourPoint(new ContourPoint(new Point(2000.0, 3000.0, 0), null));
                contour1.AddContourPoint(new ContourPoint(new Point(500.0, 3000.0, 0), null));

                try
                {
                    BentPlateGeometrySolver solver = new BentPlateGeometrySolver();

                    var changedGeoMetry = solver.ModifyPolygon(bentPlate.Geometry, geometryEnumerator.Current, contour1);

                    bentPlate.Geometry = changedGeoMetry;
                    bentPlate.Modify();
                    model.CommitChanges();
                }
                catch (Exception Ex)
                {
                    Console.WriteLine("Exception : ", Ex.ToString());
                }
            }
        }
Esempio n. 6
0
        private void CreatePadFootings(object sender, EventArgs e)
        {
            // Always remember to check that you really have working connection
            if (MyModel.GetConnectionStatus())
            {
                double wsp3 = int.Parse(textBox1.Text);
                double wsp4 = double.Parse(textBox2.Text);

                Picker piku = new Picker();

                //askjdhygausgfdyzjusrgfafsa
                ArrayList info = new ArrayList();
                info = new ArrayList {
                    "END_X", "END_Y", "END_Z", "START_X", "START_Y", "START_Z"
                };
                ArrayList info2 = new ArrayList();
                info2 = new ArrayList {
                    "END_X", "END_Y", "END_Z", "START_X", "START_Y", "START_Z"
                };
                ModelObject part  = new Beam();
                ModelObject part2 = new Beam();
                Hashtable   p1    = new Hashtable();
                Hashtable   p2    = new Hashtable();

                part = piku.PickObject(Picker.PickObjectEnum.PICK_ONE_PART);
                part.GetDoubleReportProperties(info, ref p1);
                part2 = piku.PickObject(Picker.PickObjectEnum.PICK_ONE_PART);
                part2.GetDoubleReportProperties(info2, ref p2);
                Point st1 = new Point();
                Point st2 = new Point();
                st1 = piku.PickPoint();
                st2 = piku.PickPoint();
                Point st3 = new Point(st1);
                Point st4 = new Point(st2);

                //wektory belek
                Vector v1 = new Vector((Convert.ToDouble(p1["START_X"]) - Convert.ToDouble(p1["END_X"])) / 10000, (Convert.ToDouble(p1["START_Y"]) - Convert.ToDouble(p1["END_Y"])) / 10000, (Convert.ToDouble(p1["START_Z"]) - Convert.ToDouble(p1["END_Z"])) / 10000);
                Vector v2 = new Vector((Convert.ToDouble(p2["START_X"]) - Convert.ToDouble(p2["END_X"])) / 10000, (Convert.ToDouble(p2["START_Y"]) - Convert.ToDouble(p2["END_Y"])) / 10000, (Convert.ToDouble(p2["START_Z"]) - Convert.ToDouble(p2["END_Z"])) / 10000);
                double v1d = v1.GetLength(); double ile1 = 30 / v1d;
                double v2d = v2.GetLength(); double ile2 = 30 / v2d;
                double v1dd = v1.GetLength(); double ile3 = wsp4 / v1d;
                double v2dd = v2.GetLength(); double ile4 = wsp4 / v2d;

                st3.Translate((-v1.X) * ile3, (-v1.Y) * ile3, (-v1.Z) * ile3);
                st1.Translate((v1.X) * ile1, (v1.Y) * ile1, (v1.Z) * ile1);
                st4.Translate((-v2.X) * ile2, (-v2.Y) * ile2, (-v2.Z) * ile2);
                st2.Translate((v2.X) * ile4, (v2.Y) * ile4, (v2.Z) * ile4);

                Contour      testowy = new Contour();
                ContourPoint point1  = new ContourPoint(st1, null);
                ContourPoint point2  = new ContourPoint(st3, new Chamfer(45, 0, Chamfer.ChamferTypeEnum.CHAMFER_ROUNDING));
                ContourPoint point3  = new ContourPoint(st4, null);
                testowy.AddContourPoint(point1);
                testowy.AddContourPoint(point2);
                testowy.AddContourPoint(point3);

                Contour      testowy3 = new Contour();
                ContourPoint point10  = new ContourPoint(st4, null);
                ContourPoint point20  = new ContourPoint(st2, new Chamfer(45, 0, Chamfer.ChamferTypeEnum.CHAMFER_ROUNDING));
                ContourPoint point30  = new ContourPoint(st3, null);
                testowy3.AddContourPoint(point10);
                testowy3.AddContourPoint(point20);
                testowy3.AddContourPoint(point30);

                bool strona = radioButton1.Checked;

                ModelObject nb  = CreateBlacha(testowy, strona);
                ModelObject nb3 = CreateBlacha(testowy3, strona);
                nb.Insert();
                nb3.Insert();

                double l1 = 0.0;
                nb.GetReportProperty("LENGTH", ref l1);


                double l2 = 0.0;
                nb3.GetReportProperty("LENGTH", ref l2);

                nb.Delete();
                nb3.Delete();



                Contour testowy2 = new Contour();
                testowy2.AddContourPoint(point1);
                testowy2.AddContourPoint(point2);
                Point        point4v = new Point(dlugosc(point2, point3, l1));
                ContourPoint point4  = new ContourPoint(point4v, null);
                testowy2.AddContourPoint(point4);
                ModelObject nb2 = CreateBlacha(testowy2, strona);

                Contour testowy4 = new Contour();
                testowy4.AddContourPoint(point10);
                testowy4.AddContourPoint(point20);
                Point        point40v = new Point(dlugosc(point20, point30, l2));
                ContourPoint point40  = new ContourPoint(point40v, null);
                testowy4.AddContourPoint(point40);
                ModelObject nb4 = CreateBlacha(testowy4, strona);


                nb2.Insert();
                BoltArray b2 = sruby(point1, point2, nb2 as Part);
                b2.PartToBoltTo = part as Part;
                b2.BoltSize     = Convert.ToDouble(comboBox3.Text);
                b2.BoltStandard = comboBox2.Text;
                b2.Insert();
                nb4.Insert();
                BoltArray b4 = sruby(point10, point20, nb4 as Part);
                b4.BoltSize     = Convert.ToDouble(comboBox3.Text);
                b4.BoltStandard = comboBox2.Text;
                b4.PartToBoltTo = part2 as Part;
                b4.Insert();

                Point point4st  = new Point(dlugosc(point40, point4, 130));
                Point point40st = new Point(dlugosc(point4, point40, 130));

                Point pointsplit = new Point(dlugosc(point4st, point40st, wsp3 + 180));

                if (comboBox1.Text == "D16")
                {
                    Beam st16 = CreateStezenie16(point4st, point40st, strona);
                    st16.Insert();
                    Weld w  = new Weld();
                    Weld w2 = new Weld();
                    w.MainObject      = st16;
                    w.SecondaryObject = nb2;
                    w.ShopWeld        = true;
                    w.Insert();
                    w2.MainObject      = st16;
                    w2.SecondaryObject = nb4;
                    w2.ShopWeld        = true;
                    w2.Insert();
                    Beam       st161 = Operation.Split(st16, pointsplit);
                    Connection sr    = new Connection();
                    sr.Name   = "Po³¹czenie œrub¹ rzymsk¹";
                    sr.Number = 126;
                    sr.LoadAttributesFromFile("82269_M16");
                    sr.SetPrimaryObject(st161);
                    sr.SetSecondaryObject(st16);
                    sr.Insert();
                }
                if (comboBox1.Text == "D20")
                {
                    Beam st16 = CreateStezenie20(point4st, point40st, strona);
                    st16.Insert();
                    Weld w  = new Weld();
                    Weld w2 = new Weld();
                    w.MainObject      = st16;
                    w.SecondaryObject = nb2;
                    w.ShopWeld        = true;
                    w.Insert();
                    w2.MainObject      = st16;
                    w2.SecondaryObject = nb4;
                    w2.ShopWeld        = true;
                    w2.Insert();
                    Beam       st161 = Operation.Split(st16, pointsplit);
                    Connection sr    = new Connection();
                    sr.Name   = "Po³¹czenie œrub¹ rzymsk¹";
                    sr.Number = 126;
                    sr.LoadAttributesFromFile("82269_M20");
                    sr.SetPrimaryObject(st161);
                    sr.SetSecondaryObject(st16);
                    sr.Insert();
                }
                if (comboBox1.Text == "D12")
                {
                    Beam st16 = CreateStezenie12(point4st, point40st, strona);
                    st16.Insert();
                    Weld w  = new Weld();
                    Weld w2 = new Weld();
                    w.MainObject      = st16;
                    w.SecondaryObject = nb2;
                    w.ShopWeld        = true;
                    w.Insert();
                    w2.MainObject      = st16;
                    w2.SecondaryObject = nb4;
                    w2.ShopWeld        = true;
                    w2.Insert();
                    Beam       st161 = Operation.Split(st16, pointsplit);
                    Connection sr    = new Connection();
                    sr.Name   = "Po³¹czenie œrub¹ rzymsk¹";
                    sr.Number = 126;
                    sr.LoadAttributesFromFile("82269_M12");
                    sr.SetPrimaryObject(st161);
                    sr.SetSecondaryObject(st16);
                    sr.Insert();
                }
            }
            MyModel.CommitChanges();
        }
Esempio n. 7
0
        public override bool Run(List <InputDefinition> Input)
        {
            try
            {
                GetValuesFromDialog();

                WorkPlaneHandler wph = Model.GetWorkPlaneHandler();

                TransformationPlane tp     = wph.GetCurrentTransformationPlane();
                TransformationPlane tppart = null;


                BoltGroup bg = Model.SelectModelObject((Identifier)Input[0].GetInput()) as BoltGroup;
                bg.Select();
                List <Part> parts = new List <Part>();
                parts.Add(bg.PartToBeBolted);
                parts.Add(bg.PartToBoltTo);
                foreach (Part p in bg.OtherPartsToBolt)
                {
                    parts.Add(p);
                }

                #region Clear
                List <Part> _part = new List <Part>();

                foreach (Part p in parts)
                {
                    bool flag = false;
                    foreach (Part pp in _part)
                    {
                        if (pp.Identifier.ID == p.Identifier.ID)
                        {
                            flag = true;
                        }
                    }
                    if (!flag)
                    {
                        _part.Add(p);
                    }
                }

                parts.Clear();
                parts = _part;
                #endregion

                foreach (Part p in parts)
                {
                    if (p is Beam)
                    {
                        Beam b = p as Beam;
                        b.Select();

                        double k = 0.0; b.GetReportProperty("PROFILE.FLANGE_SLOPE_RATIO", ref k);
                        if (k == 0)
                        {
                            continue;
                        }

                        tppart = new TransformationPlane(p.GetCoordinateSystem());
                        wph.SetCurrentTransformationPlane(tppart);
                        bg.Select();
                        foreach (Point pb in bg.BoltPositions)
                        {
                            Point _pb = new Point(pb);

                            #region Уклон полок - точки через солид

                            GeometricPlane gp = new GeometricPlane(
                                _pb,
                                new Vector(0, 1, 0),
                                new Vector(0, 0, 1));
                            List <List <Point> > lp = IntersectSolid(p.GetSolid(), gp);

                            List <LineSegment> ls = new List <LineSegment>();


                            for (int i = 0; i < lp[0].Count - 1; i++)
                            {
                                Point  p1 = lp[0][i];
                                Point  p2 = lp[0][i + 1];
                                Vector v  = new Vector(p2.X - p1.X, p2.Y - p1.Y, p2.Z - p1.Z);
                                v.Normalize(1.0);
                                if (v.Y != 0 && v.Z != 0)
                                {
                                    ControlLine cl = new ControlLine();
                                    cl.Line.Point1 = p1;
                                    cl.Line.Point2 = p2;
                                    // cl.Insert();
                                    ls.Add(new LineSegment(p1, p2));
                                }
                            }

                            Point  _p1 = lp[0][0];
                            Point  _p2 = lp[0][lp[0].Count - 1];
                            Vector _v  = new Vector(_p2.X - _p1.X, _p2.Y - _p1.Y, _p2.Z - _p1.Z);
                            if (_v.Y != 0 && _v.Z != 0)
                            {
                                ls.Add(new LineSegment(_p1, _p2));
                                ControlLine cl = new ControlLine();
                                cl.Line.Point1 = _p1;
                                cl.Line.Point2 = _p2;
                                // cl.Insert();
                            }


                            #endregion

                            #region Точки для построения пластины

                            double diam = bg.BoltSize;

                            double tol = GOST_10906_78[diam][0];
                            double _b  = GOST_10906_78[diam][1];
                            double t1  = GOST_10906_78[diam][2];
                            double t2  = GOST_10906_78[diam][3];

                            int kf = (_pb.Z <= ((Point)b.GetReferenceLine(false)[0]).Z ? -1 : 1);

                            _pb.Z += kf * _b * 0.5;


                            double      h   = double.MaxValue;
                            LineSegment lsb = ls[0];

                            foreach (LineSegment lsi in ls)
                            {
                                double t = Distance.PointToLineSegment(_pb, lsi);
                                if (h >= t)
                                {
                                    h   = t;
                                    lsb = lsi;
                                }
                            }
                            //ControlLine cli = new ControlLine();
                            //cli.Line.Point1 = lsb.Point1;
                            //cli.Line.Point2 = lsb.Point2;
                            //cli.Insert();
                            Point pb1 = new Point(_pb.X, _pb.Y + 1000, _pb.Z);

                            Point pbi = Intersection.LineToLine(
                                new Line(lsb),
                                new Line(_pb, pb1)).Point1;
                            //cli.Line.Point1 = _pb;
                            //cli.Line.Point2 = pbi;
                            //cli.Insert();

                            #endregion

                            ContourPlate cp = new ContourPlate();

                            Contour cr = new Contour();
                            cr.AddContourPoint(new ContourPoint(new Point(pbi.X - _b * 0.5, pbi.Y, pbi.Z), null));

                            cr.AddContourPoint(new ContourPoint(new Point(pbi.X + _b * 0.5, pbi.Y, pbi.Z), null));
                            cr.AddContourPoint(new ContourPoint(new Point(pbi.X + _b * 0.5, pbi.Y, pbi.Z - kf * _b), null));
                            cr.AddContourPoint(new ContourPoint(new Point(pbi.X - _b * 0.5, pbi.Y, pbi.Z - kf * _b), null));

                            cp.Contour = cr;


                            cp.Profile.ProfileString      = "PL" + t1.ToString();
                            cp.AssemblyNumber.Prefix      = prefix_asm;
                            cp.AssemblyNumber.StartNumber = start_part;
                            cp.PartNumber.Prefix          = prefix_part;
                            cp.PartNumber.StartNumber     = start_part;

                            cp.Name = name;
                            cp.Material.MaterialString = material;
                            cp.Finish = finish;

                            if (kf == -1 && pbi.Y > 0)
                            {
                                cp.Position.Depth = Position.DepthEnum.FRONT;
                            }
                            else if (kf == -1 && pbi.Y < 0)
                            {
                                cp.Position.Depth = Position.DepthEnum.BEHIND;
                            }
                            else if (kf == 1 && pbi.Y > 0)
                            {
                                cp.Position.Depth = Position.DepthEnum.BEHIND;
                            }
                            else if (kf == 1 && pbi.Y < 0)
                            {
                                cp.Position.Depth = Position.DepthEnum.FRONT;
                            }

                            cp.Insert();

                            if (weight != 0.0 && us_prop_weight != "")
                            {
                                cp.SetUserProperty(us_prop_weight, weight);
                                cp.Modify();
                            }

                            BooleanPart  bp  = new BooleanPart();
                            ContourPlate cp2 = new ContourPlate();
                            Contour      cr2 = new Contour();

                            cr2.AddContourPoint(new ContourPoint(new Point(pbi.X, pbi.Y, pbi.Z), null));
                            cr2.AddContourPoint(new ContourPoint(new Point(pbi.X, pbi.Y, pbi.Z - kf * _b), null));
                            cr2.AddContourPoint(new ContourPoint(new Point(pbi.X, pbi.Y + (pbi.Y > 0 ? -1 * (t1 - t2) : (t1 - t2)), pbi.Z - kf * _b), null));

                            cp2.Contour = cr2;
                            cp2.Profile.ProfileString = "PL" + (_b + 10).ToString();
                            cp2.Class = BooleanPart.BooleanOperativeClassName;

                            cp2.Insert();

                            bp.Father        = cp;
                            bp.OperativePart = cp2;
                            bp.Insert();
                            cp2.Delete();

                            BoltArray ba = new BoltArray();
                            ba.FirstPosition  = pb;
                            ba.SecondPosition = new Point(pb.X + 100, pb.Y, pb.Z);

                            ba.BoltStandard      = bg.BoltStandard;
                            ba.Position.Rotation = Position.RotationEnum.TOP;
                            ba.BoltType          = bg.BoltType;
                            ba.BoltSize          = bg.BoltSize;
                            ba.Tolerance         = tol;
                            ba.Bolt = false;
                            ba.AddBoltDistX(0);
                            ba.AddBoltDistY(0);
                            ba.PartToBeBolted = cp;
                            ba.PartToBoltTo   = cp;
                            ba.Insert();
                        }
                    }
                }
                wph.SetCurrentTransformationPlane(tp);
            }
            catch (Exception Exc)
            {
                MessageBox.Show(Exc.ToString());
            }

            return(true);
        }
Esempio n. 8
0
        private void CreateBoxUsingGeometry_Click(object sender, EventArgs e)
        {
            if (bentPlate != null)
            {
                bentPlate.Delete();
                bentPlate = null;
            }

            var bottomContour = new Contour();

            bottomContour.AddContourPoint(new ContourPoint(new Point(6000.0, 6000.0, 0), null));
            bottomContour.AddContourPoint(new ContourPoint(new Point(6000.0, 12000.0, 0), null));
            bottomContour.AddContourPoint(new ContourPoint(new Point(12000.0, 12000.0, 0), null));
            bottomContour.AddContourPoint(new ContourPoint(new Point(12000.0, 6000.0, 0), null));

            var contour1 = new Contour();

            contour1.AddContourPoint(new ContourPoint(new Point(3000.0, 6000.0, 1500.0), null));
            contour1.AddContourPoint(new ContourPoint(new Point(3000.0, 12000.0, 1500.0), null));
            contour1.AddContourPoint(new ContourPoint(new Point(3000.0, 12000.0, 4500.0), null));
            contour1.AddContourPoint(new ContourPoint(new Point(3000.0, 6000.0, 4500.0), null));

            var contour2 = new Contour();

            contour2.AddContourPoint(new ContourPoint(new Point(6000.0, 15000.0, 1500.0), null));
            contour2.AddContourPoint(new ContourPoint(new Point(12000.0, 15000.0, 1500.0), null));
            contour2.AddContourPoint(new ContourPoint(new Point(12000.0, 15000.0, 4500.0), null));
            contour2.AddContourPoint(new ContourPoint(new Point(6000.0, 15000.0, 4500.0), null));

            var contour3 = new Contour();

            contour3.AddContourPoint(new ContourPoint(new Point(15000.0, 6000.0, 1500.0), null));
            contour3.AddContourPoint(new ContourPoint(new Point(15000.0, 12000.0, 1500.0), null));
            contour3.AddContourPoint(new ContourPoint(new Point(15000.0, 12000.0, 4500.0), null));
            contour3.AddContourPoint(new ContourPoint(new Point(15000.0, 6000.0, 4500.0), null));

            var contour4 = new Contour();

            contour4.AddContourPoint(new ContourPoint(new Point(6000.0, 3000.0, 1500.0), null));
            contour4.AddContourPoint(new ContourPoint(new Point(12000.0, 3000.0, 1500.0), null));
            contour4.AddContourPoint(new ContourPoint(new Point(12000.0, 3000.0, 4500.0), null));
            contour4.AddContourPoint(new ContourPoint(new Point(6000.0, 3000.0, 4500.0), null));

            ConnectiveGeometry geometry = new ConnectiveGeometry(bottomContour);

            BentPlateGeometrySolver solver = new BentPlateGeometrySolver();

            LineSegment segment1 = new LineSegment(new Point(6000.0, 6000.0, 0), new Point(6000.0, 12000.0, 0));
            LineSegment segment2 = new LineSegment(new Point(3000.0, 6000.0, 1500.0), new Point(3000.0, 12000.0, 1500.0));

            geometry = solver.AddLeg(geometry, segment1, contour1, segment2);

            segment1 = new LineSegment(new Point(6000.0, 12000.0, 0), new Point(12000.0, 12000.0, 0));
            segment2 = new LineSegment(new Point(6000.0, 15000.0, 1500.0), new Point(12000.0, 15000.0, 1500.0));

            geometry = solver.AddLeg(geometry, segment1, contour2, segment2);

            segment1 = new LineSegment(new Point(12000.0, 6000.0, 0), new Point(12000.0, 12000.0, 0));
            segment2 = new LineSegment(new Point(15000.0, 6000.0, 1500.0), new Point(15000.0, 12000.0, 1500.0));

            geometry = solver.AddLeg(geometry, segment1, contour3, segment2);

            segment1 = new LineSegment(new Point(6000.0, 6000.0, 0), new Point(12000.0, 6000.0, 0));
            segment2 = new LineSegment(new Point(6000.0, 3000.0, 1500.0), new Point(12000.0, 3000.0, 1500.0));

            geometry = solver.AddLeg(geometry, segment1, contour4, segment2);

            bentPlate = new BentPlate
            {
                Name     = "Plate",
                Material = { MaterialString = "S235JR" },
                Profile  = { ProfileString = "PL100" }
            };

            bentPlate.Geometry = geometry;
            bentPlate.Insert();
            model.CommitChanges();
        }
Esempio n. 9
0
        private void CreatePlatesForBox()
        {
            var bottomContour = new Contour();

            bottomContour.AddContourPoint(new ContourPoint(new Point(6000.0, 6000.0, 0), null));
            bottomContour.AddContourPoint(new ContourPoint(new Point(6000.0, 12000.0, 0), null));
            bottomContour.AddContourPoint(new ContourPoint(new Point(12000.0, 12000.0, 0), null));
            bottomContour.AddContourPoint(new ContourPoint(new Point(12000.0, 6000.0, 0), null));

            bottomPlate = new ContourPlate
            {
                Name     = "Plate",
                Material = { MaterialString = "S2345JR" },
                Profile  = { ProfileString = "PL100" },
                Position = { Depth = Position.DepthEnum.MIDDLE, DepthOffset = 0 },
                Contour  = bottomContour
            };

            var contour1 = new Contour();

            contour1.AddContourPoint(new ContourPoint(new Point(3000.0, 6000.0, 1500.0), null));
            contour1.AddContourPoint(new ContourPoint(new Point(3000.0, 12000.0, 1500.0), null));
            contour1.AddContourPoint(new ContourPoint(new Point(3000.0, 12000.0, 4500.0), null));
            contour1.AddContourPoint(new ContourPoint(new Point(3000.0, 6000.0, 4500.0), null));

            sidePlate1 = new ContourPlate
            {
                Name     = "Plate",
                Material = { MaterialString = "S235JR" },
                Profile  = { ProfileString = "PL100" },
                Position = { Depth = Position.DepthEnum.MIDDLE, DepthOffset = 0 },
                Contour  = contour1
            };

            var contour2 = new Contour();

            contour2.AddContourPoint(new ContourPoint(new Point(6000.0, 15000.0, 1500.0), null));
            contour2.AddContourPoint(new ContourPoint(new Point(12000.0, 15000.0, 1500.0), null));
            contour2.AddContourPoint(new ContourPoint(new Point(12000.0, 15000.0, 4500.0), null));
            contour2.AddContourPoint(new ContourPoint(new Point(6000.0, 15000.0, 4500.0), null));

            this.sidePlate2 = new ContourPlate
            {
                Name     = "Plate",
                Material = { MaterialString = "S235JR" },
                Profile  = { ProfileString = "PL100" },
                Position = { Depth = Position.DepthEnum.MIDDLE, DepthOffset = 0 },
                Contour  = contour2
            };

            var contour3 = new Contour();

            contour3.AddContourPoint(new ContourPoint(new Point(15000.0, 6000.0, 1500.0), null));
            contour3.AddContourPoint(new ContourPoint(new Point(15000.0, 12000.0, 1500.0), null));
            contour3.AddContourPoint(new ContourPoint(new Point(15000.0, 12000.0, 4500.0), null));
            contour3.AddContourPoint(new ContourPoint(new Point(15000.0, 6000.0, 4500.0), null));

            sidePlate3 = new ContourPlate
            {
                Name     = "Plate",
                Material = { MaterialString = "S235JR" },
                Profile  = { ProfileString = "PL100" },
                Position = { Depth = Position.DepthEnum.MIDDLE, DepthOffset = 0 },
                Contour  = contour3
            };

            var contour4 = new Contour();

            contour4.AddContourPoint(new ContourPoint(new Point(6000.0, 3000.0, 1500.0), null));
            contour4.AddContourPoint(new ContourPoint(new Point(12000.0, 3000.0, 1500.0), null));
            contour4.AddContourPoint(new ContourPoint(new Point(12000.0, 3000.0, 4500.0), null));
            contour4.AddContourPoint(new ContourPoint(new Point(6000.0, 3000.0, 4500.0), null));

            sidePlate4 = new ContourPlate
            {
                Name     = "Plate",
                Material = { MaterialString = "S235JR" },
                Profile  = { ProfileString = "PL100" },
                Position = { Depth = Position.DepthEnum.MIDDLE, DepthOffset = 0 },
                Contour  = contour4
            };

            bottomPlate.Insert();
            sidePlate1.Insert();
            sidePlate2.Insert();
            sidePlate3.Insert();
            sidePlate4.Insert();
            model.CommitChanges();
        }