69 #define EXPORT_CUSTOM_PADS_CONVEX_HULL 89 bool wasModified = screen->
IsModify();
114 errorText = ioe.
What();
128 SetStatusText( wxString(
_(
"BOARD exported OK." ) ) );
133 _(
"Unable to export, please fix and try again" ),
154 static inline double scale(
int kicadDist )
157 return kicadDist / (
IU_PER_MM / 1000.0 );
162 static inline double IU2um(
int kicadDist )
168 static inline double mapX(
int x )
174 static inline double mapY(
int y )
190 ret.
x =
mapX( pt.x );
191 ret.
y =
mapY( pt.y );
235 std::string uniqifier;
242 int reportedLayers = 0;
249 bool onAllCopperLayers = ( (aPad->
GetLayerSet() & all_cu) == all_cu );
251 if( onAllCopperLayers )
256 for(
int layer=0; layer<copperCount; ++layer )
260 if( onAllCopperLayers || aPad->
IsOnLayer( kilayer ) )
262 layerName[reportedLayers++] =
m_layerIds[layer].c_str();
264 if( !onAllCopperLayers )
268 else if( layer == copperCount - 1 )
271 uniqifier += char(
'0' + layer);
286 dsnOffset =
mapPt( offset );
290 sprintf( offsetTxt,
"[%.6g,%.6g]", dsnOffset.x, dsnOffset.y );
292 uniqifier += offsetTxt;
301 for(
int ndx=0; ndx<reportedLayers; ++ndx )
305 padstack->
Append( shape );
316 snprintf(
name,
sizeof(
name),
"Round%sPad_%.6g_um",
330 POINT lowerLeft( -dx, -dy );
331 POINT upperRight( dx, dy );
333 lowerLeft += dsnOffset;
334 upperRight += dsnOffset;
336 for(
int ndx=0; ndx<reportedLayers; ++ndx )
340 padstack->
Append( shape );
350 snprintf(
name,
sizeof(
name),
"Rect%sPad_%.6gx%.6g_um",
374 pstart =
POINT( -dr, 0.0 );
375 pstop =
POINT( dr, 0.0 );
382 pstart =
POINT( 0.0, -dr );
383 pstop =
POINT( 0.0, dr );
389 for(
int ndx=0; ndx<reportedLayers; ++ndx )
394 shape =
new SHAPE( padstack );
396 padstack->
Append( shape );
397 path =
makePath( pstart, pstop, layerName[ndx] );
402 snprintf(
name,
sizeof(
name),
"Oval%sPad_%.6gx%.6g_um",
421 POINT lowerLeft( -dx - ddy, -dy - ddx );
422 POINT upperLeft( -dx + ddy, +dy + ddx );
423 POINT upperRight( +dx - ddy, +dy - ddx );
424 POINT lowerRight( +dx + ddy, -dy + ddx );
426 lowerLeft += dsnOffset;
427 upperLeft += dsnOffset;
428 upperRight += dsnOffset;
429 lowerRight += dsnOffset;
431 for(
int ndx=0; ndx<reportedLayers; ++ndx )
435 padstack->
Append( shape );
438 PATH* polygon =
new PATH( shape, T_polygon );
451 snprintf(
name,
sizeof(
name),
"Trapz%sPad_%.6gx%.6g_%c%.6gx%c%.6g_um",
468 const int circleToSegmentsCount = 36;
479 double correctionFactor = cos( M_PI / (
double) circleToSegmentsCount );
480 int extra_clearance =
KiROUND( rradius * (1.0 - correctionFactor ) );
481 wxSize psize = aPad->
GetSize();
482 psize.x += extra_clearance*2;
483 psize.y += extra_clearance*2;
484 rradius += extra_clearance;
495 for(
int ndx=0; ndx < reportedLayers; ++ndx )
499 padstack->
Append( shape );
502 PATH* polygon =
new PATH( shape, T_polygon );
510 for(
int idx = 0; idx < polygonal_shape.PointCount(); idx++ )
512 POINT corner(
scale( polygonal_shape.CPoint( idx ).x ),
513 scale( -polygonal_shape.CPoint( idx ).y ) );
518 first_corner = corner;
524 snprintf(
name,
sizeof(
name),
"RoundRect%sPad_%.6gx%.6g_%.6g_um_%f_%X",
539 std::vector<wxPoint> polygonal_shape;
543 #ifdef EXPORT_CUSTOM_PADS_CONVEX_HULL 548 for(
int ii = 0; ii < p_outline.
PointCount(); ++ii )
549 polygonal_shape.push_back( wxPoint( p_outline.
CPoint( ii ) ) );
553 if( polygonal_shape.front() != polygonal_shape.back() )
554 polygonal_shape.push_back( polygonal_shape.front() );
556 for(
int ndx=0; ndx < reportedLayers; ++ndx )
560 padstack->
Append( shape );
563 PATH* polygon =
new PATH( shape, T_polygon );
569 for(
unsigned idx = 0; idx < polygonal_shape.size(); idx++ )
571 POINT corner(
scale( polygonal_shape[idx].x ),
scale( -polygonal_shape[idx].y ) );
580 snprintf(
name,
sizeof(
name),
"Cust%sPad_%.6gx%.6g_%.6gx_%.6g_%d_um_%s",
583 (
int)polygonal_shape.size(), hash.
Format(
true ).c_str() );
614 for(
int p=0; p < fpItems.
GetCount(); ++p )
616 PAD* pad = (
PAD*) fpItems[p];
626 for(
int layer=0; layer<layerCount; ++layer )
630 image->
keepouts.push_back( keepout );
649 if( !mask_copper_layers.any() )
653 PADSTACKSET::iterator iter =
m_padstackset.find( *padstack );
659 padstack = (
PADSTACK*) *iter.base();
666 PIN* pin =
new PIN( image );
671 if( padName!=wxEmptyString && pinmap.find( padName )==pinmap.end() )
673 pinmap[ padName ] = 0;
679 int duplicates = ++pinmap[ padName ];
681 sprintf( buf,
"@%d", duplicates );
688 image->
pins.push_back( pin );
702 #if 1 // enable image (outline) scopes. 706 fpItems.
Collect( aFootprint, scanEDGEs );
708 for(
int i = 0; i < fpItems.
GetCount(); ++i )
717 outline =
new SHAPE( image, T_outline );
720 path =
new PATH( outline );
734 outline =
new SHAPE( image, T_outline );
737 path =
new PATH( outline );
757 wxPoint point(
KiROUND( radius * cos( radians ) ),
758 KiROUND( radius * sin( radians ) ) );
765 wxPoint point( radius , 0 );
785 int aTopLayer,
int aBotLayer )
789 double dsnDiameter =
scale( aCopperDiameter );
791 for(
int layer=aTopLayer; layer<=aBotLayer; ++layer )
795 padstack->
Append( shape );
805 snprintf(
name,
sizeof(
name),
"Via[%d-%d]_%.6g:%.6g_um",
806 aTopLayer, aBotLayer, dsnDiameter,
808 IU2um( aDrillDiameter )
823 aVia->LayerPair( &topLayerNum, &botLayerNum );
828 if( topLayer > botLayer )
829 std::swap( topLayer, botLayer );
831 return makeVia( aVia->GetWidth(), aVia->GetDrillValue(), topLayer, botLayer );
841 wxLogWarning(
_(
"Board outline is malformed. Run DRC for a full analysis." ) );
844 for(
int cnt = 0; cnt < outlines.
OutlineCount(); cnt++ )
847 boundary->
paths.push_back( path );
852 for(
int ii = 0; ii < outline.
PointCount(); ii++ )
863 for(
int ii = 0; ii < outlines.
HoleCount( cnt ); ii++ )
875 for(
int jj = 0; jj < hole.
PointCount(); jj++ )
903 items.
Collect( aBoard, scanMODULEs );
907 for(
int i=0; i<items.
GetCount(); ++i )
914 _(
"Symbol with value of \"%s\" has empty reference id." ),
921 if( !refpair.second )
924 _(
"Multiple symbols have identical reference IDs of \"%s\"." ),
943 for(
int pcbNdx=0; pcbNdx<layerCount; ++pcbNdx )
956 case LT_SIGNAL: layerType = T_signal;
break;
957 case LT_POWER: layerType = T_power;
break;
959 #if 1 // Freerouter does not support type "mixed", only signal and power. 961 case LT_MIXED: layerType = T_signal;
break;
963 case LT_MIXED: layerType = T_mixed;
break;
965 case LT_JUMPER: layerType = T_jumper;
break;
972 property->name =
"index";
974 sprintf( temp,
"%d", pcbNdx );
975 property->value = temp;
1014 double clearance =
scale( defaultClearance );
1018 sprintf( rule,
"(width %.6g)",
scale( defaultTrackWidth ) );
1019 rules.push_back( rule );
1021 sprintf( rule,
"(clearance %.6g)", clearance +
safetyMargin );
1022 rules.push_back( rule );
1034 if( default_smd <= 6.0 )
1037 sprintf( rule,
"(clearance %.6g (type default_smd))", default_smd );
1039 rules.push_back( rule );
1067 clearance =
scale( defaultClearance ) / 4;
1069 sprintf( rule,
"(clearance %.6g (type smd_smd))", clearance );
1070 rules.push_back( rule );
1077 int netlessZones = 0;
1080 items.
Collect( aBoard, scanZONEs );
1082 for(
int i = 0; i<items.
GetCount(); ++i )
1097 PATH* mainPolygon =
new PATH( plane, T_polygon );
1103 if( plane->
name.size() == 0 )
1111 sprintf(
name,
"@:no_net_%d", netlessZones++ );
1126 bool is_first_point =
true;
1130 wxPoint point( iterator->x, iterator->y );
1132 if( is_first_point )
1135 is_first_point =
false;
1152 bool isStartContour =
true;
1155 for( iterator++; iterator; iterator++ )
1157 if( isStartContour )
1159 is_first_point =
true;
1160 window =
new WINDOW( plane );
1164 cutout =
new PATH( window, T_polygon );
1178 wxPoint point(iterator->x, iterator->y );
1180 if( is_first_point )
1183 is_first_point =
false;
1198 items.
Collect( aBoard, scanZONEs );
1200 for(
int i=0; i<items.
GetCount(); ++i )
1214 keepout_type = T_keepout;
1216 keepout_type = T_via_keepout;
1218 keepout_type = T_wire_keepout;
1220 keepout_type = T_keepout;
1226 for(
int layer = 0; layer < copperCount; layer++ )
1228 if( layer == copperCount-1)
1237 PATH* mainPolygon =
new PATH( keepout, T_polygon );
1244 bool is_first_point =
true;
1249 wxPoint point( iterator->x, iterator->y );
1251 if( is_first_point )
1254 is_first_point =
false;
1267 WINDOW* window =
nullptr;
1268 PATH* cutout =
nullptr;
1270 bool isStartContour =
true;
1273 for( iterator++; iterator; iterator++ )
1275 if( isStartContour )
1277 is_first_point =
true;
1278 window =
new WINDOW( keepout );
1281 cutout =
new PATH( window, T_polygon );
1293 wxPoint point(iterator->x, iterator->y );
1295 if( is_first_point )
1298 is_first_point =
false;
1315 std::string componentId;
1318 int highestNetCode = 0;
1322 highestNetCode = std::max( highestNetCode, i->GetNetCode() );
1329 for(
unsigned i = 1 ; i <
m_nets.size(); ++i )
1334 if( i->GetNetCode() > 0 )
1335 m_nets[i->GetNetCode()]->net_id =
TO_UTF8( i->GetNetname() );
1338 items.
Collect( aBoard, scanMODULEs );
1342 for(
int m = 0; m<items.
GetCount(); ++m )
1358 for(
unsigned p = 0; p<image->
pins.size(); ++p )
1392 comp->
places.push_back( place );
1406 place->
side = T_back;
1422 for(
unsigned n = 1; n <
m_nets.size(); ++n )
1426 if( net->
pins.size() )
1462 NETCLASSPTR netclass = nclasses.
GetDefault();
1464 PADSTACK* via =
makeVia( netclass->GetViaDiameter(), netclass->GetViaDrill(),
1480 for(
unsigned i = 0; i < aBoard->m_ViasDimensionsList.size(); ++i )
1482 int viaSize = aBoard->m_ViasDimensionsList[i].m_Diameter;
1483 int viaDrill = aBoard->m_ViasDimensionsList[i].m_Drill;
1485 via =
makeVia( viaSize, viaDrill,
1502 netclass = nc->second;
1504 via =
makeVia( netclass->GetViaDiameter(), netclass->GetViaDrill(),
1516 #if 1 // do existing wires and vias 1524 items.
Collect( aBoard, scanTRACKs );
1526 std::string netname;
1530 int old_netcode = -1;
1534 for(
int i=0; i<items.
GetCount(); ++i )
1543 if( old_netcode != netcode ||
1552 if( old_netcode != netcode )
1554 old_netcode = netcode;
1562 wiring->
wires.push_back( wire );
1570 path =
new PATH( wire );
1591 items.
Collect( aBoard, scanVIAs );
1593 for(
int i = 0; i<items.
GetCount(); ++i )
1598 int netcode = via->GetNetCode();
1629 #endif // do existing wires and vias 1655 NETCLASSPTR netclass = nc->second;
1705 clazz->
rules =
new RULE( clazz, T_rule );
1708 int trackWidth = aNetClass->GetTrackWidth();
1709 sprintf( text,
"(width %.6g)",
scale( trackWidth ) );
1713 int clearance = aNetClass->GetClearance();
1727 PADSTACK* via =
makeVia( aNetClass->GetViaDiameter(), aNetClass->GetViaDrill(),
1730 snprintf( text,
sizeof(text),
"(use_via %s)", via->
GetPadstackId().c_str() );
1731 clazz->
circuit.push_back( text );
1745 footprint->SetFlag( 0 );
1746 if( footprint->GetLayer() ==
B_Cu )
1748 footprint->Flip( footprint->GetPosition(), false );
1749 footprint->SetFlag( 1 );
1767 if( footprint->GetFlag() )
1769 footprint->Flip( footprint->GetPosition(), false );
1770 footprint->SetFlag( 0 );
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
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
Search for a net with the given netcode.
PIN_REF corresponds to the <pin_reference> definition in the specctra dsn spec.
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...
SHAPE_POLY_SET::ITERATOR IterateWithHoles()
Function IterateWithHoles returns an iterator to visit all points of the zone's main outline with hol...
std::map< wxString, int > PINMAP
data type used to ensure unique-ness of pin names, holding (wxString and int)
int OutlineCount() const
Return the number of vertices in a given outline/hole.
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Return 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.
NET corresponds to a <net_descriptor> in the DSN spec.
bool IsEndContour() const
bool GetBoardPolygonOutlines(SHAPE_POLY_SET &aOutlines, OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr)
Extract the board outlines and build a closed polygon from lines, arcs and circle items on edge cut l...
This source file implements export and import capabilities to the specctra dsn file format.
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
STRINGS circuit
circuit descriptor list
static bool isRoundKeepout(PAD *aPad)
Function isRoundKeepout decides if the pad is a copper-less through hole which needs to be made into ...
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.
const wxPoint & GetEnd() const
Function GetEnd returns the ending point of the graphic.
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
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
static constexpr double IU_PER_MM
Mock up a conversion function.
bool m_footprintsAreFlipped
bool GetDoNotAllowVias() 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...
void SetLayerId(const char *aLayerId)
void SetLayerId(const char *aLayerId)
int kiNetCode
KiCad netcode.
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
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)
Return the aIndex-th subpolygon in the set.
const wxPoint & GetStart0() const
void TransformRoundChamferedRectToPolygon(SHAPE_POLY_SET &aCornerBuffer, const wxPoint &aPosition, const wxSize &aSize, double aRotation, int aCornerRadius, double aChamferRatio, int aChamferCorners, int aError, ERROR_LOC aErrorLoc)
convert a rectangle with rounded corners and/or chamfered corners to a polygon Convert rounded corner...
usual segment : line with rounded ends
wxString GetNetname() const
STRINGS m_layerIds
indexed by PCB layer number
virtual bool IsOnLayer(PCB_LAYER_ID) const override
Test to see if this object is on the given layer.
IMAGE * makeIMAGE(BOARD *aBoard, FOOTPRINT *aFootprint)
Function makeIMAGE allocates an IMAGE on the heap and creates all the PINs according to the PADs in t...
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
const NETINFO_LIST & GetNetInfo() const
class FP_SHAPE, a footprint edge
void AppendPoint(const POINT &aPoint)
class PAD, a pad in a footprint
CLASS corresponds to the <class_descriptor> in the specctra spec.
PAD_SHAPE_T GetShape() 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)
segment with non rounded ends
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)
search types array terminator (End Of Types)
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
RULE corresponds to the <rule_descriptor> in the specctra dsn spec.
void SetVertex(const POINT &aVertex)
std::set< std::string > STRINGSET
class TRACK, a track segment (segment on a copper layer)
This file contains miscellaneous commonly used macros and functions.
void SetShape(ELEM *aShape)
static const KICAD_T scanPADs[]
const char * c_str() const
PATH supports both the <path_descriptor> and the <polygon_descriptor> per the specctra dsn spec.
std::pair< STRINGSET::iterator, bool > STRINGSET_PAIR
std::vector< NET * > m_nets
we don't want ownership here permanently, so we don't use boost::ptr_vector
const std::string & GetPadstackId()
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
int GetCount() const
Return the number of objects in the list.
void SynchronizeNetsAndNetClasses()
Copy NETCLASS info to each NET, based on NET membership in a NETCLASS.
DSN_T layer_type
one of: T_signal, T_power, T_mixed, T_jumper
const VECTOR2I & CPoint(int aIndex) const
Function Point()
NETCLASS_MAP::iterator iterator
void SetShape(ELEM *aShape)
const wxPoint & GetOffset() const
const wxSize & GetDrillSize() const
STRINGSET::iterator iterator
PCB_LAYER_ID
A quick note on layer IDs:
int GetTrackWidth() const
std::vector< int > m_kicadLayer2pcb
maps BOARD layer number to PCB layer numbers
LSET is a set of PCB_LAYER_IDs.
A container for NETCLASS instances.
void AddWindow(WINDOW *aWindow)
virtual const wxString What() const
A composite of Problem() and Where()
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.
Container for NETINFO_ITEM elements, which are the nets.
Represent a set of closed polygons.
SHAPE_LINE_CHAIN & Outline(int aIndex)
virtual PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
Handles how to draw a screen (a board, a schematic ...)
FOOTPRINTS & Footprints()
void RevertFOOTPRINTs(BOARD *aBoard)
Function RevertFOOTPRINTs flips the footprints which were on the back side of the board back to the b...
PLACE implements the <placement_reference> in the specctra dsn spec.
const wxSize & GetSize() const
A collection of nets and the parameters used to route or test these nets.
const wxPoint & GetStart() const
Function GetStart returns the starting point of the graphic.
bool GetDoNotAllowTracks() const
const wxString & GetName() const
const wxString & GetNetname() const
void AddPadstack(PADSTACK *aPadstack)
const EDA_RECT GetBoundingBox() const override
The bounding box is cached, so this will be efficient most of the time.
wxPoint m_Start0
Start point or center, relative to footprint origin, orient 0.
std::string component_id
reference designator
PADSTACK holds either a via or a pad definition.
NETCLASSES & GetNetClasses() const
a few functions useful in geometry calculations.
ZONE handles a list of polygons defining a copper zone.
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
class ZONE, a copper pour area
int m_top_via_layer
specctra cu layers, 0 based index:
std::vector< std::string > STRINGS
SPECCTRA_DB holds a DSN data tree, usually coming from a DSN file.
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
Return the reference to aIndex-th outline in the set.
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.
PADSTACK * makePADSTACK(BOARD *aBoard, PAD *aPad)
Function makePADSTACK creates a PADSTACK which matches the given pad.
void SetRotation(double aRotation)
int LAYER_NUM
This can be replaced with int and removed.
class FOOTPRINT, a footprint
int GetRoundRectCornerRadius() const
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
const wxSize & GetDelta() const
SHAPE corresponds to the "(shape ..)" element in the specctra dsn spec.
LAYER_T GetLayerType(PCB_LAYER_ID aLayer) const
Return the type of the copper layer given by aLayer.
const wxPoint & GetPos0() const
Handle the data for a net.
PADSTACK * LookupVia(PADSTACK *aVia)
Function LookupVia will add the via only if one exactly like it does not already exist in the padstac...
COMPONENT implements the <component_descriptor> in the specctra dsn spec.
std::vector< PCB_LAYER_ID > m_pcbLayer2kicad
maps PCB layer number to BOARD layer numbers
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.
WIRE corresponds to <wire_shape_descriptor> in the specctra dsn spec.
double GetChamferRectRatio() const
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.
void MergePrimitivesAsPolygon(SHAPE_POLY_SET *aMergedPolygon, PCB_LAYER_ID aLayer) const
Merge all basic shapes to a SHAPE_POLY_SET.
void AppendVia(PADSTACK *aVia)
Function AppendVia adds aVia to the internal via container.
Information pertinent to a Pcbnew printed circuit board.
double GetOrientationDegrees() const
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
static double mapY(int y)
Base class for iterating over all vertices in a given SHAPE_POLY_SET.
std::string Format(bool aCompactForm=false)
int GetCopperLayerCount() const
static double mapX(int x)
Handle the component boundary box.
NETCLASS * GetDefault() const
const wxPoint & GetEnd0() const
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...
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
void SetBOUNDARY(BOUNDARY *aBoundary)
const wxPoint & GetEnd() const
void AppendVia(const char *aViaName)
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
int GetChamferPositions() const
NETCLASSPTR GetDefault() const
class VIA, a via (like a track segment on a copper layer)
WIRE_VIA corresponds to <wire_via_descriptor> in the specctra dsn spec.
PCB_SHAPE_TYPE_T GetShape() const
void SetVertex(const POINT &aVertex)
Collect all BOARD_ITEM objects of a given set of KICAD_T type(s).
PADSTACKSET m_padstackset
KEEPOUT is used for <keepout_descriptor> and <plane_descriptor>.
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
void SetPadstackId(const char *aPadstackId)
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
#define THROW_IO_ERROR(msg)
int GetArcToSegmentCount(int aRadius, int aErrorMax, double aArcAngleDegree)
void SetDiameter(double aDiameter)
WIRING corresponds to <wiring_descriptor> in the specctra dsn spec.
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.
void FlipFOOTPRINTs(BOARD *aBoard)
Function FlipFOOTPRINTs flips the footprints which are on the back side of the board to the front.
bool ExportSpecctraFile(const wxString &aFullFilename)
Export the current BOARD to a specctra dsn file.
STRINGS rules
rules are saved in std::string form.
void BuildConvexHull(std::vector< wxPoint > &aResult, const std::vector< wxPoint > &aPoly)
Calculate the convex hull of a list of points in counter-clockwise order.