Exemplo n.º 1
0
 private void WriteFootprintArc(BinaryWriter writer, PcbArc arc)
 {
     WriteBlock(writer, w =>
     {
         WriteFootprintCommon(w, arc, arc.Location);
         w.Write(arc.Radius.ToInt32());
         w.Write((double)arc.StartAngle);
         w.Write((double)arc.EndAngle);
         w.Write(arc.Width.ToInt32());
     });
 }
Exemplo n.º 2
0
        private void RenderArcPrimitive(Graphics g, PcbArc arc)
        {
            var penColor = arc.Layer.Color;
            var penWidth = ScaleCoord(arc.Width);

            using (var pen = CreatePen(penColor, penWidth))
            {
                var center     = ScreenFromWorld(arc.Location.X, arc.Location.Y);
                var radius     = ScaleCoord(arc.Radius);
                var startAngle = (float)-arc.StartAngle; // GDI+ uses clockwise angles and Altium counter-clockwise
                var sweepAngle = -(float)Utils.NormalizeAngle(arc.EndAngle - arc.StartAngle);
                g.DrawArc(pen,
                          center.X - radius, center.Y - radius, radius * 2.0f, radius * 2.0f,
                          startAngle, sweepAngle);
            }
        }
Exemplo n.º 3
0
 private PcbArc ReadFootprintArc(BinaryReader reader)
 {
     return(ReadBlock(reader, recordSize =>
     {
         CheckValue(nameof(recordSize), recordSize, 45, 56);
         var arc = new PcbArc();
         ReadFootprintCommon(reader, arc);
         arc.Location = ReadCoordPoint(reader);
         arc.Radius = reader.ReadInt32();
         arc.StartAngle = reader.ReadDouble();
         arc.EndAngle = reader.ReadDouble();
         arc.Width = reader.ReadInt32();
         if (recordSize >= 56)
         {
             reader.ReadUInt32(); // TODO: Unknown - ordering?
             reader.ReadUInt16(); // TODO: Unknown
             reader.ReadByte();   // TODO: Unknown
             reader.ReadUInt32(); // TODO: Unknown
         }
         return arc;
     }));
 }