67 #define EXPORT_CUSTOM_PADS_CONVEX_HULL 87 bool wasModified = screen->
IsModify();
112 errorText = ioe.
What();
126 SetStatusText( wxString(
_(
"BOARD exported OK." ) ) );
131 _(
"Unable to export, please fix and try again" ),
152 static inline double scale(
int kicadDist )
155 return kicadDist / ( IU_PER_MM / 1000.0 );
160 static inline double IU2um(
int kicadDist )
162 return kicadDist * (1000.0 / IU_PER_MM);
166 static inline double mapX(
int x )
172 static inline double mapY(
int y )
188 ret.
x =
mapX( pt.x );
189 ret.
y =
mapY( pt.y );
233 std::string uniqifier;
240 int reportedLayers = 0;
247 bool onAllCopperLayers = ( (aPad->
GetLayerSet() & all_cu) == all_cu );
249 if( onAllCopperLayers )
254 for(
int layer=0; layer<copperCount; ++layer )
258 if( onAllCopperLayers || aPad->
IsOnLayer( kilayer ) )
260 layerName[reportedLayers++] =
layerIds[layer].c_str();
262 if( !onAllCopperLayers )
266 else if( layer == copperCount - 1 )
269 uniqifier += char(
'0' + layer);
284 dsnOffset =
mapPt( offset );
288 sprintf( offsetTxt,
"[%.6g,%.6g]", dsnOffset.x, dsnOffset.y );
290 uniqifier += offsetTxt;
299 for(
int ndx=0; ndx<reportedLayers; ++ndx )
303 padstack->
Append( shape );
314 snprintf(
name,
sizeof(
name),
"Round%sPad_%.6g_um",
328 POINT lowerLeft( -dx, -dy );
329 POINT upperRight( dx, dy );
331 lowerLeft += dsnOffset;
332 upperRight += dsnOffset;
334 for(
int ndx=0; ndx<reportedLayers; ++ndx )
338 padstack->
Append( shape );
348 snprintf(
name,
sizeof(
name),
"Rect%sPad_%.6gx%.6g_um",
372 pstart =
POINT( -dr, 0.0 );
373 pstop =
POINT( dr, 0.0 );
380 pstart =
POINT( 0.0, -dr );
381 pstop =
POINT( 0.0, dr );
387 for(
int ndx=0; ndx<reportedLayers; ++ndx )
392 shape =
new SHAPE( padstack );
394 padstack->
Append( shape );
395 path =
makePath( pstart, pstop, layerName[ndx] );
400 snprintf(
name,
sizeof(
name),
"Oval%sPad_%.6gx%.6g_um",
419 POINT lowerLeft( -dx - ddy, -dy - ddx );
420 POINT upperLeft( -dx + ddy, +dy + ddx );
421 POINT upperRight( +dx - ddy, +dy - ddx );
422 POINT lowerRight( +dx + ddy, -dy + ddx );
424 lowerLeft += dsnOffset;
425 upperLeft += dsnOffset;
426 upperRight += dsnOffset;
427 lowerRight += dsnOffset;
429 for(
int ndx=0; ndx<reportedLayers; ++ndx )
433 padstack->
Append( shape );
436 PATH* polygon =
new PATH( shape, T_polygon );
449 snprintf(
name,
sizeof(
name),
"Trapz%sPad_%.6gx%.6g_%c%.6gx%c%.6g_um",
466 const int circleToSegmentsCount = 36;
477 double correctionFactor = cos( M_PI / (
double) circleToSegmentsCount );
478 int extra_clearance =
KiROUND( rradius * (1.0 - correctionFactor ) );
479 wxSize psize = aPad->
GetSize();
480 psize.x += extra_clearance*2;
481 psize.y += extra_clearance*2;
482 rradius += extra_clearance;
492 for(
int ndx=0; ndx < reportedLayers; ++ndx )
496 padstack->
Append( shape );
499 PATH* polygon =
new PATH( shape, T_polygon );
507 for(
int idx = 0; idx < polygonal_shape.PointCount(); idx++ )
509 POINT corner(
scale( polygonal_shape.Point( idx ).x ),
510 scale( -polygonal_shape.Point( idx ).y ) );
515 first_corner = corner;
521 snprintf(
name,
sizeof(
name),
"RoundRect%sPad_%.6gx%.6g_%.6g_um",
534 std::vector<wxPoint> polygonal_shape;
537 #ifdef EXPORT_CUSTOM_PADS_CONVEX_HULL 541 for(
int ii = 0; ii < p_outline.
PointCount(); ++ii )
542 polygonal_shape.push_back( wxPoint( p_outline.
CPoint( ii ) ) );
546 if( polygonal_shape.front() != polygonal_shape.back() )
547 polygonal_shape.push_back( polygonal_shape.front() );
549 for(
int ndx=0; ndx < reportedLayers; ++ndx )
553 padstack->
Append( shape );
556 PATH* polygon =
new PATH( shape, T_polygon );
562 for(
unsigned idx = 0; idx < polygonal_shape.size(); idx++ )
564 POINT corner(
scale( polygonal_shape[idx].x ),
scale( -polygonal_shape[idx].y ) );
572 snprintf(
name,
sizeof(
name),
"Cust%sPad_%.6gx%.6g_%.6gx_%.6g_%d_um",
575 (
int)polygonal_shape.size() );
606 for(
int p=0; p < moduleItems.
GetCount(); ++p )
618 for(
int layer=0; layer<layerCount; ++layer )
622 image->
keepouts.push_back( keepout );
641 if( !mask_copper_layers.any() )
645 PADSTACKSET::iterator iter =
padstackset.find( *padstack );
651 padstack = (
PADSTACK*) *iter.base();
658 PIN* pin =
new PIN( image );
663 if( padName!=wxEmptyString && pinmap.find( padName )==pinmap.end() )
665 pinmap[ padName ] = 0;
671 int duplicates = ++pinmap[ padName ];
673 sprintf( buf,
"@%d", duplicates );
680 image->
pins.push_back( pin );
694 #if 1 // enable image (outline) scopes. 698 moduleItems.
Collect( aModule, scanEDGEs );
709 outline =
new SHAPE( image, T_outline );
712 path =
new PATH( outline );
726 outline =
new SHAPE( image, T_outline );
729 path =
new PATH( outline );
749 wxPoint point(
KiROUND( radius * cos( radians ) ),
750 KiROUND( radius * sin( radians ) ) );
757 wxPoint point( radius , 0 );
766 DBG( printf(
"makeIMAGE(): unsupported shape %s\n",
779 int aTopLayer,
int aBotLayer )
783 double dsnDiameter =
scale( aCopperDiameter );
785 for(
int layer=aTopLayer; layer<=aBotLayer; ++layer )
789 padstack->
Append( shape );
799 snprintf(
name,
sizeof(
name),
"Via[%d-%d]_%.6g:%.6g_um",
800 aTopLayer, aBotLayer, dsnDiameter,
802 IU2um( aDrillDiameter )
817 aVia->LayerPair( &topLayerNum, &botLayerNum );
822 if( topLayer > botLayer )
823 std::swap( topLayer, botLayer );
825 return makeVia( aVia->GetWidth(), aVia->GetDrillValue(), topLayer, botLayer );
836 for(
int cnt = 0; cnt < outlines.
OutlineCount(); cnt++ )
839 boundary->
paths.push_back( path );
844 for(
int ii = 0; ii < outline.
PointCount(); ii++ )
846 wxPoint pos( outline.
Point( ii ).
x, outline.
Point( ii ).
y );
851 wxPoint pos0( outline.
Point( 0 ).
x, outline.
Point( 0 ).
y );
855 for(
int ii = 0; ii < outlines.
HoleCount( cnt ); ii++ )
859 PATH* poly_ko =
new PATH( NULL, T_polygon );
867 for(
int jj = 0; jj < hole.
PointCount(); jj++ )
879 if( !errMessage.IsEmpty() )
880 wxLogMessage( errMessage );
898 items.
Collect( aBoard, scanMODULEs );
914 if( !refpair.second )
935 for(
int pcbNdx=0; pcbNdx<layerCount; ++pcbNdx )
948 case LT_SIGNAL: layerType = T_signal;
break;
949 case LT_POWER: layerType = T_power;
break;
951 #if 1 // Freerouter does not support type "mixed", only signal and power. 953 case LT_MIXED: layerType = T_signal;
break;
955 case LT_MIXED: layerType = T_mixed;
break;
957 case LT_JUMPER: layerType = T_jumper;
break;
964 property->name =
"index";
966 sprintf( temp,
"%d", pcbNdx );
967 property->value = temp;
1003 int defaultTrackWidth = defaultClass->GetTrackWidth();
1004 int defaultClearance = defaultClass->GetClearance();
1006 double clearance =
scale( defaultClearance );
1010 sprintf( rule,
"(width %.6g)",
scale( defaultTrackWidth ) );
1011 rules.push_back( rule );
1013 sprintf( rule,
"(clearance %.6g)", clearance +
safetyMargin );
1014 rules.push_back( rule );
1026 if( default_smd <= 6.0 )
1029 sprintf( rule,
"(clearance %.6g (type default_smd))", default_smd );
1031 rules.push_back( rule );
1059 clearance =
scale( defaultClearance ) / 4;
1061 sprintf( rule,
"(clearance %.6g (type smd_smd))", clearance );
1062 rules.push_back( rule );
1069 int netlessZones = 0;
1072 items.
Collect( aBoard, scanZONEs );
1089 PATH* mainPolygon =
new PATH( plane, T_polygon );
1095 if( plane->
name.size() == 0 )
1103 sprintf(
name,
"@:no_net_%d", netlessZones++ );
1118 bool is_first_point =
true;
1122 wxPoint point( iterator->x, iterator->y );
1124 if( is_first_point )
1127 is_first_point =
false;
1144 bool isStartContour =
true;
1147 for( iterator++; iterator; iterator++ )
1149 if( isStartContour )
1151 is_first_point =
true;
1152 window =
new WINDOW( plane );
1156 cutout =
new PATH( window, T_polygon );
1170 wxPoint point(iterator->x, iterator->y );
1172 if( is_first_point )
1175 is_first_point =
false;
1190 items.
Collect( aBoard, scanZONEs );
1206 keepout_type = T_keepout;
1208 keepout_type = T_via_keepout;
1210 keepout_type = T_wire_keepout;
1212 keepout_type = T_keepout;
1218 for(
int layer = 0; layer < copperCount; layer++ )
1220 if( layer == copperCount-1)
1229 PATH* mainPolygon =
new PATH( keepout, T_polygon );
1236 bool is_first_point =
true;
1241 wxPoint point( iterator->x, iterator->y );
1243 if( is_first_point )
1246 is_first_point =
false;
1259 WINDOW* window =
nullptr;
1260 PATH* cutout =
nullptr;
1262 bool isStartContour =
true;
1265 for( iterator++; iterator; iterator++ )
1267 if( isStartContour )
1269 is_first_point =
true;
1270 window =
new WINDOW( keepout );
1273 cutout =
new PATH( window, T_polygon );
1285 wxPoint point(iterator->x, iterator->y );
1287 if( is_first_point )
1290 is_first_point =
false;
1307 std::string componentId;
1315 nets.resize( highestNetCode + 1, NULL );
1317 for(
unsigned i = 1 ;
i <
nets.size(); ++
i )
1320 for(
unsigned ii = 0; ii < aBoard->
GetNetCount(); ii++ )
1323 int netcode = net->
GetNet();
1329 items.
Collect( aBoard, scanMODULEs );
1333 for(
int m = 0; m<items.
GetCount(); ++m )
1349 for(
unsigned p = 0; p<image->
pins.size(); ++p )
1371 if( registered != image )
1383 comp->
places.push_back( place );
1397 place->
side = T_back;
1413 for(
unsigned n = 1; n<
nets.size(); ++n )
1417 if( net->
pins.size() )
1453 NETCLASSPTR netclass = nclasses.
GetDefault();
1455 PADSTACK* via =
makeVia( netclass->GetViaDiameter(), netclass->GetViaDrill(),
1471 for(
unsigned i = 0;
i < aBoard->m_ViasDimensionsList.size(); ++
i )
1473 int viaSize = aBoard->m_ViasDimensionsList[
i].m_Diameter;
1474 int viaDrill = aBoard->m_ViasDimensionsList[
i].m_Drill;
1476 via =
makeVia( viaSize, viaDrill,
1482 if( registered != via )
1493 netclass = nc->second;
1495 via =
makeVia( netclass->GetViaDiameter(), netclass->GetViaDrill(),
1501 if( registered != via )
1507 #if 1 // do existing wires and vias 1515 items.
Collect( aBoard, scanTRACKs );
1517 std::string netname;
1521 int old_netcode = -1;
1534 if( old_netcode != netcode ||
1543 if( old_netcode != netcode )
1545 old_netcode = netcode;
1553 wiring->
wires.push_back( wire );
1561 path =
new PATH( wire );
1582 items.
Collect( aBoard, scanVIAs );
1589 int netcode = via->GetNetCode();
1599 if( padstack != registered )
1620 #endif // do existing wires and vias 1632 for(
unsigned viaNdx = 0; viaNdx <
pcb->
library->
vias.size(); ++viaNdx )
1646 NETCLASSPTR netclass = nc->second;
1696 clazz->
rules =
new RULE( clazz, T_rule );
1699 int trackWidth = aNetClass->GetTrackWidth();
1700 sprintf( text,
"(width %.6g)",
scale( trackWidth ) );
1704 int clearance = aNetClass->GetClearance();
1718 PADSTACK* via =
makeVia( aNetClass->GetViaDiameter(), aNetClass->GetViaDrill(),
1721 snprintf( text,
sizeof(text),
"(use_via %s)", via->
GetPadstackId().c_str() );
1722 clazz->
circuit.push_back( text );
1730 for(
auto module : aBoard->
Modules() )
1732 module->SetFlag( 0 );
1733 if( module->GetLayer() ==
B_Cu )
1736 module->SetFlag( 1 );
1751 for(
auto module : aBoard->
Modules() )
1753 if( module->GetFlag() )
1756 module->SetFlag( 0 );
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Class VIA corresponds to the <via_descriptor> in the specctra dsn spec.
void FixNegativeZero()
Function FixNegativeZero will change negative zero to positive zero in the IEEE floating point storag...
NETINFO_ITEM * FindNet(int aNetcode) const
Function FindNet searches for a net with the given netcode.
Class PIN_REF corresponds to the <pin_reference> definition in the specctra dsn spec.
Class ZONE_CONTAINER handles a list of polygons defining a copper zone.
static wxString ShowShape(STROKE_T aShape)
Function ShowShape converts the enum STROKE_T integer value to a wxString.
bool space_in_quoted_tokens
void SetAperture(double aWidth)
void buildLayerMaps(BOARD *aBoard)
Function buildLayerMaps creates a few data translation structures for layer name and number mapping b...
static bool isRoundKeepout(D_PAD *aPad)
Function isRoundKeepout decides if the pad is a copper-less through hole which needs to be made into ...
int GetNetCode() const
Function GetNetCode.
std::map< wxString, int > PINMAP
data type used to ensure unique-ness of pin names, holding (wxString and int)
int OutlineCount() const
Returns the number of outlines in the set
const wxPoint & GetPos0() const
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Function GetLineLength returns the length of a line segment defined by aPointA and aPointB.
void exportNETCLASS(const std::shared_ptr< NETCLASS > &aNetClass, BOARD *aBoard)
Function exportNETCLASS exports aNetClass to the DSN file.
Class NET corresponds to a <net_descriptor> in the DSN spec.
bool IsEndContour() const
Function IsEndContour.
This source file implements export and import capabilities to the specctra dsn file format.
int GetArcToSegmentCount(int aRadius, int aErrorMax, double aArcAngleDegree)
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
STRINGS circuit
circuit descriptor list
This file is part of the common library TODO brief description.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Implementation of conversion functions that require both schematic and board internal units.
This file is part of the common library.
static const double safetyMargin
const wxPoint & GetStart() const
STROKE_T GetShape() const
virtual bool IsOnLayer(PCB_LAYER_ID) const override
Function IsOnLayer tests to see if this object is on the given layer.
void TransformRoundChamferedRectToPolygon(SHAPE_POLY_SET &aCornerBuffer, const wxPoint &aPosition, const wxSize &aSize, double aRotation, int aCornerRadius, double aChamferRatio, int aChamferCorners, int aApproxErrorMax, int aMinSegPerCircleCount)
convert a rectangle with rounded corners and/or chamfered corners to a polygon Convert rounded corner...
double GetOrientationDegrees() const
static POINT mapPt(const wxPoint &pt)
Function mapPt converts a KiCad point into a DSN file point.
static double IU2um(int kicadDist)
IMAGE * LookupIMAGE(IMAGE *aImage)
Function LookupIMAGE will add the image only if one exactly like it does not already exist in the ima...
class ZONE_CONTAINER, a zone area
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
void SetLayerId(const char *aLayerId)
const wxString GetValue() const
Function GetValue.
void SetLayerId(const char *aLayerId)
int kiNetCode
KiCad netcode.
void fillBOUNDARY(BOARD *aBoard, BOUNDARY *aBoundary)
Function fillBOUNDARY makes the board perimeter for the DSN file by filling the BOUNDARY element in t...
SHAPE_LINE_CHAIN & Hole(int aOutline, int aHole)
Returns the reference to aHole-th hole in the aIndex-th outline
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
usual segment : line with rounded ends
void AppendPoint(const POINT &aPoint)
class D_PAD, a pad in a footprint
Class CLASS corresponds to the <class_descriptor> in the specctra spec.
const LIB_ID & GetFPID() const
void NORMALIZE_ANGLE_DEGREES_POS(double &Angle)
void SetPCB(PCB *aPcb)
Function SetPCB deletes any existing PCB and replaces it with the given one.
void SetRotation(double aRotation)
const wxPoint & GetEnd() const
Function GetEnd returns the ending point of the graphic.
void BuildConvexHull(std::vector< wxPoint > &aResult, const std::vector< wxPoint > &aPoly)
Calculate the convex hull of a list of points in counter-clockwise order.
int PointCount() const
Function PointCount()
void SetLayerId(const char *aLayerId)
static PCB * MakePCB()
Function MakePCB makes a PCB with all the default ELEMs and parts on the heap.
void SetVertex(const POINT &aPoint)
class EDGE_MODULE, a footprint edge
IMAGE * makeIMAGE(BOARD *aBoard, MODULE *aModule)
Function makeIMAGE allocates an IMAGE on the heap and creates all the PINs according to the D_PADs in...
search types array terminator (End Of Types)
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
void FlipMODULEs(BOARD *aBoard)
Function FlipMODULEs flips the modules which are on the back side of the board to the front.
Class RULE corresponds to the <rule_descriptor> in the specctra dsn spec.
void SetVertex(const POINT &aVertex)
std::set< std::string > STRINGSET
Definitions for tracks, vias and zones.
class TRACK, a track segment (segment on a copper layer)
This file contains miscellaneous commonly used macros and functions.
void SetShape(ELEM *aShape)
PADSTACK * makePADSTACK(BOARD *aBoard, D_PAD *aPad)
Function makePADSTACK creates a PADSTACK which matches the given pad.
const wxString GetReference() const
Function GetReference.
static const KICAD_T scanPADs[]
int GetChamferPositions() const
has meaning only for chamfered rect pads
const char * c_str() const
bool GetDoNotAllowVias() const
Class PATH supports both the <path_descriptor> and the <polygon_descriptor> per the specctra dsn spec...
std::pair< STRINGSET::iterator, bool > STRINGSET_PAIR
const wxPoint & GetStart0() const
const std::string & GetPadstackId()
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes.
int GetCount() const
Function GetCount returns the number of objects in the list.
void SynchronizeNetsAndNetClasses()
Function SynchronizeNetsAndNetClasses copies NETCLASS info to each NET, based on NET membership in a ...
DSN_T layer_type
one of: T_signal, T_power, T_mixed, T_jumper
const VECTOR2I & CPoint(int aIndex) const
Function CPoint()
NETCLASS_MAP::iterator iterator
segment with non rounded ends
class MODULE, a footprint
void SetShape(ELEM *aShape)
STRINGSET::iterator iterator
PCB_LAYER_ID
A quick note on layer IDs:
Class LSET is a set of PCB_LAYER_IDs.
Class NETCLASSES is a container for NETCLASS instances.
void AddWindow(WINDOW *aWindow)
unsigned GetNetCount() const
Function GetNetCount.
virtual const wxString What() const
A composite of Problem() and Where()
Class COPPER_PLANE corresponds to a <plane_descriptor> in the specctra dsn spec.
static const char Default[]
the name of the default NETCLASS
void deleteNETs()
Function deleteNETs deletes all the NETs that may be in here.
SHAPE_LINE_CHAIN & Outline(int aIndex)
Returns the reference to aIndex-th outline in the set
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Class PLACE implements the <placement_reference> in the specctra dsn spec.
const wxPoint & GetOffset() const
double GetChamferRectRatio() const
has meaning only for chamfered rect pads
LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition of file extensions used in Kicad.
const wxString & GetNetname() const
Function GetNetname.
void AddPadstack(PADSTACK *aPadstack)
const wxString & GetName() const
double GetOrientationDegrees() const
std::string component_id
reference designator
Class PADSTACK holds either a via or a pad definition.
a few functions useful in geometry calculations.
#define THROW_IO_ERROR(msg)
int m_top_via_layer
specctra cu layers, 0 based index:
bool GetBoardPolygonOutlines(SHAPE_POLY_SET &aOutlines, wxString *aErrorText=nullptr, wxPoint *aErrorLocation=nullptr)
Function GetBoardPolygonOutlines Extracts the board outlines and build a closed polygon from lines,...
std::vector< std::string > STRINGS
Class SPECCTRA_DB holds a DSN data tree, usually coming from a DSN file.
const wxSize & GetDelta() const
const wxString & GetNetname() const
Function GetNetname.
static PATH * makePath(const POINT &aStart, const POINT &aEnd, const std::string &aLayerName)
Function makePath creates a PATH element with a single straight line, a pair of vertices.
int HoleCount(int aOutline) const
Returns the number of holes in a given outline
std::vector< int > kicadLayer2pcb
maps BOARD layer number to PCB layer numbers
COMPONENT * LookupCOMPONENT(const std::string &imageName)
Function LookupCOMPONENT looks up a COMPONENT by name.
void Collect(BOARD_ITEM *aBoard, const KICAD_T aScanList[])
Collect BOARD_ITEM objects using this class's Inspector method, which does the collection.
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
void SetRotation(double aRotation)
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
Class SHAPE corresponds to the "(shape ..)" element in the specctra dsn spec.
LAYER_T GetLayerType(PCB_LAYER_ID aLayer) const
Function GetLayerType returns the type of the copper layer given by aLayer.
Class NETINFO_ITEM handles the data for a net.
void RevertMODULEs(BOARD *aBoard)
Function RevertMODULEs flips the modules which were on the back side of the board back to the back.
PADSTACK * LookupVia(PADSTACK *aVia)
Function LookupVia will add the via only if one exactly like it does not already exist in the padstac...
Class COMPONENT implements the <component_descriptor> in the specctra dsn spec.
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Struct POINT is a holder for a point in the SPECCTRA DSN coordinate system.
void FromBOARD(BOARD *aBoard)
Function FromBOARD adds the entire BOARD to the PCB but does not write it out.
const PCB_GENERAL_SETTINGS & GeneralSettings() const
Class WIRE corresponds to <wire_shape_descriptor> in the specctra dsn spec.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
NETCLASSPTR GetDefault() const
Function GetDefault.
void SetCorners(const POINT &aPoint0, const POINT &aPoint1)
void ExportPCB(const wxString &aFilename, bool aNameChange=false)
Function ExportPCB writes the internal PCB instance out as a SPECTRA DSN format file.
STRINGS layerIds
indexed by PCB layer number
int GetNet() const
Function GetNet.
void AppendVia(PADSTACK *aVia)
Function AppendVia adds aVia to the internal via container.
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
SHAPE_POLY_SET::ITERATOR IterateWithHoles()
Function IterateWithHoles returns an iterator to visit all points of the zone's main outline with hol...
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
static double mapY(int y)
int GetCopperLayerCount() const
Function GetCopperLayerCount.
const wxSize & GetDrillSize() const
static double mapX(int x)
const SHAPE_POLY_SET & GetCustomShapeAsPolygon() const
Accessor to the custom shape as one polygon.
Class EDA_RECT handles the component boundary box.
void SetShape(ELEM *aShape)
static bool empty(const wxTextEntryBase *aCtrl)
static double scale(int kicadDist)
Function scale converts a distance from PCBNEW internal units to the reported specctra dsn units in f...
void SetBOUNDARY(BOUNDARY *aBoundary)
const wxPoint & GetEnd() const
void AppendVia(const char *aViaName)
int GetRoundRectCornerRadius() const
Function GetRoundRectCornerRadius Has meaning only for rounded rect pads.
bool GetDoNotAllowTracks() const
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
NETCLASSPTR GetDefault() const
Function GetDefault.
const wxPoint & GetEnd0() const
VECTOR2I & Point(int aIndex)
Function Point()
class VIA, a via (like a track segment on a copper layer)
Class WIRE_VIA corresponds to <wire_via_descriptor> in the specctra dsn spec.
const wxPoint & GetStart() const
Function GetStart returns the starting point of the graphic.
void SetVertex(const POINT &aVertex)
PAD_SHAPE_T GetShape() const
Function GetShape.
Module description (excepted pads)
wxPoint m_Start0
Start point or center, relative to module origin, orient 0.
Collect all BOARD_ITEM objects of a given set of KICAD_T type(s).
std::vector< PCB_LAYER_ID > pcbLayer2kicad
maps PCB layer number to BOARD layer numbers
const wxSize & GetSize() const
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Function IsOnLayer tests to see if this object is on the given layer.
EDGE_MODULE class definition.
Class KEEPOUT is used for <keepout_descriptor> and <plane_descriptor>.
std::vector< NET * > nets
we don't want ownership here permanently, so we don't use boost::ptr_vector
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
void SetPadstackId(const char *aPadstackId)
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
const wxPoint GetPosition() const override
void SetDiameter(double aDiameter)
Class WIRING corresponds to <wiring_descriptor> in the specctra dsn spec.
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
PADSTACK * makeVia(int aCopperDiameter, int aDrillDiameter, int aTopLayer, int aBotLayer)
Function makeVia makes a round through hole PADSTACK using the given KiCad diameter in deci-mils.
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
bool ExportSpecctraFile(const wxString &aFullFilename)
Function ExportSpecctraFile will export the current BOARD to a specctra dsn file.
STRINGS rules
rules are saved in std::string form.