当前位置: 首页>>代码示例>>C#>>正文


C# Box.Move方法代码示例

本文整理汇总了C#中Box.Move方法的典型用法代码示例。如果您正苦于以下问题:C# Box.Move方法的具体用法?C# Box.Move怎么用?C# Box.Move使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Box的用法示例。


在下文中一共展示了Box.Move方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InvertedF_2400MHz

            public InvertedF_2400MHz(double thickness = 0.0, bool debug = false)
                : base("Antenna-2400MHz-Inverted-F")
            {
                Vector3D feedPoint = new Vector3D(L3 + L4 + L7 + L8 + W2 / 2, 0, 0);
                m_thickness = thickness;

                // Antenna
                Metal copper = new Metal("antenna-inverted-f");
                copper.FillColor = new Material.Color(235, 148, 7, 255);
                copper.EdgeColor = new Material.Color(235, 148, 7, 255);

                uint priority = 100;
                uint normDir = 2;

                double[,] points = new double[,] { 
                    { L3+L4+L7, L3+L4+L7, L3, L3, L3+L4+L5, L3+L4+L5, L3+L4, L3+L4, L3+L4+L7-0.1, L3+L4+L7+L8, L3+L4+L7+L8, L3+L4+L7+L8+W2, L3+L4+L7+L8+W2, L3+L4+L7, L3+L4+L7, L1-L2, L1-L2, L1, L1, 0, 0, L3+L4, L3+L4, L3+L4+L5+0.2, L3+L4+L5+0.2, L3+L4+L7-L6-0.2, L3+L4+L7-L6-0.2 },
                    { 0, H2+H3, H2+H3, H1+W1-H4, H1+W1-H4, H2+H3+H5+H6, H2+H3+H5+H6, H2+H3+H5, H2+H3+H5, H2+H3 + 0.2, 0, 0, H2+H3+Math.Sqrt(2)/2*W2 + W2/4, H2+H3+H5+Math.Sqrt(2)*W2 -0.08, H1-H8, H1-H8, H1, H1, H1+W1, H1+W1, H2, H2, 0, 0, H2, H2, 0 }
                };

                m_antenna = new LinearPolygon(null, copper, priority, normDir, 0.0, points, thickness);
                m_antenna.Move(-feedPoint); // move feedpoint to origin w/o transformations
                this.Add(m_antenna);

                if (debug)
                {
                    // Ground plane placeholders (priority = 0)
                    double groundPlaneWidth = 5.0;

                    Metal groundPlane = new Metal("ground-plane");
                    groundPlane.FillColor = new Material.Color(235, 148, 7, 255);
                    groundPlane.EdgeColor = new Material.Color(235, 148, 7, 255);

                    //Box groundPlaneLeft = new Box(null, groundPlane, 0, new Vector3D(-W2 / 2 - L8, -groundPlaneWidth, 0), new Vector3D(L3 + L4 + L7, 0, thickness));
                    Box groundPlaneLeft = new Box(null, groundPlane, 0, new Vector3D(0, -groundPlaneWidth, 0), new Vector3D(L3 + L4 + L7, 0, thickness));
                    Box groundPlaneRight = new Box(null, groundPlane, 0, new Vector3D(L3 + L4 + L7 + L8 + W2 + L8, -groundPlaneWidth, 0), new Vector3D(L1, 0, thickness));
                    groundPlaneLeft.Move(-feedPoint);
                    groundPlaneRight.Move(-feedPoint);
                    this.Add(groundPlaneLeft);
                    this.Add(groundPlaneRight);

                    /*
                    double pcbWidth = 0.56; // FIXME
                    Box groundPlaneBottom = new Box(null, groundPlane, 0, new Vector3D(0, -groundPlaneWidth, 0-pcbWidth), new Vector3D(L1, 0, thickness-pcbWidth));
                    groundPlaneBottom.Move(-feedPoint);
                    this.Add(groundPlaneBottom);

                    // Keep-off region
                    Dielectric keepOff = new Dielectric("keep-off");
                    keepOff.FillColor = new Material.Color(255, 0, 0, 32);
                    keepOff.EdgeColor = new Material.Color(255, 0, 0, 32);
                    Box keepOffArea = new Box(null, keepOff, 0, new Vector3D(-1, 0, 0), new Vector3D(L1 + 1, H1 + W1 + 1, thickness));
                    keepOffArea.Move(-feedPoint);
                    this.Add(keepOffArea);
                    */
                }
            }
开发者ID:pombredanne,项目名称:metamorphosys-desktop,代码行数:56,代码来源:Antenna.cs


注:本文中的Box.Move方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。