Documented the output formats in the source code.
This commit is contained in:
parent
cb809cbb8d
commit
89fb93d6d7
|
|
@ -3,6 +3,7 @@ from pcbnew import (PLOT_FORMAT_HPGL, PLOT_FORMAT_POST, PLOT_FORMAT_GERBER, PLOT
|
|||
PLOT_FORMAT_PDF, wxPoint)
|
||||
from .out_base import BaseOutput
|
||||
from .error import KiPlotConfigurationError
|
||||
from kiplot.macros import macros, document # noqa: F401
|
||||
from . import log
|
||||
|
||||
logger = log.get_logger(__name__)
|
||||
|
|
@ -12,9 +13,13 @@ class AnyDrill(BaseOutput):
|
|||
def __init__(self, name, type, description):
|
||||
super(AnyDrill, self).__init__(name, type, description)
|
||||
# Options
|
||||
self.use_aux_axis_as_origin = False
|
||||
self._map = None
|
||||
self._report = None
|
||||
with document:
|
||||
self.use_aux_axis_as_origin = False
|
||||
""" use the auxiliar axis as origin for coordinates """
|
||||
self._map = None
|
||||
""" this is an optional subsection to indicate the format for a graphical drill map. The valid formats are hpgl, ps, gerber, dxf, svg and pdf. """
|
||||
self._report = None
|
||||
""" this is an optional subsection to indicate the name of the drill report """
|
||||
# Mappings to KiCad values
|
||||
self._map_map = {
|
||||
'hpgl': PLOT_FORMAT_HPGL,
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ from pcbnew import (GERBER_JOBFILE_WRITER, PCB_PLOT_PARAMS, FromMM, PLOT_CONTROL
|
|||
from .out_base import (BaseOutput)
|
||||
from .error import (PlotError, KiPlotConfigurationError)
|
||||
from .kiplot import (GS)
|
||||
from kiplot.macros import macros, document # noqa: F401
|
||||
from . import log
|
||||
|
||||
logger = log.get_logger(__name__)
|
||||
|
|
@ -13,13 +14,21 @@ class AnyLayer(BaseOutput):
|
|||
def __init__(self, name, type, description):
|
||||
super(AnyLayer, self).__init__(name, type, description)
|
||||
# Options
|
||||
self.exclude_edge_layer = True
|
||||
self.exclude_pads_from_silkscreen = False
|
||||
self.plot_sheet_reference = False
|
||||
self.plot_footprint_refs = True
|
||||
self.plot_footprint_values = True
|
||||
self.force_plot_invisible_refs_vals = False
|
||||
self.tent_vias = True
|
||||
with document:
|
||||
self.exclude_edge_layer = True
|
||||
""" do not include the PCB edge layer """
|
||||
self.exclude_pads_from_silkscreen = False
|
||||
""" do not plot the component pads in the silk screen """
|
||||
self.plot_sheet_reference = False
|
||||
""" currently without effect """
|
||||
self.plot_footprint_refs = True
|
||||
""" include the footprint references """
|
||||
self.plot_footprint_values = True
|
||||
""" include the footprint values """
|
||||
self.force_plot_invisible_refs_vals = False
|
||||
""" include references and values even when they are marked as invisible """
|
||||
self.tent_vias = True
|
||||
""" the vias """
|
||||
self.check_zone_fills = True
|
||||
# Mappings to KiCad values
|
||||
self._drill_marks_map = {
|
||||
|
|
|
|||
|
|
@ -2,17 +2,26 @@ from pcbnew import PLOT_FORMAT_DXF
|
|||
from .error import KiPlotConfigurationError
|
||||
from .out_base import (BaseOutput)
|
||||
from .out_any_layer import (AnyLayer)
|
||||
from kiplot.macros import macros, document # noqa: F401
|
||||
|
||||
|
||||
class DXF(AnyLayer):
|
||||
"""
|
||||
DXF (Drawing Exchange Format)
|
||||
Exports the PCB to 2D mechanical EDA tools (like AutoCAD).
|
||||
This output is what you get from the File/Plot menu in pcbnew. """
|
||||
def __init__(self, name, type, description):
|
||||
super(DXF, self).__init__(name, type, description)
|
||||
self._plot_format = PLOT_FORMAT_DXF
|
||||
# Options
|
||||
self.use_aux_axis_as_origin = False
|
||||
self._drill_marks = 'full'
|
||||
self.polygon_mode = True
|
||||
self.sketch_plot = True
|
||||
with document:
|
||||
self.use_aux_axis_as_origin = False
|
||||
""" use the auxiliar axis as origin for coordinates """
|
||||
self._drill_marks = 'full'
|
||||
""" drill_marks what to use to indicate the drill places, can be none, small or full (for real scale) """
|
||||
self.polygon_mode = True
|
||||
""" plot using the contour, instead of the center line """
|
||||
self.sketch_plot = True
|
||||
|
||||
@property
|
||||
def drill_marks(self):
|
||||
|
|
|
|||
|
|
@ -1,15 +1,25 @@
|
|||
from pcbnew import (EXCELLON_WRITER)
|
||||
from .out_base import (BaseOutput)
|
||||
from .out_any_drill import (AnyDrill)
|
||||
from kiplot.macros import macros, document # noqa: F401
|
||||
|
||||
|
||||
class Excellon(AnyDrill):
|
||||
""" Excellon drill format
|
||||
This is the main format for the drilling machine.
|
||||
You can create a map file for documentation purposes.
|
||||
This output is what you get from the 'File/Fabrication output/Drill Files' menu in pcbnew. """
|
||||
def __init__(self, name, type, description):
|
||||
super(Excellon, self).__init__(name, type, description)
|
||||
self.metric_units = True
|
||||
self.pth_and_npth_single_file = True
|
||||
self.minimal_header = False
|
||||
self.mirror_y_axis = False
|
||||
with document:
|
||||
self.metric_units = True
|
||||
""" use metric units instead of inches. """
|
||||
self.pth_and_npth_single_file = True
|
||||
""" generate one file for both, plated holes and non-plated holes, instead of two separated files. """
|
||||
self.minimal_header = False
|
||||
""" use a minimal header in the file """
|
||||
self.mirror_y_axis = False
|
||||
""" invert the Y axis """
|
||||
|
||||
def _configure_writer(self, board, offset):
|
||||
drill_writer = EXCELLON_WRITER(board)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,10 @@ from .out_any_drill import (AnyDrill)
|
|||
|
||||
|
||||
class GerbDrill(AnyDrill):
|
||||
""" Gerber drill format
|
||||
This is the information for the drilling machine in gerber format.
|
||||
You can create a map file for documentation purposes.
|
||||
This output is what you get from the 'File/Fabrication output/Drill Files' menu in pcbnew. """
|
||||
def __init__(self, name, type, description):
|
||||
super(GerbDrill, self).__init__(name, type, description)
|
||||
|
||||
|
|
|
|||
|
|
@ -6,20 +6,30 @@ from kiplot.macros import macros, document # noqa: F401
|
|||
|
||||
|
||||
class Gerber(AnyLayer):
|
||||
""" Gerber format
|
||||
This is the main fabrication format for the PCB.
|
||||
This output is what you get from the File/Plot menu in pcbnew. """
|
||||
def __init__(self, name, type, description):
|
||||
super(Gerber, self).__init__(name, type, description)
|
||||
self._plot_format = PLOT_FORMAT_GERBER
|
||||
# Options
|
||||
with document:
|
||||
self.use_aux_axis_as_origin = False
|
||||
""" Auxiliar origin """
|
||||
""" use the auxiliar axis as origin for coordinates """
|
||||
self.line_width = 0.1
|
||||
""" line_width for objects without width [mm] """
|
||||
self.subtract_mask_from_silk = False
|
||||
""" substract the solder mask from the silk screen """
|
||||
self.use_protel_extensions = False
|
||||
""" use legacy Protel file extensions """
|
||||
self._gerber_precision = 4.6
|
||||
""" this the gerber coordinate format, can be 4.5 or 4.6 """
|
||||
self.create_gerber_job_file = True
|
||||
""" creates a file with information about all the generated gerbers. You can use it in gerbview to load all gerbers at once. """
|
||||
self.use_gerber_x2_attributes = True
|
||||
""" use the extended X2 format """
|
||||
self.use_gerber_net_attributes = True
|
||||
""" include netlist metadata """
|
||||
# print("Help for self.use_aux_axis_as_origin: "+self._help_use_aux_axis_as_origin)
|
||||
|
||||
@property
|
||||
|
|
|
|||
|
|
@ -2,19 +2,27 @@ from pcbnew import (PLOT_FORMAT_HPGL)
|
|||
from .out_base import (BaseOutput)
|
||||
from .out_any_layer import (AnyLayer)
|
||||
from .error import KiPlotConfigurationError
|
||||
from kiplot.macros import macros, document # noqa: F401
|
||||
|
||||
|
||||
class HPGL(AnyLayer):
|
||||
""" HPGL (Hewlett & Packard Graphics Language)
|
||||
Exports the PCB for plotters and laser printers.
|
||||
This output is what you get from the File/Plot menu in pcbnew. """
|
||||
def __init__(self, name, type, description):
|
||||
super(HPGL, self).__init__(name, type, description)
|
||||
self._plot_format = PLOT_FORMAT_HPGL
|
||||
# Options
|
||||
self.mirror_plot = False
|
||||
self.sketch_plot = True
|
||||
self.scaling = 0
|
||||
self._drill_marks = 'full'
|
||||
self.pen_width = 0.5
|
||||
|
||||
with document:
|
||||
self.mirror_plot = False
|
||||
""" plot mirrored """
|
||||
self.sketch_plot = True
|
||||
self.scaling = 0
|
||||
""" scale factor """
|
||||
self._drill_marks = 'full'
|
||||
""" what to use to indicate the drill places, can be none, small or full (for real scale) """
|
||||
self.pen_width = 0.5
|
||||
""" default trace width """
|
||||
@property
|
||||
def drill_marks(self):
|
||||
return self._drill_marks
|
||||
|
|
|
|||
|
|
@ -3,18 +3,26 @@ from subprocess import (check_output, STDOUT, CalledProcessError)
|
|||
from .out_base import (BaseOutput)
|
||||
from .misc import (CMD_IBOM, URL_IBOM, BOM_ERROR)
|
||||
from .kiplot import (GS, check_script)
|
||||
from kiplot.macros import macros, document # noqa: F401
|
||||
from . import log
|
||||
|
||||
logger = log.get_logger(__name__)
|
||||
|
||||
|
||||
class IBoM(BaseOutput):
|
||||
""" IBoM (Interactive HTML BoM)
|
||||
Generates an interactive web page useful to identify the position of the components in the PCB.
|
||||
For more information: https://github.com/INTI-CMNB/InteractiveHtmlBom
|
||||
This output is what you get from the InteractiveHtmlBom plug-in (pcbnew). """
|
||||
def __init__(self, name, type, description):
|
||||
super(IBoM, self).__init__(name, type, description)
|
||||
self._sch_related = True
|
||||
# Options
|
||||
self.blacklist = ''
|
||||
self.name_format = ''
|
||||
with document:
|
||||
self.blacklist = ''
|
||||
""" regular expression for the components to exclude (using the Config field) """
|
||||
self.name_format = 'ibom.html'
|
||||
""" format of the output name, example: %f_%r_iBoM will generate a file with revision and _iBoM. """
|
||||
|
||||
def run(self, output_dir, board):
|
||||
check_script(CMD_IBOM, URL_IBOM)
|
||||
|
|
|
|||
|
|
@ -5,17 +5,24 @@ from .out_base import (BaseOutput)
|
|||
from .error import KiPlotConfigurationError
|
||||
from .misc import (CMD_KIBOM, URL_KIBOM, BOM_ERROR)
|
||||
from .kiplot import (GS, check_script)
|
||||
from kiplot.macros import macros, document # noqa: F401
|
||||
from . import log
|
||||
|
||||
logger = log.get_logger(__name__)
|
||||
|
||||
|
||||
class KiBoM(BaseOutput):
|
||||
""" KiBoM (KiCad Bill of Materials)
|
||||
Used to generate the BoM in HTML or CSV format using the KiBoM plug-in.
|
||||
For more information: https://github.com/INTI-CMNB/KiBoM
|
||||
This output is what you get from the 'Tools/Generate Bill of Materials' menu in eeschema. """
|
||||
def __init__(self, name, type, description):
|
||||
super(KiBoM, self).__init__(name, type, description)
|
||||
self._sch_related = True
|
||||
# Options
|
||||
self._format = 'HTML'
|
||||
with document:
|
||||
self._format = 'HTML'
|
||||
""" can be HTML or CSV. """
|
||||
|
||||
@property
|
||||
def format(self):
|
||||
|
|
|
|||
|
|
@ -2,17 +2,27 @@ from pcbnew import PLOT_FORMAT_PDF
|
|||
from .out_base import BaseOutput
|
||||
from .out_any_layer import AnyLayer
|
||||
from .error import KiPlotConfigurationError
|
||||
from kiplot.macros import macros, document # noqa: F401
|
||||
|
||||
|
||||
class PDF(AnyLayer):
|
||||
""" PDF (Portable Document Format)
|
||||
Exports the PCB to the most common exhange format. Suitable for printing.
|
||||
Note that this output isn't the best for documating your project.
|
||||
This output is what you get from the File/Plot menu in pcbnew. """
|
||||
def __init__(self, name, type, description):
|
||||
super(PDF, self).__init__(name, type, description)
|
||||
self._plot_format = PLOT_FORMAT_PDF
|
||||
# Options
|
||||
self.line_width = 0.1
|
||||
self.mirror_plot = False
|
||||
self.negative_plot = False
|
||||
self._drill_marks = 'full'
|
||||
with document:
|
||||
self.line_width = 0.1
|
||||
""" for objects without width [mm] """
|
||||
self.mirror_plot = False
|
||||
""" plot mirrored """
|
||||
self.negative_plot = False
|
||||
""" invert black and white """
|
||||
self._drill_marks = 'full'
|
||||
""" what to use to indicate the drill places, can be none, small or full (for real scale) """
|
||||
|
||||
@property
|
||||
def drill_marks(self):
|
||||
|
|
|
|||
|
|
@ -4,16 +4,23 @@ from .pre_base import BasePreFlight
|
|||
from .error import (KiPlotConfigurationError, PlotError)
|
||||
from .kiplot import (check_script, GS)
|
||||
from .misc import (CMD_PCBNEW_PRINT_LAYERS, URL_PCBNEW_PRINT_LAYERS, PDF_PCB_PRINT)
|
||||
from kiplot.macros import macros, document # noqa: F401
|
||||
from . import log
|
||||
|
||||
logger = log.get_logger(__name__)
|
||||
|
||||
|
||||
class PDFPcbPrint(BaseOutput):
|
||||
""" PDF PCB Print (Portable Document Format)
|
||||
Exports the PCB to the most common exhange format. Suitable for printing.
|
||||
This is the main format to document your PCB.
|
||||
This output is what you get from the 'File/Print' menu in pcbnew. """
|
||||
def __init__(self, name, type, description):
|
||||
super(PDFPcbPrint, self).__init__(name, type, description)
|
||||
# Options
|
||||
self.output_name = 'pdf_pcb_print.pdf'
|
||||
with document:
|
||||
self.output_name = 'pdf_pcb_print.pdf'
|
||||
""" filename for the output PDF """
|
||||
|
||||
def config(self, outdir, options, layers):
|
||||
super().config(outdir, options, layers)
|
||||
|
|
|
|||
|
|
@ -3,17 +3,24 @@ from subprocess import (call)
|
|||
from .out_base import BaseOutput
|
||||
from .kiplot import (check_eeschema_do, GS)
|
||||
from .misc import (CMD_EESCHEMA_DO, PDF_SCH_PRINT)
|
||||
from kiplot.macros import macros, document # noqa: F401
|
||||
from . import log
|
||||
|
||||
logger = log.get_logger(__name__)
|
||||
|
||||
|
||||
class PDFSchPrint(BaseOutput):
|
||||
""" PDF Schematic Print (Portable Document Format)
|
||||
Exports the PCB to the most common exhange format. Suitable for printing.
|
||||
This is the main format to document your schematic.
|
||||
This output is what you get from the 'File/Print' menu in eeschema. """
|
||||
def __init__(self, name, type, description):
|
||||
super(PDFSchPrint, self).__init__(name, type, description)
|
||||
self._sch_related = True
|
||||
# Options
|
||||
self.output = ''
|
||||
with document:
|
||||
self.output = ''
|
||||
""" filename for the output PDF """
|
||||
|
||||
def run(self, output_dir, board):
|
||||
check_eeschema_do()
|
||||
|
|
|
|||
|
|
@ -4,16 +4,25 @@ from datetime import datetime
|
|||
from pcbnew import (IU_PER_MM, IU_PER_MILS)
|
||||
from .out_base import BaseOutput
|
||||
from .error import KiPlotConfigurationError
|
||||
from kiplot.macros import macros, document # noqa: F401
|
||||
|
||||
|
||||
class Position(BaseOutput):
|
||||
""" Pick & place
|
||||
Generates the file with position information for the PCB components, used by the pick and place machine.
|
||||
This output is what you get from the 'File/Fabrication output/Footprint poistion (.pos) file' menu in pcbnew. """
|
||||
def __init__(self, name, type, description):
|
||||
super(Position, self).__init__(name, type, description)
|
||||
# Options
|
||||
self._format = 'ASCII'
|
||||
self.separate_files_for_front_and_back = True
|
||||
self.only_smd = True
|
||||
self._units = 'millimeters'
|
||||
with document:
|
||||
self._format = 'ASCII'
|
||||
""" can be ASCII or CSV. """
|
||||
self.separate_files_for_front_and_back = True
|
||||
""" generate two separated files, one for the top and another for the bottom. """
|
||||
self.only_smd = True
|
||||
""" only include the surface mount components. """
|
||||
self._units = 'millimeters'
|
||||
""" can be millimeters or inches. """
|
||||
|
||||
@property
|
||||
def format(self):
|
||||
|
|
|
|||
|
|
@ -2,23 +2,36 @@ from pcbnew import PLOT_FORMAT_POST
|
|||
from .out_base import BaseOutput
|
||||
from .out_any_layer import AnyLayer
|
||||
from .error import KiPlotConfigurationError
|
||||
from kiplot.macros import macros, document # noqa: F401
|
||||
|
||||
|
||||
class PS(AnyLayer):
|
||||
""" PS (Postscript)
|
||||
Exports the PCB to a format suitable for printing.
|
||||
This output is what you get from the File/Plot menu in pcbnew. """
|
||||
def __init__(self, name, type, description):
|
||||
super(PS, self).__init__(name, type, description)
|
||||
self._plot_format = PLOT_FORMAT_POST
|
||||
# Options
|
||||
self.line_width = 0.15
|
||||
self.mirror_plot = False
|
||||
self.negative_plot = False
|
||||
self.sketch_plot = True
|
||||
self.scaling = 2
|
||||
self._drill_marks = 'full'
|
||||
self.scale_adjust_x = 1.0
|
||||
self.scale_adjust_y = 1.0
|
||||
self.width_adjust = 0
|
||||
self.a4_output = True
|
||||
with document:
|
||||
self.line_width = 0.15
|
||||
""" for objects without width [mm] """
|
||||
self.mirror_plot = False
|
||||
""" plot mirrored """
|
||||
self.negative_plot = False
|
||||
""" invert black and white """
|
||||
self.sketch_plot = True
|
||||
self.scaling = 2
|
||||
""" scale factor """
|
||||
self._drill_marks = 'full'
|
||||
""" what to use to indicate the drill places, can be none, small or full (for real scale) """
|
||||
self.scale_adjust_x = 1.0
|
||||
""" fine grain adjust for the X scale (floating point multiplier) """
|
||||
self.scale_adjust_y = 1.0
|
||||
""" fine grain adjust for the Y scale (floating point multiplier) """
|
||||
self.width_adjust = 0
|
||||
self.a4_output = True
|
||||
""" force A4 paper size """
|
||||
|
||||
@property
|
||||
def drill_marks(self):
|
||||
|
|
|
|||
|
|
@ -5,20 +5,31 @@ from .out_base import BaseOutput
|
|||
from .error import KiPlotConfigurationError
|
||||
from .misc import (KICAD2STEP, KICAD2STEP_ERR)
|
||||
from .kiplot import (GS)
|
||||
from kiplot.macros import macros, document # noqa: F401
|
||||
from . import log
|
||||
|
||||
logger = log.get_logger(__name__)
|
||||
|
||||
|
||||
class STEP(BaseOutput):
|
||||
""" STEP (ISO 10303-21 Clear Text Encoding of the Exchange Structure)
|
||||
Exports the PCB as a 3D model.
|
||||
This is the most common 3D format for exchange purposes.
|
||||
This output is what you get from the 'File/Export/STEP' menu in pcbnew. """
|
||||
def __init__(self, name, type, description):
|
||||
super(STEP, self).__init__(name, type, description)
|
||||
# Options
|
||||
self.metric_units = True
|
||||
self._origin = 'grid'
|
||||
self.no_virtual = False # exclude 3D models for components with 'virtual' attribute
|
||||
self.min_distance = -1 # Minimum distance between points to treat them as separate ones (default 0.01 mm)
|
||||
self.output = ''
|
||||
with document:
|
||||
self.metric_units = True
|
||||
""" use metric units instead of inches. """
|
||||
self._origin = 'grid'
|
||||
""" determines the coordinates origin. Using grid the coordinates are the same as you have in the design sheet. The drill option uses the auxiliar reference defined by the user. You can define any other origin using the format 'X,Y', i.e. '3.2,-10'. """
|
||||
self.no_virtual = False
|
||||
""" used to exclude 3D models for components with 'virtual' attribute. """
|
||||
self.min_distance = -1
|
||||
""" the minimum distance between points to treat them as separate ones. (-1 id KiCad default: 0.01 mm) """
|
||||
self.output = ''
|
||||
""" name for the generated STEP file. """
|
||||
|
||||
@property
|
||||
def origin(self):
|
||||
|
|
|
|||
|
|
@ -2,17 +2,27 @@ from pcbnew import PLOT_FORMAT_SVG
|
|||
from .out_base import BaseOutput
|
||||
from .out_any_layer import AnyLayer
|
||||
from .error import KiPlotConfigurationError
|
||||
from kiplot.macros import macros, document # noqa: F401
|
||||
|
||||
|
||||
class SVG(AnyLayer):
|
||||
""" SVG (Scalable Vector Graphics)
|
||||
Exports the PCB to a format suitable for 2D graphics software.
|
||||
Unlike bitmaps SVG drawings can be scaled without losing resolution.
|
||||
This output is what you get from the File/Plot menu in pcbnew. """
|
||||
def __init__(self, name, type, description):
|
||||
super(SVG, self).__init__(name, type, description)
|
||||
self._plot_format = PLOT_FORMAT_SVG
|
||||
# Options
|
||||
self.line_width = 0.25
|
||||
self.mirror_plot = False
|
||||
self.negative_plot = False
|
||||
self._drill_marks = 'full'
|
||||
with document:
|
||||
self.line_width = 0.25
|
||||
""" for objects without width [mm] """
|
||||
self.mirror_plot = False
|
||||
""" plot mirrored """
|
||||
self.negative_plot = False
|
||||
""" invert black and white """
|
||||
self._drill_marks = 'full'
|
||||
""" what to use to indicate the drill places, can be none, small or full (for real scale) """
|
||||
|
||||
@property
|
||||
def drill_marks(self):
|
||||
|
|
|
|||
Loading…
Reference in New Issue