|
KiCad PCB EDA Suite
|
#include <export_idf.h>
Public Member Functions | |
| IDF_EXPORTER (BOARD *aBoard, FILENAME_RESOLVER *aResolver, JOB_EXPORT_PCB_IDF *aSettings, REPORTER *aReporter=nullptr) | |
| bool | Export (const wxString &aFullFileName) const |
Generate IDFv3 compliant board (*.emn) and library (*.emp) files for aPcb. | |
Private Member Functions | |
| VECTOR2D | getOrigin () const |
| void | exportFootprint (FOOTPRINT *aFootprint, IDF3_BOARD &aIDFBoard) const |
| Exports the given footprint to an in-progress IDF file. | |
| bool | exportFootprintIdfModels (FOOTPRINT *aFootprint, IDF3_BOARD &aIDFBoard) const |
| Exports any explicit IDF models attached to a footprint to an in-progress IDF file. | |
| IDF3_COMP_OUTLINE * | createOutlineFromExtrudedBody (const FOOTPRINT *aFootprint, IDF3_BOARD &aIDFBoard, const EXTRUDED_3D_BODY &aBody) const |
| Generates an IDF component outline from a footprint extruded 3D body, if possible. | |
| int | getMaxModelHeight (FOOTPRINT *aFootprint) const |
| Returns the largest extent in Z of the footprint's visible 3D models, in IU. | |
Private Attributes | |
| BOARD * | m_board = nullptr |
| FILENAME_RESOLVER * | m_resolver = nullptr |
| JOB_EXPORT_PCB_IDF * | m_settings = nullptr |
| REPORTER * | m_reporter = nullptr |
| std::unique_ptr< JOB_EXPORT_PCB_IDF > | m_defaultSettings |
Definition at line 36 of file export_idf.h.
|
explicit |
Definition at line 53 of file export_idf.cpp.
References m_board, m_defaultSettings, m_reporter, m_resolver, and m_settings.
|
private |
Generates an IDF component outline from a footprint extruded 3D body, if possible.
Definition at line 566 of file export_idf.cpp.
References _, BOARD_OUTLINE::AddOutline(), ApplyExtrusionTransform(), chain, IDF3::COMP_ELEC, IDF3::COMP_MECH, SHAPE_POLY_SET::COutline(), IDF_OUTLINE::empty(), end, LIB_ID::Format(), FP_SMD, FP_THROUGH_HOLE, FOOTPRINT::GetAttributes(), IDF3_BOARD::GetComponentOutline(), GetExtrusionOutline(), FOOTPRINT::GetField(), FOOTPRINT::GetFPID(), FOOTPRINT::GetOrientation(), IDF3::GetOutline(), FOOTPRINT::GetPosition(), FOOTPRINT::GetReference(), PCB_FIELD::GetShownText(), EXTRUDED_3D_BODY::m_height, m_reporter, EXTRUDED_3D_BODY::m_scale, m_settings, IDF_SETTINGS::MILS, SHAPE_POLY_SET::Move(), SHAPE_POLY_SET::OutlineCount(), BOARD_OUTLINE::OutlinesSize(), pcbIUScale, RESOLVED, SHAPE_POLY_SET::Rotate(), RPT_SEVERITY_ERROR, scale, IDF3_COMP_OUTLINE::SetComponentClass(), BOARD_OUTLINE::SetThickness(), BOARD_OUTLINE::SetUnit(), SHAPE_POLY_SET::Simplify(), IDF3::UNIT_MM, IDF3::UNIT_THOU, FOOTPRINT::Value(), VECTOR2< T >::x, VECTOR2< T >::y, and VECTOR3< T >::z.
Referenced by exportFootprint().
| bool IDF_EXPORTER::Export | ( | const wxString & | aFullFileName | ) | const |
Generate IDFv3 compliant board (*.emn) and library (*.emp) files for aPcb.
Headless-friendly core of the IDF exporter. aResolver locates 3D model files and must be non-null; the GUI passes the project resolver while non-GUI callers may pass a bare resolver. On failure the routine returns false and, when aErrorMsg is non-null, stores a human-readable message rather than showing a dialog.
Definition at line 1054 of file export_idf.cpp.
References _, IDF3::CAD_ELEC, exportFootprint(), From_UTF8(), GetBuildVersion(), IDF3_BOARD::GetError(), getOrigin(), idf_export_outline(), FILEEXT::IdfV3BoardFileExtension, FILEEXT::IdfV3LibraryFileExtension, m_board, m_reporter, m_resolver, m_settings, IDF_SETTINGS::MILS, pcbIUScale, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, scale, IDF3_BOARD::SetBoardName(), IDF3_BOARD::SetBoardThickness(), IDF3_BOARD::SetBoardVersion(), IDF3_BOARD::SetIDFSource(), IDF3_BOARD::SetLibraryVersion(), IDF3_BOARD::SetUserOffset(), IDF3_BOARD::SetUserPrecision(), IDF3_BOARD::SetUserScale(), TO_UTF8, IDF3::UNIT_MM, IDF3::UNIT_THOU, IO_ERROR::What(), IDF3_BOARD::WriteFile(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), DIALOG_EXPORT_IDF3::doExport(), and PCBNEW_JOBS_HANDLER::JobExportIdf().
|
private |
Exports the given footprint to an in-progress IDF file.
Retrieve information from all board footprints, adds drill holes to the DRILLED_HOLES or BOARD_OUTLINE section as appropriate, Compiles data for the PLACEMENT section and compiles data for the library ELECTRICAL section.
Definition at line 751 of file export_idf.cpp.
References _, IDF3_BOARD::AddBoardOutline(), IDF3_BOARD::AddComponent(), IDF3_BOARD::AddDrill(), IDF3_BOARD::AddSlot(), EDA_ANGLE::AsDegrees(), B_Cu, comp, createOutlineFromExtrudedBody(), IDF3::ECAD, Edge_Cuts, IDF_OUTLINE::empty(), exportFootprintIdfModels(), IDF3_BOARD::FindComponent(), FP_SMD, FP_THROUGH_HOLE, FOOTPRINT::GetAttributes(), FOOTPRINT::GetDNPForVariant(), FOOTPRINT::GetExtrudedBody(), FOOTPRINT::GetLayer(), getMaxModelHeight(), IDF3_BOARD::GetNewRefDes(), FOOTPRINT::GetOrientation(), IDF3::GetOutline(), FOOTPRINT::GetPosition(), FOOTPRINT::GetReference(), PCB_FIELD::GetShownText(), IDF3_BOARD::GetUserOffset(), IDF3_BOARD::GetUserScale(), FOOTPRINT::GraphicalItems(), idf_append_shape(), IDF3::LYR_BOTTOM, IDF3::LYR_TOP, m_board, EXTRUDED_3D_BODY::m_height, m_reporter, m_resolver, m_settings, IDF_SETTINGS::MILS, IDF3::NPTH, NPTH, OBLONG, pad, FOOTPRINT::Pads(), PCB_SHAPE_T, pcbIUScale, IDF3::PS_ECAD, IDF3::PTH, FOOTPRINT::Reference(), RESOLVED, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, scale, IDF3_COMP_OUTLINE_DATA::SetOffsets(), TO_UTF8, top(), FOOTPRINT::Value(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by Export().
|
private |
Exports any explicit IDF models attached to a footprint to an in-progress IDF file.
Definition at line 366 of file export_idf.cpp.
References _, IDF3_BOARD::AddComponent(), EDA_ANGLE::AsDegrees(), B_Cu, comp, IDF3_BOARD::FindComponent(), PROJECT_PCB::FootprintLibAdapter(), IDF3_BOARD::GetComponentOutline(), FOOTPRINT::GetEmbeddedFiles(), FOOTPRINT::GetFPID(), LIBRARY_MANAGER::GetFullURI(), FOOTPRINT::GetLayer(), LIB_ID::GetLibNickname(), IDF3_BOARD::GetNewRefDes(), FOOTPRINT::GetOrientation(), FOOTPRINT::GetPosition(), FOOTPRINT::GetReference(), LIBRARY_MANAGER_ADAPTER::GetRow(), PCB_FIELD::GetShownText(), IDF3_BOARD::GetUserOffset(), IDF3_BOARD::GetUserScale(), IDF3::LYR_BOTTOM, IDF3::LYR_TOP, m_board, m_reporter, m_resolver, FOOTPRINT::Models(), IDF3::PS_ECAD, FOOTPRINT::Reference(), RESOLVED, RotatePoint(), RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, scale, IDF3_COMP_OUTLINE_DATA::SetOffsets(), TO_UTF8, top(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by exportFootprint().
|
private |
Returns the largest extent in Z of the footprint's visible 3D models, in IU.
Definition at line 703 of file export_idf.cpp.
References PROJECT_PCB::FootprintLibAdapter(), PROJECT_PCB::Get3DCacheManager(), FOOTPRINT::GetEmbeddedFiles(), FOOTPRINT::GetFPID(), LIBRARY_MANAGER::GetFullURI(), LIB_ID::GetLibNickname(), S3D_CACHE::GetModel(), getModelHeight(), m_board, m_resolver, model, FOOTPRINT::Models(), pcbIUScale, and project.
Referenced by exportFootprint().
|
private |
Definition at line 1019 of file export_idf.cpp.
References IDF_SETTINGS::CENTER, BOX2< Vec >::Centre(), IDF_SETTINGS::DRILL, IDF_SETTINGS::GRID, m_board, m_settings, IDF_SETTINGS::MM, pcbIUScale, scale, and IDF_SETTINGS::USER.
Referenced by Export().
|
private |
Definition at line 71 of file export_idf.h.
Referenced by Export(), exportFootprint(), exportFootprintIdfModels(), getMaxModelHeight(), getOrigin(), and IDF_EXPORTER().
|
private |
Definition at line 76 of file export_idf.h.
Referenced by IDF_EXPORTER().
|
private |
Definition at line 74 of file export_idf.h.
Referenced by createOutlineFromExtrudedBody(), Export(), exportFootprint(), exportFootprintIdfModels(), and IDF_EXPORTER().
|
private |
Definition at line 72 of file export_idf.h.
Referenced by Export(), exportFootprint(), exportFootprintIdfModels(), getMaxModelHeight(), and IDF_EXPORTER().
|
private |
Definition at line 73 of file export_idf.h.
Referenced by createOutlineFromExtrudedBody(), Export(), exportFootprint(), getOrigin(), and IDF_EXPORTER().