KiCad PCB EDA Suite
Loading...
Searching...
No Matches
export_idf.cpp File Reference
#include <list>
#include <locale_io.h>
#include <macros.h>
#include <pcb_edit_frame.h>
#include <board.h>
#include <board_design_settings.h>
#include <footprint.h>
#include <footprint_library_adapter.h>
#include <idf_parser.h>
#include <pad.h>
#include <pcb_shape.h>
#include <build_version.h>
#include <project_pcb.h>
#include <wx/msgdlg.h>
#include "project.h"
#include "3d_cache/3d_cache.h"
#include "filename_resolver.h"
#include "export_idf.h"
#include <base_units.h>

Go to the source code of this file.

Macros

#define LINE_WIDTH   (pcbIUScale.mmToIU( 0.1 ))
 

Functions

static void idf_append_shape (PCB_SHAPE *aGraphic, double aScale, double aOffX, double aOffY, std::list< IDF_SEGMENT * > &aLines)
 Convert a single Edge_Cuts graphic into IDF segments and append them to aLines.
 
static void idf_export_outline (BOARD *aPcb, IDF3_BOARD &aIDFBoard)
 Retrieve line segment information from the edge layer and compiles the data into a form which can be output as an IDFv3 compliant BOARD_OUTLINE section.
 
static void idf_export_footprint (BOARD *aPcb, FOOTPRINT *aFootprint, IDF3_BOARD &aIDFBoard, bool aIncludeUnspecified, bool aIncludeDNP)
 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.
 
bool ExportBoardToIDF3 (BOARD *aPcb, const wxString &aFullFileName, bool aUseThou, double aXRef, double aYRef, bool aIncludeUnspecified, bool aIncludeDNP, FILENAME_RESOLVER *aResolver, wxString *aErrorMsg)
 Generate IDFv3 compliant board (*.emn) and library (*.emp) files representing the user's PCB design.
 

Variables

static FILENAME_RESOLVERresolver
 

Macro Definition Documentation

◆ LINE_WIDTH

#define LINE_WIDTH   (pcbIUScale.mmToIU( 0.1 ))

Definition at line 46 of file export_idf.cpp.

Referenced by idf_export_outline().

Function Documentation

◆ ExportBoardToIDF3()

bool ExportBoardToIDF3 ( BOARD * aPcb,
const wxString & aFullFileName,
bool aUseThou,
double aXRef,
double aYRef,
bool aIncludeUnspecified,
bool aIncludeDNP,
FILENAME_RESOLVER * aResolver,
wxString * aErrorMsg )

Generate IDFv3 compliant board (*.emn) and library (*.emp) files representing the user's PCB design.

Generate IDFv3 compliant board (*.emn) and library (*.emp) files for aPcb.

Split out from PCB_EDIT_FRAME::Export_IDF3 so it can be driven headlessly (unit tests, CLI) with an explicitly supplied 3D model resolver and no GUI error reporting.

Definition at line 681 of file export_idf.cpp.

References BOARD::Footprints(), From_UTF8(), BOARD_DESIGN_SETTINGS::GetBoardThickness(), GetBuildVersion(), BOARD::GetDesignSettings(), BOARD::GetFileName(), idf_export_footprint(), idf_export_outline(), pcbIUScale, resolver, scale, TO_UTF8, and IO_ERROR::What().

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and PCB_EDIT_FRAME::Export_IDF3().

◆ idf_append_shape()

static void idf_append_shape ( PCB_SHAPE * aGraphic,
double aScale,
double aOffX,
double aOffY,
std::list< IDF_SEGMENT * > & aLines )
static

◆ idf_export_footprint()

static void idf_export_footprint ( BOARD * aPcb,
FOOTPRINT * aFootprint,
IDF3_BOARD & aIDFBoard,
bool aIncludeUnspecified,
bool aIncludeDNP )
static

◆ idf_export_outline()

static void idf_export_outline ( BOARD * aPcb,
IDF3_BOARD & aIDFBoard )
static

Retrieve line segment information from the edge layer and compiles the data into a form which can be output as an IDFv3 compliant BOARD_OUTLINE section.

Definition at line 196 of file export_idf.cpp.

References BOARD::Drawings(), Edge_Cuts, BOARD::GetBoardEdgesBoundingBox(), BOX2< Vec >::GetOrigin(), BOX2< Vec >::GetSize(), idf_append_shape(), LINE_WIDTH, PCB_SHAPE_T, and scale.

Referenced by ExportBoardToIDF3().

Variable Documentation

◆ resolver

FILENAME_RESOLVER* resolver
static

Definition at line 49 of file export_idf.cpp.

Referenced by DIALOG_MIGRATE_3D_MODELS::AutoMigrateByFilename(), DIALOG_MIGRATE_3D_MODELS::BoardHasUnresolvedWrlReferences(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), DIALOG_MIGRATE_3D_MODELS::buildCatalog(), PCB_CONTROL::CollectAndEmbed3DModels(), DIALOG_MIGRATE_3D_MODELS::collectMissingModels(), DIALOG_MIGRATE_3D_MODELS::CountUnresolvedWrlReferences(), EXPRESSION_EVALUATOR::createCombinedCallback(), DIALOG_SYMBOL_FIELDS_TABLE::DIALOG_SYMBOL_FIELDS_TABLE(), PCB_TUNING_PATTERN::EditStart(), ExportBoardToIDF3(), PCB_FIELD::GetShownText(), PCB_TEXT::GetShownText(), PCB_TEXTBOX::GetShownText(), KIPLATFORM::ENV::GetSystemProxyConfig(), idf_export_footprint(), BOARD_LOADER::initializeLoadedBoard(), PCB_EDIT_FRAME::LoadDrawingSheet(), SCH_EDIT_FRAME::LoadDrawingSheet(), PCBNEW_JOBS_HANDLER::loadOverrideDrawingSheet(), DRC_ENGINE::loadRules(), PANEL_SETUP_RULES::OnCompile(), DIALOG_MIGRATE_3D_MODELS::OnReplaceClick(), PANEL_SETUP_RULES::OnShowMatching(), SIM_LIB_MGR::ResolveLibraryPath(), and ROUTER_TOOL::UpdateMessagePanel().