Crate gerber_types [] [src]

Gerber commands

This crate implements the basic building blocks of Gerber (RS-274X, aka Extended Gerber version 2) code. It focusses on the low level types and does not do any semantic checking.

For example, you can use an aperture without defining it. This will generate syntactically valid but semantially invalid Gerber code, but this module won't complain.

Minimal required Rust version: 1.6.

Newlines in Code Generation

By default, types implementing GerberCode don't output a newline at the end. An exception is the impl for Vec<Command>, which outputs a newline between two following commands. No newline is emitted after the last command.

Structs

ApertureDefinition
ApertureMacro
CenterLinePrimitive
Circle
CirclePrimitive
CoordinateFormat

The coordinate format specifies the number of integer and decimal places in a coordinate number. For example, the 24 format specifies 2 integer and 4 decimal places. The number of decimal places must be 4, 5 or 6. The number of integer places must be not more than 6. Thus the longest representable coordinate number is nnnnnn.nnnnnn.

CoordinateNumber

Coordinate numbers are integers conforming to the rules set by the FS command.

CoordinateOffset

Coordinate offsets can be used for interpolate operations in circular interpolation mode.

Coordinates

Coordinates are part of an operation.

GenerationSoftware
MoirePrimitive

The moiré primitive is a cross hair centered on concentric rings (annuli). Exposure is always on.

OutlinePrimitive
Polygon
PolygonPrimitive

A polygon primitive is a regular polygon defined by the number of vertices, the center point and the diameter of the circumscribed circle.

Rectangular
ThermalPrimitive

The thermal primitive is a ring (annulus) interrupted by four gaps. Exposure is always on.

VariableDefinition
VectorLinePrimitive

Enums

Aperture
ApertureAttribute
ApertureFunction
Command
CopperType
DCode
Drill
DrillFunction
DrillRouteType
ExtendedCode
ExtendedPosition
FiducialScope
FileAttribute
FileFunction
FilePolarity
FunctionCode
GCode
GerberError
InterpolationMode
MCode
MacroContent
MacroDecimal

A macro decimal can either be an f64 or a variable placeholder.

Operation
Part
Polarity
Position
Profile
QuadrantMode
SmdPadType
StepAndRepeat
Unit

Traits

GerberCode

All types that implement this trait can be converted to Gerber Code.

Type Definitions

GerberResult