KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_io_autotrax.cpp File Reference
#include "pcb_io_autotrax.h"
#include "autotrax_parser.h"
#include <board.h>
#include <board_design_settings.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_track.h>
#include <pcb_shape.h>
#include <pcb_text.h>
#include <zone.h>
#include <netinfo.h>
#include <convert_basic_shapes_to_polygon.h>
#include <geometry/eda_angle.h>
#include <geometry/shape_poly_set.h>
#include <reporter.h>
#include <math/util.h>
#include <math/vector2d.h>
#include <geometry/shape_line_chain.h>
#include <algorithm>
#include <cmath>
#include <fstream>
#include <sstream>

Go to the source code of this file.

Classes

struct  ARC_SPAN
 One arc as a (start angle, signed sweep) pair in the file's native Y-down frame. More...
 
struct  ARC
 Free or component arc (FA / CA). More...
 
struct  BOARD_DATA
 Everything parsed out of an Autotrax/Easytrax file, before any KiCad object is created. More...
 
struct  FILL
 Free or component rectangular fill (FF / CF), Autotrax's only pour. More...
 
struct  NET_NODE
 One refdes -> net membership row collected from the NETDEF section. More...
 
struct  TEXT
 Free or component string (FS / CS). More...
 
struct  TRACK
 Free or component track segment (FT / CT). All coordinates are in mils. More...
 
struct  VIA
 Free or component via (FV / CV). More...
 

Functions

static bool readFile (const wxString &aFileName, wxString &aOut, size_t aLimit=0)
 Read a file into aOut.
 
static std::vector< ARC_SPANarcSpansFromSegments (int aSegments)
 Translate an Autotrax arc quadrant bitmask into the arc spans it represents.
 

Function Documentation

◆ arcSpansFromSegments()

static std::vector< ARC_SPAN > arcSpansFromSegments ( int aSegments)
static

Translate an Autotrax arc quadrant bitmask into the arc spans it represents.

Most masks are a single contiguous run of quadrants, but masks 5 and 10 encode two disjoint quadrants and therefore yield two arcs.

Definition at line 245 of file pcb_io_autotrax.cpp.

Referenced by PCB_IO_AUTOTRAX::emitArc().

◆ readFile()

static bool readFile ( const wxString & aFileName,
wxString & aOut,
size_t aLimit = 0 )
static

Read a file into aOut.

A non-zero aLimit reads at most that many bytes, which CanReadBoard() uses to sniff the header without slurping a whole board.

The raw bytes are decoded as UTF-8, falling back to Latin-1 for the DOS-era 8-bit encodings these legacy files often use; Latin-1 never fails, so the whole board is never lost to a single stray high byte.

Definition at line 85 of file pcb_io_autotrax.cpp.

Referenced by PCB_IO_AUTOTRAX::CanReadBoard(), and PCB_IO_AUTOTRAX::LoadBoard().