62 constexpr int OPENING_MAX_ERROR = 1000;
66 int lengthOf( int64_t aLength )
70 THROW_IO_ERROR( wxString::Format(
_(
"Easy-PC length %lld is outside KiCad's range" ),
71 static_cast<long long>( aLength ) ) );
74 return static_cast<int>( aLength * IU_PER_UNIT );
84 if(
name.Contains( wxS(
"PASTE" ) ) )
87 if(
name.Contains( wxS(
"SILK" ) ) )
90 if(
name.Contains( wxS(
"RESIST" ) ) ||
name.Contains( wxS(
"SOLDER MASK" ) ) )
100 double hx = ( aEnd.
X - aStart.
X ) * 0.5;
101 double hy = ( aEnd.
Y - aStart.
Y ) * 0.5;
102 double cx = aStart.
X + hx;
103 double cy = aStart.
Y + hy;
104 double t = std::tan( ( aArcAngle *
M_PI / 180000.0 ) * ( aAnticlockwise ? 1 : -1 ) * 0.5 );
112 auto closeTo = []( int32_t aA,
double aB )
114 return std::abs( aA -
static_cast<int32_t
>( aB < 0.0 ? aB - 0.5 : aB + 0.5 ) ) < 3;
117 if( closeTo( aStart.
X, cx ) && closeTo( aEnd.
Y, cy ) )
120 if( closeTo( aEnd.
X, cx ) && closeTo( aStart.
Y, cy ) )
130 double a0 = std::atan2( aStart.
Y - aCentre.
y, aStart.
X - aCentre.
x );
131 double sweep = aArcAngle / 1000.0 *
M_PI / 180.0 * ( aAnticlockwise ? 1.0 : -1.0 );
132 double r = std::hypot( aStart.
X - aCentre.
x, aStart.
Y - aCentre.
y );
133 double a = a0 + sweep * aFraction;
134 return VECTOR2D( aCentre.
x + r * std::cos( a ), aCentre.
y + r * std::sin( a ) );
142 int32_t ArcAngle = 0;
143 bool Anticlockwise =
true;
150 std::vector<const SOURCE_SEGMENT*> verts;
155 verts.push_back( seg );
158 std::vector<SPAN> spans;
159 size_t n = verts.size();
161 for(
size_t i = 0; n > 0 && i < ( aShape.
IsClosed() ? n : n - 1 ); ++i )
175 std::vector<SPAN> spans = spansOf( aShape );
177 for(
size_t i = 0; i < spans.size(); ++i )
179 ARC_FORM form =
ArcForm( spans[i].Start, spans[i].End, spans[i].ArcAngle, spans[i].Anticlockwise, aFrame );
187 for(
size_t k = i == 0 ? 0 : 1; k < form.Points.size(); ++k )
188 chain.Append( form.Points[k] );
199 double radius = ( aSize + 1 ) / 2;
200 double h = std::max(
radius / 2,
double( ( aLength + 1 ) / 2 ) );
203 auto pt = [&](
double aX,
double aY )
213 chain.SetClosed(
true );
227 VECTOR2I sized( lengthOf( aSize ), lengthOf( aLength ) );
232 aPad.
SetShape( aLayer, KI_PAD_SHAPE::CIRCLE );
237 aPad.
SetShape( aLayer, KI_PAD_SHAPE::RECTANGLE );
242 aPad.
SetShape( aLayer, KI_PAD_SHAPE::RECTANGLE );
247 aPad.
SetShape( aLayer, KI_PAD_SHAPE::OVAL );
252 aPad.
SetShape( aLayer, KI_PAD_SHAPE::ROUNDRECT );
255 / std::min( aSize, aLength ) );
260 aPad.
SetShape( aLayer, KI_PAD_SHAPE::CHAMFERED_RECT );
262 aPad.
SetChamferRectRatio( aLayer, std::round( aSize / ( 2.0 + std::sqrt( 2.0 ) ) ) / aSize );
268 int anchor = std::max( 1, lengthOf( std::min( aSize, aLength ) ) / 4 );
270 aPad.
SetShape( aLayer, KI_PAD_SHAPE::CUSTOM );
279 THROW_IO_ERROR( wxString::Format(
_(
"Unsupported Easy-PC pad shape %d." ),
static_cast<int>( aShape ) ) );
298 int32_t holeX = aStyle.
Drill;
302 if( holeX > out.Size && holeY > out.Length )
311 const LAYER_MAPPER& aLayers )
313 std::vector<const SOURCE_PAD_STYLE_EXCEPTION*> exceptions =
321 auto it = std::find_if( exceptions.begin(), exceptions.end(),
324 return aEx->Layer == native;
327 if( !native || it == exceptions.end() )
330 LAYER_OUTLINE outline = exceptionOutline( aStyle, **it );
331 bool present = ( ( int64_t( outline.Size ) + 1 ) >> 1 ) >= 1;
337 layers.
reset( layer );
342 setPadShape( aPad, layer, outline.Shape, outline.Size, outline.Length, outline.Dimension3 );
347 layers.
reset( layer );
349 if( !present || !aParent )
354 setPadShape( opening,
PADSTACK::ALL_LAYERS, outline.Shape, aLayers.GrowByLayer( native, outline.Size ),
355 aLayers.GrowByLayer( native, outline.Length ), outline.Dimension3 );
365 aParent->
Add( shape );
378 for(
SHAPE* shape : shapes->Shapes() )
387 box.
Merge( shape->BBox() );
398 const wxString
pad = wxString::Format( wxS(
"%d" ), aPadNumber );
399 std::set<wxString> used;
406 if(
pin->PcbSymbolPin ==
pad )
407 return pin->PinNumber;
420 for( int32_t number : map->PcbSymbolPins )
425 if( number == aPadNumber )
428 used.insert( wxString::Format( wxS(
"%d" ), number ) );
433 wxString number =
pad;
435 for(
int n = 1; used.count( number ); ++n )
436 number = wxString::Format( wxS(
"%d" ), n );
444 const LAYER_MAPPER& aLayers )
468 wxString msg =
_(
"Easy-PC coordinate (%.0f, %.0f) is outside KiCad's range" );
478 return lengthOf( aLength );
531 std::vector<INPUT_LAYER_DESC> descs;
535 auto it =
m_map.find( layer );
537 if( it ==
m_map.end() )
541 desc.
Name = layer->Name;
545 descs.push_back( desc );
554 for(
auto& [layer,
id] :
m_map )
556 if(
auto it = aMapping.find( layer->Name ); it != aMapping.end() )
577 THROW_IO_ERROR( wxString::Format(
_(
"Unsupported Easy-PC pad on layer span '%s'." ), ref->
Name ) );
603 if( enabled && ( all || ref->
Side == layer->Side ) )
615 if(
Map( layer ) == aLayer )
633 grow = grow * aSize / 100;
636 return static_cast<int32_t
>( std::clamp<int64_t>( aSize + grow * 2, 0, std::numeric_limits<int32_t>::max() ) );
641 const FRAME& aFrame )
647 form.Points = { form.Start, form.End };
651 VECTOR2D c = ArcCentre( aStart, aEnd, aArcAngle, aAnticlockwise );
652 double r = std::hypot( aStart.
X - c.
x, aStart.
Y - c.
y ) * IU_PER_UNIT;
658 form.Mid = aFrame.
ToKiCad( arcPoint( aStart, c, aArcAngle, aAnticlockwise, 0.5 ) );
663 double sweep =
std::abs( aArcAngle / 1000.0 *
M_PI / 180.0 );
666 if( r * ( 1.0 - std::cos( sweep / 2.0 ) ) >= 1.0 )
668 double step = 2.0 * std::acos( std::max( 0.0, 1.0 -
ARC_HIGH_DEF / r ) );
669 count = std::max( 1,
static_cast<int>( std::ceil( sweep / std::max( step, 1e-12 ) ) ) );
672 form.Points.push_back( form.Start );
674 for(
int i = 1; i < count; ++i )
676 VECTOR2D p = arcPoint( aStart, c, aArcAngle, aAnticlockwise,
double( i ) / count );
677 form.Points.push_back( aFrame.
ToKiCad( p ) );
680 form.Points.push_back( form.End );
688 poly.
AddOutline( shapeToChain( aShape, aFrame ) );
693 poly.
AddHole( shapeToChain( *cutout, aFrame ) );
717 int width = style ? lengthOf( style->
Width ) : 0;
719 std::vector<const SOURCE_SHAPE*> contours{ shape };
722 contours.push_back(
dynamic_cast<const SOURCE_SHAPE*
>( obj ) );
726 for(
const SPAN& span : contour&& width > 0 ? spansOf( *contour ) : std::vector<SPAN>() )
728 ARC_FORM f =
ArcForm( span.Start, span.End, span.ArcAngle, span.Anticlockwise, aFrame );
734 for(
size_t i = 1; i < f.
Points.size(); ++i )
747 std::vector<PCB_SHAPE*> out;
757 std::vector<SPAN> spans = spansOf( *shape );
779 if( shape->
IsClosed() && spans.size() == 2 && spans[0].ArcAngle == 180000 && spans[1].ArcAngle == 180000
780 && spans[0].Anticlockwise == spans[1].Anticlockwise )
784 circle->SetCenter( ( a + aFrame.
ToKiCad( spans[1].Start ) ) / 2 );
789 for(
const SPAN& span : spans )
791 ARC_FORM form =
ArcForm( span.Start, span.End, span.ArcAngle, span.Anticlockwise, aFrame );
796 for(
size_t i = 1; i < form.
Points.size(); ++i )
811 std::unique_ptr<PAD>
pad = std::make_unique<PAD>( aParent );
812 int32_t size = aStyle.
Size;
816 int32_t drillX = aStyle.
Drill;
819 pad->SetNumber( aPad.
Number ? wxString::Format( wxS(
"%d" ), aPad.
Number ) : wxString() );
824 bool holeOnly = aStyle.
Drill != 0 && drillX > size && drillY > length;
827 bool barePlatedHole = holeOnly && aStyle.
Plated && aStyle.
Size == 0;
829 if( holeOnly && ( !aStyle.
Plated || barePlatedHole ) )
840 if( aStyle.
Drill != 0 )
844 pad->SetDrillSize(
VECTOR2I( lengthOf( drillX ), lengthOf( drillY ) ) );
854 pad->SetLayerSet( layers );
857 applyPadStyleExceptions( aParent, *
pad, aStyle, aLayers );
872 int height = lengthOf( style ? style->
Height : 0 );
875 std::optional<TEXT_METRICS> metrics;
878 metrics.emplace( *style );
880 bool measurable = metrics && metrics->CanMeasure();
882 text.Replace( wxS(
"\r" ), wxEmptyString );
888 int glyph =
static_cast<int>( int64_t( height ) * 3 / 4 );
889 int glyphWidth = glyph;
902 for(
const wxString& line : wxSplit(
text,
'\n',
'\0' ) )
905 int32_t width = bytes.empty() ? 0 : metrics->RunWidth( bytes, 0, bytes.size() );
922 glyphWidth =
KiROUND(
static_cast<double>( glyph ) * lengthOf( widest ) / advance );
945 wxString firstLine =
text.BeforeFirst(
'\n' );
947 if(
text.Contains( wxS(
"\n" ) ) && style )
956 int baseline = strokeBox( probe ).GetBottom();
959 BOX2I ink = strokeBox( probe );
967 int32_t width = metrics->RunWidth( bytes, 0, bytes.size() );
971 cellLeft = -lengthOf( width );
973 cellLeft = -lengthOf( width / 2 );
991 VECTOR2I shift( aPosition.
Mirrored ? -dx : dx,
static_cast<int>( -int64_t( height ) * 3 / 16 ) - baseline );
1005 std::unique_ptr<PCB_TEXT>
text = std::make_unique<PCB_TEXT>(
dynamic_cast<BOARD_ITEM*
>( &aContainer ) );
1006 text->SetText( aText );
1012 return text.release();
1018 std::map<const SOURCE_FREE_PAD*, PAD*>* aPadMap )
1020 std::unique_ptr<FOOTPRINT> footprint = std::make_unique<FOOTPRINT>(
nullptr );
1023 footprint->SetFPID( aId );
1024 footprint->Reference().SetText( wxS(
"REF**" ) );
1025 footprint->Value().SetText( aComponent ? aComponent->
Package : aSymbol.
Name );
1040 wxString::Format(
_(
"Easy-PC symbol '%s' pad %d has no pad style" ), aSymbol.
Name,
pad->Number ) );
1043 std::unique_ptr<PAD> kpad =
CreatePad( footprint.get(), *
pad, *style, frame, aLayers );
1045 aComponent ? PcbPadNumber( *aComponent,
pad->Number ) : wxString::Format( wxS(
"%d" ),
pad->Number );
1047 kpad->SetNumber( number );
1052 AddText( *footprint, *pos, number, frame, aLayers );
1056 ( *aPadMap )[
pad] = kpad.get();
1066 if( !pos->Displayed )
1076 placeField( *footprint, footprint->Reference(), *refPos, frame, aLayers );
1079 placeField( *footprint, footprint->Value(), *valuePos, frame, aLayers );
1081 footprint->Value().SetVisible(
false );
constexpr int ARC_HIGH_DEF
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
BASE_SET & reset(size_t pos)
BASE_SET & set(size_t pos)
Abstract interface for BOARD_ITEMs capable of storing other items inside.
virtual void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false)=0
Adds an item to the container.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
constexpr Vec Centre() const
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
constexpr coord_type GetLeft() const
constexpr coord_type GetRight() const
static std::string Encode(const wxString &aText)
The CP1252 bytes of aText; characters CP1252 lacks become 0.
Layer mapping for one layer table, copper in stack order and other layers by their type.
LSET PadLayers(const EASYPC::OBJECT *aLayer, bool aComponentPad) const
The copper aLayer (a layer or a set) covers, with the mask and paste layers whose type plots such pad...
std::map< const EASYPC::SOURCE_LAYER *, PCB_LAYER_ID > m_map
int32_t GrowByLayer(const EASYPC::SOURCE_LAYER *aLayer, int32_t aSize) const
aSize grown on each side by aLayer's type oversize, fixed or a percentage of the size
std::vector< INPUT_LAYER_DESC > Describe() const
std::vector< const EASYPC::SOURCE_LAYER * > m_layers
PCB_LAYER_ID Map(const EASYPC::OBJECT *aLayer) const
UNDEFINED_LAYER when the native layer has no KiCad layer.
const EASYPC::SOURCE_LAYER * Native(PCB_LAYER_ID aLayer) const
void ApplyUserMapping(const std::map< wxString, PCB_LAYER_ID > &aMapping)
LAYER_MAPPER(const std::vector< const EASYPC::SOURCE_LAYER * > &aLayers)
virtual void SetFilled(bool aFlag)
virtual const wxString & GetText() const
Return the string associated with the text object.
virtual void SetTextPos(const VECTOR2I &aPoint)
void SetAttributes(const EDA_TEXT &aSrc, bool aSetPosition=true)
Set the text attributes from another instance.
void SetMirrored(bool isMirrored)
void SetVertJustify(GR_TEXT_V_ALIGN_T aType)
GR_TEXT_H_ALIGN_T GetHorizJustify() const
virtual void SetVisible(bool aVisible)
void SetLineSpacing(double aLineSpacing)
std::shared_ptr< SHAPE_COMPOUND > GetEffectiveTextShape(bool aTriangulate=true, const BOX2I &aBBox=BOX2I(), const EDA_ANGLE &aAngle=ANGLE_0) const
Build a list of segments (SHAPE_SEGMENT) to describe a text shape.
void SetKeepUpright(bool aKeepUpright)
int GetInterline(const RENDER_SETTINGS *aSettings) const
Return the distance between two lines of text.
virtual void SetText(const wxString &aText)
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
static FONT * GetFont(const wxString &aFontName=wxEmptyString, bool aBold=false, bool aItalic=false, const std::vector< wxString > *aEmbeddedFiles=nullptr, bool aForDrawingSheet=false)
VECTOR2I StringBoundaryLimits(const wxString &aText, const VECTOR2I &aSize, int aThickness, bool aBold, bool aItalic, const METRICS &aFontMetrics) const
Compute the boundary limits of aText (the bounding box of all shapes).
static const METRICS & Default()
A logical library item identifier and consists of various portions much like a URI.
LSET is a set of PCB_LAYER_IDs.
static const LSET & AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
static LSET AllCuMask(int aCuLayerCount)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
@ NORMAL
Shape is the same on all layers.
@ CUSTOM
Shapes can be defined on arbitrary layers.
static constexpr PCB_LAYER_ID ALL_LAYERS
! The layer identifier to use for the single defintion on normal padstacks
void SetAnchorPadShape(PCB_LAYER_ID aLayer, PAD_SHAPE aShape)
Set the shape of the anchor pad for custom shaped pads.
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
void AddPrimitivePoly(PCB_LAYER_ID aLayer, const SHAPE_POLY_SET &aPoly, int aThickness, bool aFilled)
Has meaning only for custom shape pads.
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aMaxError, ERROR_LOC aErrorLoc=ERROR_INSIDE, bool aIgnoreLineWidth=false) const override
Convert the pad shape to a closed polygon.
void SetShape(PCB_LAYER_ID aLayer, PAD_SHAPE aShape)
Set the new shape of this pad.
void SetChamferRectRatio(PCB_LAYER_ID aLayer, double aChamferScale)
Has meaning only for chamfered rectangular pads.
const PADSTACK & Padstack() const
void SetSize(PCB_LAYER_ID aLayer, const VECTOR2I &aSize)
void SetChamferPositions(PCB_LAYER_ID aLayer, int aPositions)
Has meaning only for chamfered rectangular pads.
void SetLayerSet(const LSET &aLayers) override
void SetRoundRectRadiusRatio(PCB_LAYER_ID aLayer, double aRadiusScale)
Has meaning only for rounded rectangle pads.
void SetEnd(const VECTOR2I &aEnd) override
void SetPolyShape(const SHAPE_POLY_SET &aShape) override
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
void SetStart(const VECTOR2I &aStart) override
void SetStroke(const STROKE_PARAMS &aStroke) override
void SetTextThickness(int aWidth) override
The TextThickness is that set by the user.
void SetTextSize(VECTOR2I aNewSize, bool aEnforceMinTextSize=true) override
void SetPosition(const VECTOR2I &aPos) override
int GetTextThickness() const override
void SetTextAngle(const EDA_ANGLE &aAngle) override
VECTOR2I GetTextSize() const override
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Represent a set of closed polygons.
void ClearArcs()
Removes all arc references from all the outlines and holes in the polyset.
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new outline to the set and returns its index.
void Simplify()
Simplify the polyset (merges overlapping polys, eliminates degeneracy/self-intersections)
int AddHole(const SHAPE_LINE_CHAIN &aHole, int aOutline=-1)
Adds a new hole to the given outline (default: last) and returns its index.
void Fracture(bool aSimplify=true)
Convert a set of polygons with holes to a single outline with "slits"/"fractures" connecting the oute...
An abstract shape on 2D plane.
Simple container to manage line stroke parameters.
void TransformArcToPolygon(SHAPE_POLY_SET &aBuffer, const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd, int aWidth, int aError, ERROR_LOC aErrorLoc)
Convert arc to multiple straight segments.
void TransformOvalToPolygon(SHAPE_POLY_SET &aBuffer, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, int aError, ERROR_LOC aErrorLoc, int aMinSegCount=0)
Convert a oblong shape to a polygon, using multiple segments.
Placed instances and connectivity: component, symbol and pad instances, nets, nodes,...
Symbols, components and gates, embedded in designs or the single object of a library item stream.
Easy-PC / DesignSpark items to KiCad board items, shared by the board builder and the ....
Easy-PC's text measurement, so text lands where Easy-PC draws it.
#define THROW_IO_ERROR(msg)
macro which captures the "call site" values of FILE_, __FUNCTION & LINE
bool IsCopperLayer(int aLayerId)
Test whether a layer is a copper layer.
PCB_LAYER_ID
A quick note on layer IDs:
bool ApplyTextPosition(PCB_TEXT &aText, const SOURCE_TEXT_POSITION &aPosition, const FRAME &aFrame, const LAYER_MAPPER &aLayers)
Place and size a text from its stored position and style; false when its layer has no KiCad layer.
std::unique_ptr< FOOTPRINT > ConvertFootprint(const SOURCE_SYMBOL &aSymbol, const LAYER_MAPPER &aLayers, const LIB_ID &aId, const SOURCE_PCB_COMPONENT *aComponent, std::map< const SOURCE_FREE_PAD *, PAD * > *aPadMap)
A footprint in symbol coordinates.
SHAPE_POLY_SET ShapeToPolySet(const SOURCE_DESIGN_SHAPE &aShape, const FRAME &aFrame)
A closed shape and its cutouts as an outline with holes.
std::unique_ptr< PAD > CreatePad(FOOTPRINT *aParent, const SOURCE_FREE_PAD &aPad, const SOURCE_PAD_STYLE &aStyle, const FRAME &aFrame, const LAYER_MAPPER &aLayers)
A pad with its style's per-layer exceptions; a mask or paste exception becomes a separate opening on ...
PCB_TEXT * AddText(BOARD_ITEM_CONTAINER &aContainer, const SOURCE_TEXT_POSITION &aPosition, const wxString &aText, const FRAME &aFrame, const LAYER_MAPPER &aLayers)
ARC_FORM ArcForm(const POINT32 &aStart, const POINT32 &aEnd, int32_t aArcAngle, bool aAnticlockwise, const FRAME &aFrame)
std::vector< PCB_SHAPE * > AddShapeItem(BOARD_ITEM_CONTAINER &aContainer, const SOURCE_SHAPE_ITEM &aItem, const FRAME &aFrame, const LAYER_MAPPER &aLayers, PCB_LAYER_ID aLayer)
Add a shape item as one filled polygon, a circle, or one shape per span; aLayer overrides the item's ...
SHAPE_POLY_SET ShapeItemArea(const SOURCE_SHAPE_ITEM &aItem, const FRAME &aFrame, int aMaxError)
The copper a shape item plots: its filled region and every span stroked at the line width with round ...
std::vector< wxString > ExpandPinNumberList(const wxString &aList, wxString *aDisplay)
Expand a gate pin's component pin list by Easy-PC's pin list syntax: items separated by ,...
constexpr double COORD_LIMIT
Half of KiCad's integer range, so shape code rotating or adding coordinates cannot overflow.
@ LAYER_USAGE_NON_ELECTRICAL
@ LAYER_USAGE_SET
pseudo layer [All], [Top] or [Bottom]
std::vector< T * > TypedItems(const OBJECT *aList)
The items of ListItems that are a T, in order.
constexpr int32_t NormalizeAngle(int32_t aAngle)
Wrap an angle into [0, ANGLE_FULL_TURN)
wxString ToKiCadMarkup(const wxString &aText)
A displayed string in KiCad's markup.
constexpr double AngleToDegrees(int32_t aAngle)
PAD_SHAPE
Pad style shape, also the drill and exception shape.
constexpr int64_t NM_PER_DSU
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
@ SMD
Smd pad, appears on the solder paste layer (default)
@ PTH
Plated through hole pad.
Root of every deserialized object.
A point read as two int32 values.
std::vector< OBJECT * > Cutouts
A pad of a symbol definition.
One gate's terminals to footprint pads.
Layer type names determine silk, mask and paste roles.
bool SurfacePadInstancesEnabled
bool AllLayerPadInstancesEnabled
LAYER_OVERSIZE_TYPE OversizeType
SOURCE_LAYER_TYPE * Type
null for the layer sets
wxString TypeName
below v3000 the type is stored by name
OBJECT * Exceptions
pad style exception list
int32_t DrillCornerRadius
int32_t Length
Y extent for shapes that have one.
The package half of a component.
OBJECT * GateMaps
one per schematic gate in order
int32_t ArcAngle
swept angle, 0 for a straight span
OBJECT * Shape
design shape
bool IsClosed() const
The last vertex links back to the first (formats 1 and 2) or the closed byte is set (format 3)
std::vector< OBJECT * > Segments
the vertex list as read
Footprints and schematic symbols alike.
OBJECT * Shapes
free copper list
OBJECT * Texts
free text list
OBJECT * Pads
free pad list
int32_t Height
the accessor is GetWidth but it is the text height
int32_t InterlineHeightPercent
Native to KiCad coordinates: scale by 100 nm, flip Y and move the native origin to the KiCad offset.
static EDA_ANGLE Angle(int32_t aMilliDegrees)
VECTOR2I ToKiCad(int32_t aX, int32_t aY) const
int Length(int64_t aLength) const
const SHAPE_LINE_CHAIN chain
SHAPE_CIRCLE circle(c.m_circle_center, c.m_circle_radius)
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D