![]() |
KiCad PCB EDA Suite
|
Functions to plot one board layer (silkscreen layers or other layers). More...
#include <eda_item.h>
#include <geometry/geometry_utils.h>
#include <geometry/shape_segment.h>
#include <pcb_base_frame.h>
#include <math/util.h>
#include <board.h>
#include <core/arraydim.h>
#include <footprint.h>
#include <track.h>
#include <fp_shape.h>
#include <pcb_text.h>
#include <zone.h>
#include <pcb_shape.h>
#include <pcb_target.h>
#include <dimension.h>
#include <pcbplot.h>
#include <plotters_specific.h>
#include <pcb_painter.h>
#include <gbr_metadata.h>
#include <advanced_config.h>
Go to the source code of this file.
Macros | |
#define | NEW_ALGO 1 |
Functions | |
static void | PlotSolderMaskLayer (BOARD *aBoard, PLOTTER *aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS &aPlotOpt, int aMinThickness) |
void | PlotOneBoardLayer (BOARD *aBoard, PLOTTER *aPlotter, PCB_LAYER_ID aLayer, const PCB_PLOT_PARAMS &aPlotOpt) |
Function PlotOneBoardLayer main function to plot one copper or technical layer. More... | |
void | PlotStandardLayer (BOARD *aBoard, PLOTTER *aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS &aPlotOpt) |
Function PlotStandardLayer plot copper or technical layers. More... | |
void | PlotLayerOutlines (BOARD *aBoard, PLOTTER *aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS &aPlotOpt) |
Function PlotLayerOutlines plot copper outline of a copper layer. More... | |
static void | initializePlotter (PLOTTER *aPlotter, BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts) |
Set up most plot options for plotting a board (especially the viewport) Important thing: page size is the 'drawing' page size, paper size is the physical page size. More... | |
static void | FillNegativeKnockout (PLOTTER *aPlotter, const EDA_RECT &aBbbox) |
Prefill in black an area a little bigger than the board to prepare for the negative plot. More... | |
static void | ConfigureHPGLPenSizes (HPGL_PLOTTER *aPlotter, PCB_PLOT_PARAMS *aPlotOpts) |
Calculate the effective size of HPGL pens and set them in the plotter object. More... | |
PLOTTER * | StartPlotBoard (BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts, int aLayer, const wxString &aFullFileName, const wxString &aSheetDesc) |
Open a new plotfile using the options (and especially the format) specified in the options and prepare the page for plotting. More... | |
Variables | |
static const PCB_LAYER_ID | plot_seq [] |
Functions to plot one board layer (silkscreen layers or other layers).
Silkscreen layers have specific requirement for pads (not filled) and texts (with option to remove them from some copper areas (pads...)
Definition in file plot_board_layers.cpp.
#define NEW_ALGO 1 |
Definition at line 745 of file plot_board_layers.cpp.
|
static |
Calculate the effective size of HPGL pens and set them in the plotter object.
Definition at line 1045 of file plot_board_layers.cpp.
References PCB_PLOT_PARAMS::GetHPGLPenDiameter(), PCB_PLOT_PARAMS::GetHPGLPenNum(), PCB_PLOT_PARAMS::GetHPGLPenSpeed(), PCB_PLOT_PARAMS::GetScale(), IU_PER_MILS, KiROUND(), HPGL_PLOTTER::SetPenDiameter(), HPGL_PLOTTER::SetPenNumber(), and HPGL_PLOTTER::SetPenSpeed().
Referenced by StartPlotBoard().
Prefill in black an area a little bigger than the board to prepare for the negative plot.
Definition at line 1030 of file plot_board_layers.cpp.
References BLACK, FILLED_SHAPE, EDA_RECT::GetEnd(), EDA_RECT::GetOrigin(), EDA_RECT::Inflate(), IU_PER_MM, PLOTTER::Rect(), PLOTTER::SetColor(), PLOTTER::SetNegative(), and WHITE.
Referenced by StartPlotBoard().
|
static |
Set up most plot options for plotting a board (especially the viewport) Important thing: page size is the 'drawing' page size, paper size is the physical page size.
Definition at line 946 of file plot_board_layers.cpp.
References EDA_RECT::Centre(), BOARD::ComputeBoundingBox(), PCB_PLOT_PARAMS::GetA4Output(), PCB_PLOT_PARAMS::GetAutoScale(), BOARD::GetDesignSettings(), PCB_PLOT_PARAMS::GetGerberPrecision(), PCB_PLOT_PARAMS::GetMirror(), BOARD::GetPageSettings(), PCB_PLOT_PARAMS::GetScale(), EDA_RECT::GetSize(), PCB_PLOT_PARAMS::GetSvgPrecision(), PCB_PLOT_PARAMS::GetSvgUseInch(), PCB_PLOT_PARAMS::GetTextMode(), PCB_PLOT_PARAMS::GetUseAuxOrigin(), IU_PER_MILS, KiROUND(), BOARD_DESIGN_SETTINGS::m_AuxOrigin, PLOTTER::SetColorMode(), PLOTTER::SetCreator(), PLOTTER::SetGerberCoordinatesFormat(), PLOTTER::SetPageSettings(), PLOTTER::SetSvgCoordinatesFormat(), PLOTTER::SetTextMode(), and PLOTTER::SetViewport().
Referenced by StartPlotBoard().
void PlotLayerOutlines | ( | BOARD * | aBoard, |
PLOTTER * | aPlotter, | ||
LSET | aLayerMask, | ||
const PCB_PLOT_PARAMS & | aPlotOpt | ||
) |
Function PlotLayerOutlines plot copper outline of a copper layer.
aBoard | = the board to plot |
aPlotter | = the plotter to use |
aLayerMask | = the mask to define the layers to plot |
aPlotOpt | = the plot options. Has meaning for some formats only |
Definition at line 632 of file plot_board_layers.cpp.
References SEG::A, arrayDim(), SEG::B, SHAPE_POLY_SET::CHole(), PLOTTER::Circle(), BOARD::ConvertBrdLayerToPolygonalContours(), SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CPoint(), BOARD::Footprints(), ADVANCED_CFG::GetCfg(), PCB_PLOT_PARAMS::GetDrillMarksType(), VIA::GetDrillValue(), VIA::GetPosition(), SHAPE_SEGMENT::GetSeg(), SHAPE_SEGMENT::GetWidth(), SHAPE_POLY_SET::HoleCount(), VIA::IsOnLayer(), ADVANCED_CFG::m_SmallDrillMarkSize, PCB_PLOT_PARAMS::NO_DRILL_SHAPE, NO_FILL, NULL, SHAPE_POLY_SET::OutlineCount(), plot_seq, PLOTTER::PlotPoly(), SHAPE_POLY_SET::PM_FAST, SHAPE_LINE_CHAIN::PointCount(), SHAPE_POLY_SET::RemoveAllContours(), LSET::Seq(), BRDITEMS_PLOTTER::SetLayerSet(), SHAPE_POLY_SET::Simplify(), SKETCH, PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE, PLOTTER::ThickSegment(), and BOARD::Tracks().
Referenced by PlotOneBoardLayer().
void PlotOneBoardLayer | ( | BOARD * | aBoard, |
PLOTTER * | aPlotter, | ||
PCB_LAYER_ID | aLayer, | ||
const PCB_PLOT_PARAMS & | aPlotOpt | ||
) |
Function PlotOneBoardLayer main function to plot one copper or technical layer.
It prepare options and calls the specialized plot function, according to the layer type
aBoard | = the board to plot |
aPlotter | = the plotter to use |
aLayer | = the layer id to plot |
aPlotOpt | = the plot options (files, sketch). Has meaning for some formats only |
Definition at line 63 of file plot_board_layers.cpp.
References B_Adhes, B_CrtYd, B_Fab, B_Mask, B_Paste, B_SilkS, BLACK, Cmts_User, Dwgs_User, DXF, Eco1_User, Eco2_User, Edge_Cuts, F_Adhes, F_CrtYd, F_Fab, F_Mask, F_Paste, F_SilkS, GERBER, BOARD::GetDesignSettings(), PCB_PLOT_PARAMS::GetDXFPlotPolygonMode(), PCB_PLOT_PARAMS::GetExcludeEdgeLayer(), PCB_PLOT_PARAMS::GetFormat(), PLOTTER::GetPlotterType(), PCB_PLOT_PARAMS::GetSubtractMaskFromSilk(), PCB_PLOT_PARAMS::GetTextMode(), IsCopperLayer(), BOARD_DESIGN_SETTINGS::m_SolderMaskMinWidth, Margin, PCB_PLOT_PARAMS::NO_DRILL_SHAPE, PlotLayerOutlines(), PlotSolderMaskLayer(), PlotStandardLayer(), PLOTTER::SetColor(), PCB_PLOT_PARAMS::SetDrillMarksType(), PLOTTER::SetLayerPolarity(), PCB_PLOT_PARAMS::SetSkipPlotNPTH_Pads(), and PLOTTER::SetTextMode().
Referenced by DIALOG_EXPORT_SVG::CreateSVGFile(), DIALOG_PLOT::Plot(), and PLOT_CONTROLLER::PlotLayer().
|
static |
Definition at line 747 of file plot_board_layers.cpp.
References SHAPE_LINE_CHAIN::Area(), B_Cu, B_Mask, SHAPE_POLY_SET::BooleanAdd(), SHAPE_POLY_SET::BooleanSubtract(), SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CPoint(), SHAPE_POLY_SET::Deflate(), ERROR_OUTSIDE, F_Cu, F_Mask, FILLED_SHAPE, BOARD::Footprints(), SHAPE_POLY_SET::Fracture(), GetArcToSegmentCount(), BOARD::GetBoardPolygonOutlines(), BOARD::GetDesignSettings(), VIA::GetLayerSet(), PCB_PLOT_PARAMS::GetPlotViaOnMaskLayer(), SHAPE_POLY_SET::Inflate(), IU_PER_MM, BOARD_DESIGN_SETTINGS::m_MaxError, BOARD_DESIGN_SETTINGS::m_SolderMaskMargin, Millimeter2iu(), SHAPE_POLY_SET::OutlineCount(), PCB_FP_SHAPE_T, BRDITEMS_PLOTTER::PlotBoardGraphicItems(), BRDITEMS_PLOTTER::PlotFilledAreas(), BRDITEMS_PLOTTER::PlotFootprintGraphicItem(), BRDITEMS_PLOTTER::PlotFootprintTextItems(), PLOTTER::PlotPoly(), PlotStandardLayer(), SHAPE_POLY_SET::PM_FAST, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE, SHAPE_LINE_CHAIN::PointCount(), ZONE::SetLayer(), BRDITEMS_PLOTTER::SetLayerSet(), ZONE::SetMinThickness(), SHAPE_POLY_SET::Simplify(), BOARD::Tracks(), TRACK::TransformShapeWithClearanceToPolygon(), and BOARD::Zones().
Referenced by PlotOneBoardLayer().
void PlotStandardLayer | ( | BOARD * | aBoard, |
PLOTTER * | aPlotter, | ||
LSET | aLayerMask, | ||
const PCB_PLOT_PARAMS & | aPlotOpt | ||
) |
Function PlotStandardLayer plot copper or technical layers.
not used for silk screen layers, because these layers have specific requirements, mainly for pads
aBoard | = the board to plot |
aPlotter | = the plotter to use |
aLayerMask | = the mask to define the layers to plot |
aPlotOpt | = the plot options (files, sketch). Has meaning for some formats only |
aPlotOpt has 3 important options to control this plot, which are set, depending on the layer type to plot SetEnablePlotVia( bool aEnable ) aEnable = true to plot vias, false to skip vias (has meaning only for solder mask layers). SetSkipPlotNPTH_Pads( bool aSkip ) aSkip = true to skip NPTH Pads, when the pad size and the pad hole have the same size. Used in GERBER format only. SetDrillMarksType( DrillMarksType aVal ) controle the actual hole: no hole, small hole, actual hole
pads not connected to copper are optionally not drawn
Vias not connected to copper are optionally not drawn
Definition at line 206 of file plot_board_layers.cpp.
References SHAPE_POLY_SET::AddOutline(), LSET::AllCuMask(), SHAPE_POLY_SET::Append(), B_Cu, B_Fab, B_Mask, B_Paste, BLACK, color, PCB_PLOT_PARAMS::ColorSettings(), SHAPE_POLY_SET::CPolygon(), SHAPE_POLY_SET::DeletePolygon(), dummy(), PLOTTER::EndBlock(), F_Cu, F_Fab, F_Mask, F_Paste, VIA::FlashLayer(), PLOTTER::FlashPadCircle(), BOARD::Footprints(), GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONDUCTOR, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_VIAPAD, GBR_NETLIST_METADATA::GBR_NETINFO_NET, ARC::GetAngle(), ARC::GetArcAngleStart(), GetArcToSegmentCount(), ARC::GetCenter(), COLOR_SETTINGS::GetColor(), BRDITEMS_PLOTTER::getColor(), BOARD::GetDesignSettings(), PCB_PLOT_PARAMS::GetDrillMarksType(), BRDITEMS_PLOTTER::getFineWidthAdj(), VIA::GetLayerSet(), BOARD_CONNECTED_ITEM::GetNetname(), PCB_PLOT_PARAMS::GetPlotMode(), PCB_PLOT_PARAMS::GetPlotViaOnMaskLayer(), ARC::GetRadius(), PCB_PLOT_PARAMS::GetSketchPadsOnFabLayers(), PCB_PLOT_PARAMS::GetSkipPlotNPTH_Pads(), TRACK::GetStart(), VIA::GetViaType(), TRACK::GetWidth(), SHAPE_POLY_SET::InflateWithLinkedHoles(), SHAPE_POLY_SET::IsEmpty(), LAYER_PAD_BK, LAYER_PAD_FR, LAYER_VIAS, LIGHTGRAY, BOARD_DESIGN_SETTINGS::m_MaxError, GBR_METADATA::m_NetlistMetadata, GBR_NETLIST_METADATA::m_NotInNet, BOARD_DESIGN_SETTINGS::m_SolderMaskMargin, SHAPE_POLY_SET::NewOutline(), PCB_PLOT_PARAMS::NO_DRILL_SHAPE, NULL, SHAPE_POLY_SET::OutlineCount(), PAD_ATTRIB_NPTH, PAD_SHAPE_CHAMFERED_RECT, PAD_SHAPE_CIRCLE, PAD_SHAPE_CUSTOM, PAD_SHAPE_OVAL, PAD_SHAPE_RECT, PAD_SHAPE_ROUNDRECT, PAD_SHAPE_TRAPEZOID, PCB_ARC_T, PCB_VIA_T, BRDITEMS_PLOTTER::PlotBoardGraphicItems(), BRDITEMS_PLOTTER::PlotDrillMarks(), BRDITEMS_PLOTTER::PlotFilledAreas(), BRDITEMS_PLOTTER::PlotFootprintGraphicItems(), BRDITEMS_PLOTTER::PlotFootprintTextItems(), BRDITEMS_PLOTTER::PlotPad(), SHAPE_POLY_SET::PM_FAST, GBR_METADATA::SetApertureAttrib(), PLOTTER::SetColor(), BRDITEMS_PLOTTER::SetLayerSet(), GBR_METADATA::SetNetAttribType(), GBR_METADATA::SetNetName(), SKETCH, PLOTTER::StartBlock(), PLOTTER::ThickArc(), PLOTTER::ThickSegment(), BOARD::Tracks(), UNDEFINED_LAYER, WHITE, and BOARD::Zones().
Referenced by PlotOneBoardLayer(), and PlotSolderMaskLayer().
PLOTTER* StartPlotBoard | ( | BOARD * | aBoard, |
PCB_PLOT_PARAMS * | aPlotOpts, | ||
int | aLayer, | ||
const wxString & | aFullFileName, | ||
const wxString & | aSheetDesc | ||
) |
Open a new plotfile using the options (and especially the format) specified in the options and prepare the page for plotting.
Return the plotter object if OK, NULL if the file is not created (or has a problem)
Definition at line 1063 of file plot_board_layers.cpp.
References AddGerberX2Attribute(), PLOTTER::ClearHeaderLinesList(), PCB_PLOT_PARAMS::ColorSettings(), BOARD::ComputeBoundingBox(), ConfigureHPGLPenSizes(), GERBER_PLOTTER::DisableApertMacros(), DXF, FillNegativeKnockout(), GERBER, PCB_PLOT_PARAMS::GetDisableGerberMacros(), PCB_PLOT_PARAMS::GetDXFPlotUnits(), BOARD::GetFileName(), PCB_PLOT_PARAMS::GetFineScaleAdjustX(), PCB_PLOT_PARAMS::GetFineScaleAdjustY(), PCB_PLOT_PARAMS::GetFormat(), PCB_PLOT_PARAMS::GetIncludeGerberNetlistInfo(), PCB_PLOT_PARAMS::GetMirror(), PCB_PLOT_PARAMS::GetNegative(), BOARD::GetPageSettings(), PCB_PLOT_PARAMS::GetPlotFrameRef(), PLOTTER::GetPlotterType(), BOARD::GetProject(), BOARD::GetTitleBlock(), PCB_PLOT_PARAMS::GetUseGerberX2format(), HPGL, initializePlotter(), KIGFX::PCB_RENDER_SETTINGS::LoadColors(), Millimeter2iu(), NULL, PLOTTER::OpenFile(), PDF, PlotDrawingSheet(), POST, PLOTTER::RenderSettings(), KIGFX::RENDER_SETTINGS::SetDefaultPenWidth(), PCB_PLOT_PARAMS::SetMirror(), PLOTTER::SetRenderSettings(), PSLIKE_PLOTTER::SetScaleAdjust(), DXF_PLOTTER::SetUnits(), PLOTTER::StartPlot(), SVG, GERBER_PLOTTER::UseX2format(), and GERBER_PLOTTER::UseX2NetAttributes().
Referenced by DIALOG_EXPORT_SVG::CreateSVGFile(), PLOT_CONTROLLER::OpenPlotfile(), and DIALOG_PLOT::Plot().
|
static |
Definition at line 571 of file plot_board_layers.cpp.
Referenced by PlotLayerOutlines().