Esempio n. 1
0
        internal void SetObround(double W, double H)
        {
            RectWidth  = W;
            RectHeight = H;

            ShapeType = GerberApertureShape.OBround;

            Shape.SetObround(W, H);
        }
Esempio n. 2
0
 internal void SetCustom(List <PointD> OutlineVertices)
 {
     ShapeType = GerberApertureShape.Outline;
     Shape.Vertices.Clear();
     foreach (var a in OutlineVertices)
     {
         Shape.Vertices.Add(a);
     }
     // throw new NotImplementedException();
 }
Esempio n. 3
0
        public void SetCircle(double radius, double xoff = 0, double yoff = 0, double rotation = 0)
        {
            CircleRadius = Math.Max(0, radius);
            if (CircleRadius == 0)
            {
                Shape.Vertices.Clear();
            }
            else
            {
                NGon((int)Math.Floor(10 * Math.Max(2.0, CircleRadius)), CircleRadius, xoff, yoff, rotation);
            };

            ShapeType = GerberApertureShape.Circle;
        }
Esempio n. 4
0
        public void SetRectangle(double width, double height)
        {
            RectWidth  = width;
            RectHeight = height;
            ShapeType  = GerberApertureShape.Rectangle;
            Shape.Vertices.Clear();
            double W = (double)width / 2;
            double H = (double)height / 2;

            Shape.Add(W, -H);
            Shape.Add(-W, -H);
            Shape.Add(-W, H);
            Shape.Add(W, H);
        }
Esempio n. 5
0
        public void NGon(int sides, double radius, double xoff = 0, double yoff = 0, double rotation = 0)
        {
            NGonRadius   = radius;
            NGonSides    = sides;
            NGonRotation = rotation;
            ShapeType    = GerberApertureShape.Polygon;
            double padd = -rotation * Math.PI * 2.0 / 360;

            Shape.Vertices.Clear();
            for (int i = 0; i < sides; i++)
            {
                double P = i / (double)sides * Math.PI * 2.0 + padd;
                Shape.Add((double)(xoff + Math.Sin(P) * radius), (double)(yoff + Math.Cos(P) * radius));
            }
        }