Exemple #1
0
        private void GetIsoLinesV2(List <FE> listFE, RSAColor color, double Areq, string layer)
        {
            var z = 0;
            var ListOfIsolines = GeneratorOfIsolines.GetIsoLines(listFE, Areq);

            ListOfIsolines.ForEach(x =>
            {
                List <PolylineVertex> pv = new List <PolylineVertex>();
                x.Nodes.ForEach(y => pv.Add(new PolylineVertex(y.X, y.Y, 0)));
                dxf.AddEntity(new Polyline(pv, x.IsClosed)
                {
                    Color      = new AciColor(Color.FromArgb(color.R, color.G, color.B)),
                    Layer      = GetLayer(layer),
                    Lineweight = Lineweight.W15
                }

                              );
                var n1               = x.Nodes[x.Nodes.Count / 2];
                var n2               = x.Nodes[(x.Nodes.Count + 1) / 2];
                var text             = new MText();
                text.Color           = new AciColor(Color.FromArgb(color.R, color.G, color.B));
                text.Position        = new Vector3(Node.GetMiddleNode(n1, n2).X, Node.GetMiddleNode(n1, n2).Y, 0);
                text.Rotation        = Node.GetDegreeNode(n1, n2);
                text.AttachmentPoint = MTextAttachmentPoint.MiddleCenter;
                text.Height          = 0.1;
                text.Value           = Areq.ToString();
                text.Layer           = GetLayer(layer);
                dxf.AddEntity(text);
            });
        }
Exemple #2
0
        private void GetIsoLines(List <FE> listFE, RSAColor color, double Areq, string layer)
        {
            var z = 0;

            listFE.ForEach(x =>
            {
                for (int i = 0; i < x.nodesForMapping.Count; i++)
                {
                    var j = (i == x.nodesForMapping.Count - 1) ? 0 : i + 1;
                    if (!(x.nodes.Any(c => c == x.nodesForMapping[i]) || x.nodes.Any(c => c == x.nodesForMapping[j])))
                    {
                        var n1 = x.nodesForMapping[i];
                        var n2 = x.nodesForMapping[j];
                        dxf.AddEntity(new Line(
                                          new Vector2(n1.X, n1.Y),
                                          new Vector2(n2.X, n2.Y))
                        {
                            Color = new AciColor(Color.FromArgb(color.R, color.G, color.B)),
                            Layer = GetLayer(layer)
                        });

                        //if (z % 40 == 0)
                        //{
                        //    var text = new MText();
                        //    text.Color = new AciColor(Color.FromArgb(color.R, color.G, color.B));
                        //    text.Position = new Vector3(Node.GetMiddleNode(n1, n2).X, Node.GetMiddleNode(n1, n2).Y, 0);
                        //    text.Rotation = Node.GetDegreeNode(n1, n2);
                        //    text.AttachmentPoint = MTextAttachmentPoint.MiddleCenter;
                        //    text.Height = 0.1;
                        //    text.Value = Areq.ToString();
                        //    dxf.AddEntity(text);
                        //}
                    }
                    z++;
                }
            });
        }
Exemple #3
0
        private void GetSolid(List <FE> listFE, RSAColor color, string layer)
        {
            if (color.A == 0)
            {
                return;
            }
            var solids = new List <Solid>();

            listFE.ForEach(n =>
            {
                if (n.nodesForMapping.Count > 2)
                {
                    Node n1, n2, n3, n4, n5, n6;

                    n1 = n.nodesForMapping[0];
                    n2 = n.nodesForMapping[1];
                    n3 = n.nodesForMapping[2];
                    n4 = n.nodesForMapping.Count >= 4 ? n.nodesForMapping[3] : null;
                    n5 = n.nodesForMapping.Count >= 5 ? n.nodesForMapping[4] : null;
                    n6 = n.nodesForMapping.Count == 6 ? n.nodesForMapping[5] : null;

                    solids.Add(
                        new Solid(
                            new Vector2(n1.X, n1.Y),
                            new Vector2(n2.X, n2.Y),
                            new Vector2(n3.X, n3.Y)));
                    if (n4 != null)
                    {
                        solids.Add(
                            new Solid(
                                new Vector2(n1.X, n1.Y),
                                new Vector2(n3.X, n3.Y),
                                new Vector2(n4.X, n4.Y)));
                    }
                    if (n5 != null)
                    {
                        solids.Add(
                            new Solid(
                                new Vector2(n1.X, n1.Y),
                                new Vector2(n4.X, n4.Y),
                                new Vector2(n5.X, n5.Y)));
                    }
                    if (n6 != null)
                    {
                        solids.Add(
                            new Solid(
                                new Vector2(n1.X, n1.Y),
                                new Vector2(n5.X, n5.Y),
                                new Vector2(n6.X, n6.Y)));
                    }
                }
                ;
            });

            foreach (var item in solids)
            {
                item.Color = new AciColor(Color.FromArgb(color.R, color.G, color.B));
                item.Layer = GetLayer(layer);
                dxf.AddEntity(item);
            }
        }