private void WriteFootprintFill(BinaryWriter writer, PcbFill fill) { WriteBlock(writer, w => { WriteFootprintCommon(w, fill, fill.Corner1); WriteCoordPoint(w, fill.Corner2); w.Write((double)fill.Rotation); }); }
private void RenderFillPrimitive(Graphics g, PcbFill fill) { var brushColor = LayerMetadata.GetColor(fill.Layer); using (var brush = new SolidBrush(brushColor)) { var worldRect = new CoordRect(fill.Corner1, fill.Corner2); var worldPoints = worldRect.RotatedPoints(worldRect.Center, fill.Rotation); var screenPoints = worldPoints.Select(cp => ScreenFromWorld(cp)).ToArray(); g.FillPolygon(brush, screenPoints); } }
private PcbFill ReadFootprintFill(BinaryReader reader) { return(ReadBlock(reader, recordSize => { CheckValue(nameof(recordSize), recordSize, 37, 41, 46); var fill = new PcbFill(); ReadFootprintCommon(reader, fill); fill.Corner1 = ReadCoordPoint(reader); fill.Corner2 = ReadCoordPoint(reader); fill.Rotation = reader.ReadDouble(); if (recordSize >= 41) { reader.ReadUInt32(); // TODO: Unknown } if (recordSize >= 46) { reader.ReadByte(); // TODO: Unknown reader.ReadInt32(); // TODO: Unknown - Coord? } return fill; })); }