KiCad PCB EDA Suite
base_units.h File Reference

Go to the source code of this file.

Classes

struct  EDA_IU_SCALE
 

Variables

constexpr double GERB_IU_PER_MM = 1e5
 some define and functions to convert a value in mils, decimils or mm to the internal unit used in pcbnew, cvpcb or gerbview (nanometer or deci-mil) depending on compile time option More...
 
constexpr double PCB_IU_PER_MM = 1e6
 
constexpr double PL_IU_PER_MM = 1e3
 
constexpr double SCH_IU_PER_MM = 1e4
 
constexpr EDA_IU_SCALE gerbIUScale = EDA_IU_SCALE( GERB_IU_PER_MM )
 
constexpr EDA_IU_SCALE pcbIUScale = EDA_IU_SCALE( PCB_IU_PER_MM )
 
constexpr EDA_IU_SCALE drawSheetIUScale = EDA_IU_SCALE( PL_IU_PER_MM )
 
constexpr EDA_IU_SCALE schIUScale = EDA_IU_SCALE( SCH_IU_PER_MM )
 
constexpr EDA_IU_SCALE unityScale = EDA_IU_SCALE( 1 )
 
constexpr int ARC_LOW_DEF = pcbIUScale.mmToIU( 0.02 )
 
constexpr int ARC_HIGH_DEF = pcbIUScale.mmToIU( 0.005 )
 

Variable Documentation

◆ ARC_HIGH_DEF

◆ ARC_LOW_DEF

◆ drawSheetIUScale

◆ GERB_IU_PER_MM

constexpr double GERB_IU_PER_MM = 1e5
constexpr

some define and functions to convert a value in mils, decimils or mm to the internal unit used in pcbnew, cvpcb or gerbview (nanometer or deci-mil) depending on compile time option

Definition at line 70 of file base_units.h.

Referenced by scaletoIU().

◆ gerbIUScale

◆ PCB_IU_PER_MM

◆ pcbIUScale

constexpr EDA_IU_SCALE pcbIUScale = EDA_IU_SCALE( PCB_IU_PER_MM )
constexpr

Definition at line 109 of file base_units.h.

Referenced by DIALOG_COPPER_ZONE::AcceptOptions(), ZONE_FILLER::addHatchFillTypeOnZone(), STEP_PCB_MODEL::AddPadHole(), AddRectCourtyard(), PCAD2KICAD::PCB_PAD::AddToFootprint(), DIALOG_PLOT::applyPlotSettings(), AR_AUTOPLACER::AR_AUTOPLACER(), AR_AUTOPLACER::AutoplaceFootprints(), BOARD::BOARD(), BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), buildBoardBoundingBoxPoly(), BuildBoardPolygonOutlines(), ZONE_FILLER::buildCopperItemClearances(), FOOTPRINT::BuildCourtyardCaches(), BOARD_STACKUP::BuildDefaultStackupList(), PAD::BuildEffectiveShapes(), BuildStackupReport(), ZONE_FILLER::buildThermalSpokes(), ComboBoxUnits(), EXPORTER_STEP::composePCB(), EXPORTER_PCB_VRML::ComputeLayer3D_Zpos(), TEARDROP_MANAGER::computeTeardropPolygonPoints(), ConfigureHPGLPenSizes(), PCB_UNIT_RESOLVER::Convert(), BOARD_ADAPTER::createBoardPolygon(), GERBER_WRITER::createDrillFile(), PLACEFILE_GERBER_WRITER::CreatePlaceFile(), PANEL_PCBNEW_COLOR_SETTINGS::createPreviewItems(), TEARDROP_MANAGER::createTeardrop(), EXPORTER_STEP::determinePcbThickness(), DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX(), diameter_in_inches(), diameter_in_mm(), DIALOG_PAD_PROPERTIES::displayPrimitivesList(), PGPROPERTY_DISTANCE::DistanceToString(), PANEL_PREVIEW_3D_MODEL::doIncrementOffset(), PANEL_PREVIEW_3D_MODEL::doIncrementScale(), EDIT_TOOL::DragArcTrack(), KIGFX::PCB_PAINTER::draw(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawBoardCharacteristics(), DRAWING_TOOL::drawShape(), DRAWING_TOOL::DrawSpecificationStackup(), PCB_POINT_EDITOR::editArcEndpointKeepCenter(), PCB_POINT_EDITOR::editArcMidKeepCenter(), PAD_TOOL::EnumeratePads(), BOARD_NETLIST_UPDATER::estimateFootprintInsertionPosition(), EVT_UPDATE_UI_RANGE(), PCB_EDIT_FRAME::Export_IDF3(), EXPORTER_PCB_VRML::EXPORTER_PCB_VRML(), EXPORTER_PCB_VRML::ExportVRML_File(), EXPORTER_PCB_VRML::ExportVrmlFootprint(), EXPORTER_PCB_VRML::ExportVrmlPadHole(), EXPORTER_PCB_VRML::ExportVrmlViaHoles(), ZONE_FILLER::fillCopperZone(), FillNegativeKnockout(), ZONE_FILLER::fillNonCopperZone(), PCB_BASE_FRAME::FocusOnItems(), FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME(), FOOTPRINT_EDITOR_SETTINGS::FOOTPRINT_EDITOR_SETTINGS(), PCB_PLUGIN::format(), BOARD_STACKUP::FormatBoardStackup(), formatCoord(), PCB_PLUGIN::formatGeneral(), PCB_PLUGIN::formatPolyPts(), PCB_PLUGIN::formatSetup(), FP_TEXT::FP_TEXT(), GENDRILL_WRITER_BASE::genDrillMapFile(), RENDER_3D_OPENGL::generate3dGrid(), ARC_DATA_MM::GenerateArc(), GERBER_JOBFILE_WRITER::GERBER_JOBFILE_WRITER(), BOARD::GetBoardPolygonOutlines(), PCB_GROUP::GetBoundingBox(), FOOTPRINT::GetBoundingBox(), FOOTPRINT::GetBoundingHull(), BOARD_STACKUP_ITEM::GetCopperDefaultThickness(), ZONE::GetDefaultHatchPitch(), FOOTPRINT_EDIT_FRAME::GetDocumentExtents(), BOARD_DESIGN_SETTINGS::GetDRCEpsilon(), BOARD_DESIGN_SETTINGS::GetHolePlatingThickness(), getInPcbUnits(), ZONE::GetInteractingZones(), BOARD_STACKUP_ITEM::GetMaskDefaultThickness(), PCB_DIMENSION_BASE::GetMsgPanelInfo(), PCB_DIM_ALIGNED::GetMsgPanelInfo(), PCB_BASE_FRAME::GetPageSizeIU(), DIALOG_BOARD_REANNOTATE::GetParameters(), BOARD_ITEM::GetStroke(), PCB_DIMENSION_BASE::GetValueText(), GRAPHICS_IMPORTER_PCBNEW::GRAPHICS_IMPORTER_PCBNEW(), ZONE::HitTest(), LEGACY_PLUGIN::init(), DIALOG_PLOT::init_Dialog(), initializePlotter(), BOARD_ADAPTER::InitSettings(), initTextTable(), TEST_BOARD_ITEM_FIXTURE::Instantiate(), DSN::IU2um(), iu_to_d356(), EAGLE_PLUGIN::loadClasses(), LEGACY_PLUGIN::loadGENERAL(), EAGLE_PLUGIN::loadPolygon(), PANEL_3D_RAYTRACING_OPTIONS::loadSettings(), MakeInvalidCourtyardTestFP(), STEP_PCB_MODEL::MakeShape(), DSN::SPECCTRA_DB::makeVIA(), PCB_VIEWER_TOOLS::MeasureTool(), FOOTPRINT_EDITOR_SETTINGS::MigrateFromLegacy(), PCBNEW_SETTINGS::MigrateFromLegacy(), PCBNEW_PRINTOUT::milsToIU(), FOOTPRINT::MoveAnchorPosition(), NET_SETTINGS::NET_SETTINGS(), FOOTPRINT_PREVIEW_PANEL::New(), DIALOG_EXPORT_STEP::onExportButton(), PCB_EDIT_FRAME::OnExportIDF3(), PCB_EDIT_FRAME::OnExportVRML(), PANEL_PREVIEW_3D_MODEL::onMouseWheelOffset(), PANEL_PREVIEW_3D_MODEL::onMouseWheelScale(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::onPaintPolyPanel(), PCB_BITMAP::operator=(), EAGLE_PLUGIN::packageWire(), PAD::PAD(), BOARD_EDITOR_CONTROL::PageSettings(), PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES(), ALTIUM_PCB::Parse(), PCB_PARSER::parseBoardUnits(), ALTIUM_PCB::ParseComponentsBodies6Data(), PCB_PARSER::parseEDA_TEXT(), GPCB_FPL_CACHE::parseFOOTPRINT(), PCB_PARSER::parseFP_SHAPE(), PCB_PARSER::parseFP_TEXTBOX(), PCB_PARSER::parsePAD(), PCB_PARSER::parsePCB_SHAPE(), PCB_PARSER::parsePCB_TEXTBOX(), PCB_PARSER::parseZONE(), PCB_BITMAP::PCB_BITMAP(), PCB_PLOT_PARAMS::PCB_PLOT_PARAMS(), PCB_TARGET::PCB_TARGET(), PCB_TRACK::PCB_TRACK(), PCB_POINT_EDITOR::pinEditedCorner(), playground_main_func(), PCB_PLOT_SVG::Plot(), BRDITEMS_PLOTTER::PlotDrillMarks(), PlotLayerOutlines(), PlotSolderMaskLayer(), DIALOG_PAD_PROPERTIES::prepareCanvas(), FABMASTER::processScaleFactor(), LP_CACHE::ReadAndVerifyHeader(), MWAVE_POLYGONAL_SHAPE_DLG::ReadDataShapeDescr(), DRC_TEST_PROVIDER_SLIVER_CHECKER::Run(), DSN::scale(), ZONE::SetBorderDisplayStyle(), PANEL_SETUP_BOARD_STACKUP::setDefaultLayerWidths(), EXCELLON_WRITER::SetFormat(), GERBER_WRITER::SetFormat(), PCB_BASE_FRAME::SetPageSettings(), PCB_EDIT_FRAME::SetPageSettings(), TEARDROP_MANAGER::SetTeardrops(), PCBNEW_PRINTOUT::setupGal(), RENDER_3D_RAYTRACE::setupMaterials(), PCBNEW_PRINTOUT::setupPainter(), shapesNeedUpdate(), StartPlotBoard(), PCAD2KICAD::StrToDoublePrecisionUnits(), PNS_KICAD_IFACE_BASE::syncZone(), DRC_TEST_PROVIDER_MISC::testOutline(), DRC_TEST_PROVIDER_MISC::testTextVars(), PANEL_3D_RAYTRACING_OPTIONS::TransferDataFromWindow(), DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataFromWindow(), DIALOG_RULE_AREA_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), PANEL_SETUP_CONSTRAINTS::TransferDataFromWindow(), DIALOG_IMPORT_GFX::TransferDataFromWindow(), DIALOG_COPPER_ZONE::TransferDataToWindow(), DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataToWindow(), PNS::DP_MEANDER_PLACER::TuningInfo(), PNS::MEANDER_PLACER::TuningInfo(), PNS::MEANDER_SKEW_PLACER::TuningInfo(), DIALOG_POSITION_RELATIVE::updateAnchorInfo(), PCB_POINT_EDITOR::updateItem(), PANEL_PREVIEW_3D_MODEL::updateOrientation(), PAD::ViewGetLOD(), PCB_TRACK::ViewGetLOD(), PCB_VIA::ViewGetLOD(), WriteDRCReport(), EXPORTER_PCB_VRML::writeLayers(), DIALOG_DRC::writeReport(), ZONE::ZONE(), ZONE_SETTINGS::ZONE_SETTINGS(), BOARD_EDITOR_CONTROL::ZoneDuplicate(), PCB_SELECTION_TOOL::ZoomFitCrossProbeBBox(), and DIALOG_IMPORT_GFX::~DIALOG_IMPORT_GFX().

◆ PL_IU_PER_MM

constexpr double PL_IU_PER_MM = 1e3
constexpr

◆ SCH_IU_PER_MM

◆ schIUScale

constexpr EDA_IU_SCALE schIUScale = EDA_IU_SCALE( SCH_IU_PER_MM )
constexpr

Definition at line 111 of file base_units.h.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), SCH_EAGLE_PLUGIN::addImplicitConnections(), SCH_EAGLE_PLUGIN::adjustNetLabels(), Altium2KiCadUnit(), SCH_CONNECTION::AppendInfoToMsgPanel(), EE_GRID_HELPER::BestSnapAnchor(), BOOST_AUTO_TEST_CASE(), bumpToNextGrid(), CheckLibSymbol(), CONNECTION_GRAPH::collectAllDriverValues(), AUTOPLACER::computeFBoxSize(), SCH_PLOTTER::createHPGLFiles(), PANEL_EESCHEMA_COLOR_SETTINGS::createPreviewItems(), DIALOG_LIB_NEW_SYMBOL::DIALOG_LIB_NEW_SYMBOL(), KIGFX::SCH_VIEW::DisplaySheet(), AUTOPLACER::DoAutoplace(), KIGFX::SCH_PAINTER::draw(), SCH_EDIT_FRAME::DrawCurrentSheetToClipboard(), KIGFX::SCH_PAINTER::drawDanglingSymbol(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), KIGFX::dummy(), dummy(), AUTOPLACER::fieldVPlacement(), formatArc(), formatBezier(), formatCircle(), formatPoly(), formatRect(), SCH_HIERLABEL::GetBodyBoundingBox(), LIB_PIN::GetBoundingBox(), SCH_EDIT_FRAME::GetDocumentExtents(), SYMBOL_EDIT_FRAME::GetDocumentExtents(), SCH_JUNCTION::getEffectiveShape(), getInSchUnits(), GetLastPinLength(), GetLastPinNameSize(), GetLastPinNumSize(), CADSTAR_SCH_ARCHIVE_LOADER::getLineThickness(), KIGFX::SCH_PAINTER::getLineWidth(), SCH_SHEET::GetMinHeight(), SCH_SHEET::GetMinWidth(), SCH_BASE_FRAME::GetPageSizeIU(), SCH_LINE::GetPenWidth(), SCH_SHAPE::GetPenWidth(), SCH_SHEET::GetPenWidth(), SCH_SHEET_PIN::GetPenWidth(), DIALOG_PLOT_SCHEMATIC::getPlotOptions(), KIGFX::SCH_PAINTER::getShadowWidth(), HelperGeneratePowerPortGraphics(), LIB_SHAPE::HitTest(), LIB_TEXTBOX::HitTest(), DIALOG_PLOT_SCHEMATIC::initDlg(), TEST_EE_ITEM_FIXTURE::Instantiate(), SCH_SYMBOL::IsMovableFromAnchorPoint(), IterateOverPositionsAndReferences(), LIB_PIN::LIB_PIN(), LIB_SYMBOL::LIB_SYMBOL(), LIB_TEXT::LIB_TEXT(), LIB_TEXTBOX::LIB_TEXTBOX(), CADSTAR_SCH_ARCHIVE_LOADER::Load(), SCH_LEGACY_PLUGIN_CACHE::loadArc(), SCH_LEGACY_PLUGIN_CACHE::loadBezier(), SCH_LEGACY_PLUGIN::loadBitmap(), SCH_LEGACY_PLUGIN::loadBusEntry(), SCH_LEGACY_PLUGIN_CACHE::loadCircle(), PANEL_EESCHEMA_EDITING_OPTIONS::loadEEschemaSettings(), SCH_LEGACY_PLUGIN_CACHE::loadField(), SCH_EAGLE_PLUGIN::loadFrame(), SCH_LEGACY_PLUGIN::loadJunction(), SCH_LEGACY_PLUGIN::loadNoConnect(), SCH_LEGACY_PLUGIN_CACHE::LoadPart(), SCH_LEGACY_PLUGIN_CACHE::loadPin(), SCH_EAGLE_PLUGIN::loadPin(), SCH_LEGACY_PLUGIN_CACHE::loadPolyLine(), SCH_LEGACY_PLUGIN_CACHE::loadRect(), SCH_EAGLE_PLUGIN::loadSchematic(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbolInstances(), SCH_EAGLE_PLUGIN::loadSegments(), CADSTAR_SCH_ARCHIVE_LOADER::loadShapeVertices(), SCH_LEGACY_PLUGIN::loadSheet(), SCH_EAGLE_PLUGIN::loadSheet(), CADSTAR_SCH_ARCHIVE_LOADER::loadSheets(), SCH_LEGACY_PLUGIN::loadSymbol(), PANEL_SYM_EDITING_OPTIONS::loadSymEditorSettings(), SCH_LEGACY_PLUGIN::loadText(), SCH_LEGACY_PLUGIN_CACHE::loadText(), SCH_LEGACY_PLUGIN::loadWire(), NET_SETTINGS::NET_SETTINGS(), DIALOG_LIB_SYMBOL_PROPERTIES::OnAddField(), DIALOG_LIB_EDIT_PIN_TABLE::OnAddRow(), DIALOG_LIB_SHAPE_PROPERTIES::onBorderChecked(), DIALOG_SHAPE_PROPERTIES::onBorderChecked(), DIALOG_LIB_TEXTBOX_PROPERTIES::onBorderChecked(), PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES(), SCH_SEXPR_PARSER::parseArc(), SCH_SEXPR_PARSER::parseBezier(), SCH_SEXPR_PARSER::parseBusEntry(), SCH_SEXPR_PARSER::parseCircle(), SCH_ALTIUM_PLUGIN::ParseHarnessPort(), SCH_SEXPR_PARSER::parseInternalUnits(), SCH_SEXPR_PARSER::parseLine(), SCH_SEXPR_PARSER::parsePin(), SCH_SEXPR_PARSER::parsePolyLine(), SCH_ALTIUM_PLUGIN::ParsePort(), SCH_SEXPR_PARSER::parseRectangle(), SCH_SEXPR_PARSER::parseSchArc(), SCH_SEXPR_PARSER::parseSchBezier(), SCH_SEXPR_PARSER::parseSchCircle(), SCH_SEXPR_PARSER::parseSchPolyLine(), SCH_SEXPR_PARSER::parseSchRectangle(), SCH_SEXPR_PARSER::parseSchTextBox(), SCH_SEXPR_PARSER::parseSheet(), SCH_ALTIUM_PLUGIN::ParseSheet(), SCH_SEXPR_PARSER::parseStroke(), SCH_SEXPR_PARSER::parseTextBox(), SCH_PLOTTER::plotOneSheetDXF(), SCH_PLOTTER::plotOneSheetHpgl(), SCH_PLOTTER::plotOneSheetPDF(), SCH_PLOTTER::plotOneSheetPS(), SCH_PLOTTER::plotOneSheetSVG(), LIB_PIN::PlotPinTexts(), SCH_EDIT_FRAME::PrintPage(), SYMBOL_EDIT_FRAME::PrintPage(), SCH_PRINTOUT::PrintPage(), LIB_PIN::printPinElectricalTypeName(), LIB_PIN::printPinTexts(), CONNECTION_GRAPH::processSubGraphs(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDITOR_PIN_TOOL::RepeatPin(), KIGFX::SCH_VIEW::ResizeSheetWorkingArea(), SCH_LEGACY_PLUGIN_CACHE::saveArc(), SCH_LEGACY_PLUGIN_CACHE::saveBezier(), SCH_LEGACY_PLUGIN::saveBitmap(), SCH_SEXPR_PLUGIN::saveBitmap(), SCH_LEGACY_PLUGIN::saveBusEntry(), SCH_SEXPR_PLUGIN::saveBusEntry(), SCH_LEGACY_PLUGIN_CACHE::saveCircle(), SCH_LEGACY_PLUGIN_CACHE::saveField(), SCH_SEXPR_PLUGIN_CACHE::saveField(), SCH_LEGACY_PLUGIN::saveField(), SCH_SEXPR_PLUGIN::saveField(), SCH_LEGACY_PLUGIN::saveJunction(), SCH_SEXPR_PLUGIN::saveJunction(), SCH_LEGACY_PLUGIN::saveLine(), SCH_SEXPR_PLUGIN::saveLine(), SCH_LEGACY_PLUGIN::saveNoConnect(), SCH_SEXPR_PLUGIN::saveNoConnect(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SCH_SEXPR_PLUGIN_CACHE::savePin(), SCH_LEGACY_PLUGIN_CACHE::savePolyLine(), SCH_LEGACY_PLUGIN_CACHE::saveRectangle(), SCH_LEGACY_PLUGIN::saveSheet(), SCH_SEXPR_PLUGIN::saveSheet(), SCH_SEXPR_PLUGIN_CACHE::SaveSymbol(), SCH_LEGACY_PLUGIN_CACHE::SaveSymbol(), SCH_LEGACY_PLUGIN::saveSymbol(), SCH_SEXPR_PLUGIN::saveSymbol(), SCH_LEGACY_PLUGIN_CACHE::saveText(), SCH_SEXPR_PLUGIN_CACHE::saveText(), SCH_LEGACY_PLUGIN::saveText(), SCH_SEXPR_PLUGIN::saveText(), SCH_SEXPR_PLUGIN_CACHE::saveTextBox(), SCH_SEXPR_PLUGIN::saveTextBox(), SCH_BUS_BUS_ENTRY::SCH_BUS_BUS_ENTRY(), SCH_BUS_ENTRY_BASE::SCH_BUS_ENTRY_BASE(), SCH_BUS_WIRE_ENTRY::SCH_BUS_WIRE_ENTRY(), SCH_DIRECTIVE_LABEL::SCH_DIRECTIVE_LABEL(), SCH_JUNCTION::SCH_JUNCTION(), SCH_LINE::SCH_LINE(), SCH_NO_CONNECT::SCH_NO_CONNECT(), SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL(), KIGFX::SCH_RENDER_SETTINGS::SCH_RENDER_SETTINGS(), SCH_SCREEN::SCH_SCREEN(), KIGFX::SCH_VIEW::SCH_VIEW(), SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS(), DIALOG_PLOT_SCHEMATIC::setHpglPenWidth(), SCH_PLOTTER::setupPlotPagePDF(), PIN_TABLE_DATA_MODEL::SetValue(), SCH_DRAWING_TOOLS::sizeSheet(), SYMBOL_EDIT_FRAME::SVGPlotSymbol(), SYMBOL_EDIT_FRAME::SYMBOL_EDIT_FRAME(), SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME(), TEST_EE_ITEM_FIXTURE::TEST_EE_ITEM_FIXTURE(), ERC_TESTER::TestOffGridEndpoints(), ERC_TESTER::TestTextVars(), PANEL_EESCHEMA_EDITING_OPTIONS::TransferDataFromWindow(), PANEL_SYM_EDITING_OPTIONS::TransferDataFromWindow(), DIALOG_LIB_TEXT_PROPERTIES::TransferDataToWindow(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), EE_POINT_EDITOR::updateParentItem(), EE_SELECTION_TOOL::ZoomFitCrossProbeBBox(), and PANEL_EESCHEMA_COLOR_SETTINGS::zoomFitPreview().

◆ unityScale