53#include <Message_PrinterOStream.hxx>
54#include <Standard_Failure.hxx>
56#include <Standard_Version.hxx>
60#include <wx/tokenzr.h>
63#define OCC_VERSION_MIN 0x070500
65#if OCC_VERSION_HEX < OCC_VERSION_MIN
66#include <Message_Messenger.hxx>
78#if OCC_VERSION_HEX < OCC_VERSION_MIN
79 virtual void Send(
const TCollection_ExtendedString& theString,
80 const Message_Gravity theGravity,
81 const bool theToPutEol )
const override
83 Send( TCollection_AsciiString( theString ), theGravity, theToPutEol );
86 virtual void Send(
const TCollection_AsciiString& theString,
87 const Message_Gravity theGravity,
88 const bool theToPutEol )
const override
90 virtual void send(
const TCollection_AsciiString& theString,
91 const Message_Gravity theGravity )
const override
94 wxString msg( theString.ToCString() );
96#if OCC_VERSION_HEX < OCC_VERSION_MIN
149 m_resolver = std::make_unique<FILENAME_RESOLVER>();
169 if( aLayer == aStartLayer || aLayer == aEndLayer )
188 int startIdx = layerToIndex( aStartLayer );
189 int endIdx = layerToIndex( aEndLayer );
190 int layerIdx = layerToIndex( aLayer );
195 int minIdx = std::min( startIdx, endIdx );
196 int maxIdx = std::max( startIdx, endIdx );
198 return ( layerIdx >= minIdx && layerIdx <= maxIdx );
204 if(
m_params.m_NetFilter.IsEmpty() )
207 wxArrayString parts = wxSplit(
m_params.m_NetFilter,
',' );
209 for( wxString token : parts )
211 token.Trim(
true ).Trim(
false );
213 if( token.IsEmpty() )
216 if( netname.Matches( token ) )
227 bool hasdata =
false;
228 std::vector<PAD*> padsMatchingNetFilter;
234 std::shared_ptr<SHAPE_SEGMENT> holeShape =
pad->GetEffectiveHoleShape();
237 holeShape->TransformToPolygon( holePoly,
pad->GetMaxError(),
ERROR_INSIDE );
244 if(
pad->IsOnLayer( pcblayer ) )
252 if(
m_pcbModel->AddHole( *holeShape, platingThickness,
F_Cu,
B_Cu,
false, aOrigin,
true,
true ) )
259 holeShape->TransformToPolygon( silkHole,
pad->GetMaxError(),
ERROR_INSIDE );
274 if( secondaryDrill.
size.
x > 0 )
277 secondaryDrill.
size.
x );
279 secondaryDrill.
end, aOrigin );
305 if( tertiaryDrill.
size.
x > 0 )
308 tertiaryDrill.
size.
x );
310 tertiaryDrill.
end, aOrigin );
339 wxLogTrace(
traceKiCad2Step, wxT(
"PAD post-machining check: frontPM.mode.has_value=%d frontPM.size=%d frontPM.depth=%d frontPM.angle=%d" ),
341 wxLogTrace(
traceKiCad2Step, wxT(
"PAD post-machining check: backPM.mode.has_value=%d backPM.size=%d backPM.depth=%d backPM.angle=%d" ),
345 bool frontPMValid = frontPM.
mode.has_value() && frontPM.
size > 0 &&
351 wxLogTrace(
traceKiCad2Step, wxT(
"PAD front post-machining: mode=%d (COUNTERBORE=2, COUNTERSINK=3)" ),
352 static_cast<int>( *frontPM.
mode ) );
359 frontPM.
depth,
true, aOrigin );
364 frontPM.
depth, frontPM.
angle,
true, aOrigin );
370 for(
const auto& [layer, diameter] : knockouts )
387 bool backPMValid = backPM.
mode.has_value() && backPM.
size > 0 &&
393 wxLogTrace(
traceKiCad2Step, wxT(
"PAD back post-machining: mode=%d (COUNTERBORE=2, COUNTERSINK=3)" ),
394 static_cast<int>( *backPM.
mode ) );
401 backPM.
depth,
false, aOrigin );
412 for(
const auto& [layer, diameter] : knockouts )
434 if(
m_pcbModel->AddPadShape(
pad, aOrigin,
false, castellated ? aClipPolygon :
nullptr) )
446 pad->TransformShapeToPolygon( poly, cuLayer,
pad->GetSolderMaskExpansion( cuLayer ),
454 padsMatchingNetFilter.push_back(
pad );
476 std::map<const SHAPE_POLY_SET::POLYGON*, PAD*> polyPadMap;
481 for(
PAD*
pad : padsMatchingNetFilter )
483 if( !
pad->IsOnLayer( pcblayer ) )
486 std::shared_ptr<SHAPE_POLY_SET> padPoly =
pad->GetEffectivePolygon( pcblayer );
489 if( padPoly->Collide( &gfxPoly ) )
491 polyPadMap[&poly] =
pad;
503 auto it = polyPadMap.find( &poly );
505 if( it == polyPadMap.end() )
526 wxString footprintBasePath = wxEmptyString;
529 double posY = (aFootprint->
GetPosition().y) - aOrigin.
y;
533 std::optional<LIBRARY_TABLE_ROW*> fpRow =
545 bool componentFilter = !
m_params.m_ComponentFilter.IsEmpty();
546 std::vector<wxString> componentFilterPatterns;
548 if( componentFilter )
550 wxStringTokenizer tokenizer(
m_params.m_ComponentFilter,
", \t\r\n", wxTOKEN_STRTOK );
552 while( tokenizer.HasMoreTokens() )
553 componentFilterPatterns.push_back( tokenizer.GetNextToken() );
557 for(
const wxString& pattern : componentFilterPatterns )
574 if( !fp_model.m_Show || fp_model.m_Filename.empty() )
577 std::vector<wxString> searchedPaths;
578 std::vector<const EMBEDDED_FILES*> embeddedFilesStack;
580 embeddedFilesStack.push_back(
m_board->GetEmbeddedFiles() );
582 wxString mainPath =
m_resolver->ResolvePath( fp_model.m_Filename, footprintBasePath,
583 embeddedFilesStack );
585 if( mainPath.empty() || !wxFileName::FileExists( mainPath ) )
588 if( mainPath.empty() )
589 mainPath = fp_model.m_Filename;
591 m_reporter->Report( wxString::Format(
_(
"Could not add 3D model for %s.\n"
592 "File not found: %s\n" ),
599 fp_model.m_Filename.AfterLast(
'/' ).AfterLast(
'\\' ).BeforeLast(
'.' );
601 std::vector<wxString> altFilenames;
608 const auto& map = filesPtr->EmbeddedFileMap();
610 for(
auto& [fname, file] : map )
612 if( fname.BeforeLast(
'.' ) == baseName )
614 wxFileName temp_file = filesPtr->GetTemporaryFileName( fname );
616 if( !temp_file.IsOk() )
619 wxString altPath = temp_file.GetFullPath();
621 if( mainPath == altPath )
624 altFilenames.emplace_back( altPath );
635 VECTOR3D modelRot = fp_model.m_Rotation;
640 baseName, mainPath, altFilenames, aFootprint->
GetReference(), bottomSide,
642 modelRot, fp_model.m_Scale,
m_params.m_SubstModels ) )
647 catch(
const Standard_Failure& e )
649 m_reporter->Report( wxString::Format(
_(
"Could not add 3D model for %s.\n"
650 "OpenCASCADE error: %s\n" ),
652 e.GetMessageString() ),
672 double height = standoff + bodyThickness;
683 if(
m_pcbModel->AddExtrudedBody( outline, bottomSide, standoff, height, aOrigin, colorKey,
689 catch(
const Standard_Failure& e )
691 m_reporter->Report( wxString::Format(
_(
"Could not add extruded body for %s.\n"
692 "OpenCASCADE error: %s\n" ),
702 m_pcbModel->AddExtrudedPins( aFootprint, body, bottomSide, standoff, aOrigin );
704 catch(
const Standard_Failure& e )
706 m_reporter->Report( wxString::Format(
_(
"Could not add extruded pins for %s.\n"
707 "OpenCASCADE error: %s\n" ),
750 std::shared_ptr<SHAPE_SEGMENT> holeShape =
via->GetEffectiveHoleShape();
752 holeShape->TransformToPolygon( holePoly,
via->GetMaxError(),
ERROR_INSIDE );
760 via->LayerPair( &top_layer, &bot_layer );
766 const std::shared_ptr<SHAPE>& shape =
via->GetEffectiveShape( pcblayer );
774 m_pcbModel->AddBarrel( *holeShape, top_layer, bot_layer,
true, aOrigin,
via->GetNetname() );
782 holeShape->TransformToPolygon( silkHole,
via->GetMaxError(),
ERROR_INSIDE );
811 if( secondaryDrill.
size.
x > 0 )
814 secondaryDrill.
size.
x );
816 secondaryDrill.
end, aOrigin );
842 if( tertiaryDrill.
size.
x > 0 )
845 tertiaryDrill.
size.
x );
847 tertiaryDrill.
end, aOrigin );
876 wxLogTrace(
traceKiCad2Step, wxT(
"VIA post-machining check: frontPM.mode.has_value=%d frontPM.size=%d frontPM.depth=%d frontPM.angle=%d" ),
878 wxLogTrace(
traceKiCad2Step, wxT(
"VIA post-machining check: backPM.mode.has_value=%d backPM.size=%d backPM.depth=%d backPM.angle=%d" ),
882 bool frontPMValid = frontPM.
mode.has_value() && frontPM.
size > 0 &&
888 wxLogTrace(
traceKiCad2Step, wxT(
"VIA front post-machining: mode=%d (COUNTERBORE=2, COUNTERSINK=3)" ),
889 static_cast<int>( *frontPM.
mode ) );
896 frontPM.
depth,
true, aOrigin );
901 frontPM.
depth, frontPM.
angle,
true, aOrigin );
907 for(
const auto& [layer, diameter] : knockouts )
924 bool backPMValid = backPM.
mode.has_value() && backPM.
size > 0 &&
930 wxLogTrace(
traceKiCad2Step, wxT(
"VIA back post-machining: mode=%d (COUNTERBORE=2, COUNTERSINK=3)" ),
931 static_cast<int>( *backPM.
mode ) );
938 backPM.
depth,
false, aOrigin );
949 for(
const auto& [layer, diameter] : knockouts )
987 LSET layers = zone->GetLayerSet();
997 bool isMaskLayer = ( layer ==
F_Mask || layer ==
B_Mask );
1000 if( aSolderMaskOnly && !isMaskLayer )
1004 if( !aSolderMaskOnly && isMaskLayer && !
m_params.m_ExportZones )
1008 zone->TransformSolidAreasShapesToPolygon( layer, fill_shape );
1013 m_poly_shapes[layer][zone->GetNetname()].Append( fill_shape );
1033 switch( aItem->
Type() )
1045 bool endingsAlreadyAdded =
false;
1053 endingsAlreadyAdded =
true;
1070 for(
SHAPE* shape : shapes )
1075 SHAPE_SEGMENT seg( a, b, graphic->GetWidth() );
1076 seg.TransformToPolygon( m_poly_shapes[pcblayer][graphic->GetNetname()],
1077 maxError, ERROR_INSIDE );
1081 for(
SHAPE* shape : shapes )
1086 if( !endingsAlreadyAdded
1102 std::vector<VECTOR2I> polygon;
1105 if( !polygon.empty() )
1112 for(
size_t ii = 0; ii + 1 < polygon.size(); ii++ )
1122 for(
size_t ii = 0; ii < polygon.size(); ii++ )
1124 size_t next = ( ii + 1 ) % polygon.size();
1135 for(
const VECTOR2I& pt : polygon )
1144 addEnding( graphic->
GetEndEnding(), endPt, endTangent );
1190 textbox->PCB_SHAPE::TransformShapeToPolygon(
m_poly_shapes[pcblayer][wxEmptyString], pcblayer, 0,
1283 if( !
m_board->GetBoardPolygonOutlines( pcbOutlines,
1288 wxLogWarning(
_(
"Board outline is malformed. Run DRC for a full analysis." ) );
1299 origin =
m_board->GetDesignSettings().GetAuxOrigin();
1300 else if(
m_params.m_UseGridOrigin )
1301 origin =
m_board->GetDesignSettings().GetGridOrigin();
1360 poly.SimplifyOutlines(
pcbIUScale.mmToIU( 0.003 ) );
1368 m_pcbModel->AddPolygonShapes( &mask, pcblayer, origin, wxEmptyString );
1376 poly.SimplifyOutlines(
pcbIUScale.mmToIU( 0.003 ) );
1380 poly.BooleanSubtract( holes );
1383 poly.BooleanIntersection( pcbOutlinesNoArcs );
1385 m_pcbModel->AddPolygonShapes( &poly, pcblayer, origin, netname );
1392 m_reporter->Report( wxString::Format( wxT(
"Board outline: found %d initial points.\n" ),
1412 struct SCOPED_PRINTER
1414 Handle( Message_Printer ) m_handle;
1416 SCOPED_PRINTER(
const Handle( Message_Printer ) & aHandle ) : m_handle( aHandle )
1418 Message::DefaultMessenger()->AddPrinter( m_handle );
1421 ~SCOPED_PRINTER() { Message::DefaultMessenger()->RemovePrinter( m_handle ); }
1424 SCOPED_PRINTER(
const SCOPED_PRINTER& ) =
delete;
1425 SCOPED_PRINTER& operator=(
const SCOPED_PRINTER& ) =
delete;
1428 Message::DefaultMessenger()->RemovePrinters( STANDARD_TYPE( Message_PrinterOStream ) );
1433 if(
m_params.m_OutputFile.IsEmpty() )
1435 wxFileName fn =
m_board->GetFileName();
1436 fn.SetName( fn.GetName() );
1437 fn.SetExt(
m_params.GetDefaultExportExtension() );
1439 m_params.m_OutputFile = fn.GetFullName();
1463 m_reporter->Report( wxString::Format( wxT(
"Build %s data.\n" ),
m_params.GetFormatName() ),
1469 "** Error building STEP board model. Export aborted. **\n" ),
1474 m_reporter->Report( wxString::Format( wxT(
"Writing %s file.\n" ),
m_params.GetFormatName() ),
1477 bool success =
true;
1500 "** Error writing %s file. **\n" ),
1507 m_reporter->Report( wxString::Format( wxT(
"%s file '%s' created.\n" ),
1513 catch(
const std::bad_alloc& )
1515 m_reporter->Report( wxString::Format(
_(
"\n** Out of memory while exporting %s file. **\n"
1516 "The board may have too many objects (e.g., vias, tracks, components) "
1517 "to process with available system memory.\n"
1518 "Try disabling 'Fuse Shapes' option, reducing board complexity, "
1519 "or freeing up system memory.\n" ),
1524 catch(
const Standard_Failure& e )
1526 wxString errorMsg = e.GetMessageString();
1527 m_reporter->Report( wxString::Format(
_(
"\nOpenCASCADE error: %s\n" ), errorMsg ),
1531 if( errorMsg.Contains(
"alloc" ) || errorMsg.Contains(
"memory" ) ||
1532 errorMsg.IsEmpty() )
1534 m_reporter->Report(
_(
"This error may indicate insufficient memory. Consider disabling "
1535 "'Fuse Shapes', reducing the number of vias/components, or freeing "
1536 "system memory.\n" ),
1540 m_reporter->Report( wxString::Format(
_(
"** Error exporting %s file. Export aborted. **\n" ),
1548 m_reporter->Report( wxString::Format(
_(
"\n** Unexpected error while exporting %s file. **\n"
1549 "This may be caused by insufficient system memory, especially "
1550 "when exporting boards with many vias or components with 'Fuse Shapes' enabled.\n"
1551 "Try disabling 'Fuse Shapes', reducing board complexity, "
1552 "or freeing up system memory.\n" ),
1562 "Export time %.3f s\n" ),
void ApplyExtrusionTransform(SHAPE_POLY_SET &aOutline, const EXTRUDED_3D_BODY *aBody, const VECTOR2I &aFpPos)
Apply 2D extrusion transforms (rotation, scale, offset) to an outline.
bool GetExtrusionOutline(const FOOTPRINT *aFootprint, SHAPE_POLY_SET &aOutline, PCB_LAYER_ID aLayerOverride)
Get the extrusion outline polygon for a footprint in board coordinates.
constexpr EDA_IU_SCALE pcbIUScale
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
wxString GetNetname() const
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
virtual void TransformShapeToPolySet(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, KIGFX::RENDER_SETTINGS *aRenderSettings=nullptr) const
Convert the item shape to a polyset.
Information pertinent to a Pcbnew printed circuit board.
const wxString & GetFileName() const
PROJECT * GetProject() const
KICAD_T Type() const
Returns the type of object.
const SHAPE_POLY_SET & GetHatching() const
void TransformWithLineEndingsToPolygon(SHAPE_POLY_SET &aBuffer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const
Convert the shape body shortened for line endings plus line-ending geometry to polygons.
void GetEndingTangents(EDA_ANGLE &aStartTangent, EDA_ANGLE &aEndTangent, int aLineWidth=0) const
Compute outward-facing tangent angles at the start and end of the shape.
std::vector< SHAPE * > MakeEffectiveShapesForStroking(int aLineWidth=-1) const
Make a set of SHAPE objects to hand to STROKE_PARAMS::Stroke().
bool IsHatchedFill() const
bool GetLineEndingEndpoints(VECTOR2I &aStartPoint, VECTOR2I &aEndPoint) const
Return the source endpoints used to place line endings.
LINE_STYLE GetLineStyle() const
const LINE_ENDING & GetStartEnding() const
const LINE_ENDING & GetEndEnding() const
bool buildTrack3DShape(PCB_TRACK *aTrack, const VECTOR2D &aOrigin)
static bool IsViaHoleOpen(const PCB_VIA &aVia, bool aFillAllVias)
bool buildFootprint3DShapes(FOOTPRINT *aFootprint, const VECTOR2D &aOrigin, SHAPE_POLY_SET *aClipPolygon)
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_poly_holes
bool isLayerInBackdrillSpan(PCB_LAYER_ID aLayer, PCB_LAYER_ID aStartLayer, PCB_LAYER_ID aEndLayer) const
Check if a copper layer is within a backdrill layer span (inclusive).
bool netFilterMatches(const wxString &netname) const
EXPORTER_STEP_PARAMS m_params
wxString m_pcbBaseName
the name of the project (board short filename (no path, no ext) used to identify items in step file
std::unique_ptr< FILENAME_RESOLVER > m_resolver
bool buildBoard3DShapes()
std::unique_ptr< STEP_PCB_MODEL > m_pcbModel
std::map< PCB_LAYER_ID, std::map< wxString, SHAPE_POLY_SET > > m_poly_shapes
KIGFX::COLOR4D m_copperColor
EXPORTER_STEP(BOARD *aBoard, const EXPORTER_STEP_PARAMS &aParams, REPORTER *aReporter)
bool buildGraphic3DShape(BOARD_ITEM *aItem, const VECTOR2D &aOrigin)
KIGFX::COLOR4D m_padColor
void buildZones3DShape(VECTOR2D aOrigin, bool aSolderMaskOnly=false)
static KIGFX::COLOR4D GetDefaultColor(EXTRUSION_MATERIAL aMaterial)
static uint32_t PackColorKey(const KIGFX::COLOR4D &aColor)
EXTRUSION_MATERIAL m_material
virtual void Send(const TCollection_AsciiString &theString, const Message_Gravity theGravity, const bool theToPutEol) const override
SEVERITY getSeverity(const Message_Gravity theGravity) const
KICAD_PRINTER(REPORTER *aReporter)
virtual void Send(const TCollection_ExtendedString &theString, const Message_Gravity theGravity, const bool theToPutEol) const override
A color representation with 4 components: red, green, blue, alpha.
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
PCB specific render settings.
void SetGapLengthRatio(double aRatio)
void SetDashLengthRatio(double aRatio)
virtual wxString GetClass() const =0
Return the class name.
std::optional< LIBRARY_TABLE_ROW * > GetRow(const wxString &aNickname, LIBRARY_TABLE_SCOPE aScope=LIBRARY_TABLE_SCOPE::BOTH) const
Like LIBRARY_MANAGER::GetRow but filtered to the LIBRARY_TABLE_TYPE of this adapter.
std::optional< wxString > GetFullURI(LIBRARY_TABLE_TYPE aType, const wxString &aNickname, bool aSubstituted=false)
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Decorative shape (arrowhead, circle, square) at the start or end of a graphic line,...
LINE_ENDING_STYLE GetStyle() const
void GetShapes(const VECTOR2I &aPoint, const EDA_ANGLE &aTangent, int aLineWidth, std::vector< VECTOR2I > &aPolygon) const
Generate ending geometry as polygon vertices at the given point and direction.
int GetStrokeWidth() const
Outline stroke width.
LSET is a set of PCB_LAYER_IDs.
static const LSET & ExternalCuMask()
Return a mask holding the Front and Bottom layers.
static LSET AllCuMask(int aCuLayerCount)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
static const LSET & InternalCuMask()
Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu.
A PADSTACK defines the characteristics of a single or multi-layer pad, in the IPC sense of the word.
POST_MACHINING_PROPS & FrontPostMachining()
DRILL_PROPS & TertiaryDrill()
DRILL_PROPS & SecondaryDrill()
POST_MACHINING_PROPS & BackPostMachining()
A 3D body attached to a footprint (or, later, placed on a board).
const EXTRUDED_3D_BODY * GetExtruded() const
Parameters and options when plotting/printing a board.
double GetDashedLineGapRatio() const
double GetDashedLineDashRatio() const
int GetWidth() const override
int GetSolderMaskExpansion() const
void TransformShapeToPolySet(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, KIGFX::RENDER_SETTINGS *aRenderSettings=nullptr) const override
Convert the item shape to a polyset.
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Convert the shape to a closed polygon.
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
bool IsBorderEnabled() const
Tests whether the border is disabled, as configured by the stroke.
void TransformTextToPolySet(SHAPE_POLY_SET &aBuffer, int aClearance, int aMaxError, ERROR_LOC aErrorLoc) const
Convert the text to a polygonSet describing the actual character strokes (one per segment).
int GetSolderMaskExpansion() const
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Convert the track shape to a closed polygon.
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
CAPPING_MODE GetCappingMode() const
FILLING_MODE GetFillingMode() const
static FOOTPRINT_LIBRARY_ADAPTER * FootprintLibAdapter(PROJECT *aProject)
A pure virtual class used to derive REPORTER objects from.
Represent a set of closed polygons.
void ClearArcs()
Removes all arc references from all the outlines and holes in the polyset.
int FullPointCount() const
Return the number of points in the shape poly set.
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Appends a vertex at the end of the given outline/hole (default: the last outline)
void Simplify()
Simplify the polyset (merges overlapping polys, eliminates degeneracy/self-intersections)
std::vector< SHAPE_LINE_CHAIN > POLYGON
represents a single polygon outline with holes.
void Unfracture()
Convert a single outline slitted ("fractured") polygon into a set ouf outlines with holes.
int NewOutline()
Creates a new empty polygon in the set and returns its index.
void SimplifyOutlines(int aMaxError=0)
Simplifies the lines in the polyset.
void Deflate(int aAmount, CORNER_STRATEGY aCornerStrategy, int aMaxError)
int OutlineCount() const
Return the number of outlines in the set.
void BooleanSubtract(const SHAPE_POLY_SET &b)
Perform boolean polyset difference.
const std::vector< POLYGON > & CPolygons() const
void TransformToPolygon(SHAPE_POLY_SET &aBuffer, int aError, ERROR_LOC aErrorLoc) const override
Fills a SHAPE_POLY_SET with a polygon representation of this shape.
An abstract shape on 2D plane.
Simple container to manage line stroke parameters.
static void Stroke(const SHAPE *aShape, LINE_STYLE aLineStyle, int aWidth, const KIGFX::RENDER_SETTINGS *aRenderSettings, const std::function< void(const VECTOR2I &a, const VECTOR2I &b)> &aStroker)
Handle a list of polygons defining a copper zone.
void TransformCircleToPolygon(SHAPE_LINE_CHAIN &aBuffer, const VECTOR2I &aCenter, int aRadius, int aError, ERROR_LOC aErrorLoc, int aMinSegCount=0)
Convert a circle to a polygon, using multiple straight lines.
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.
@ ROUND_ALL_CORNERS
All angles are rounded.
static const std::string KiCadUriPrefix
const wxChar *const traceKiCad2Step
Flag to enable KiCad2Step debug tracing.
Handle(KICAD3D_INFO) KICAD3D_INFO
bool IsCopperLayer(int aLayerId)
Test whether a layer is a copper layer.
bool IsInnerCopperLayer(int aLayerId)
Test whether a layer is an inner (In1_Cu to In30_Cu) copper layer.
PCB_LAYER_ID
A quick note on layer IDs:
#define UNIMPLEMENTED_FOR(type)
@ PTH
Plated through hole pad.
@ CASTELLATED
a pad with a castellated through hole
BARCODE class definition.
PGM_BASE & Pgm()
The global program "get" accessor.
int64_t GetRunningMicroSecs()
An alternate way to calculate an elapsed time (in microsecondes) to class PROF_COUNTER.
static constexpr double OCC_MAX_DISTANCE_TO_MERGE_POINTS
Default distance between points to treat them as separate ones (mm) 0.001 mm or less is a reasonable ...
LINE_STYLE
Dashed line types.
The properties of a padstack drill.
VECTOR2I size
Drill diameter (x == y) or slot dimensions (x != y)
std::optional< PAD_DRILL_POST_MACHINING_MODE > mode
wxLogTrace helper definitions.
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
@ PCB_BARCODE_T
class PCB_BARCODE, a barcode (graphic item)
@ PCB_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs
@ PCB_DRILL_CHART_T
class PCB_DRILL_CHART, a live drill chart derived from PCB_TABLE
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D
VECTOR3< double > VECTOR3D
Definition of file extensions used in Kicad.