LibrePCB Developers Documentation
|
A helper class to generate the aperture definitions for a Gerber file. More...
#include <gerberaperturelist.h>
Public Types | |
using | Function = std::optional< GerberAttribute::ApertureFunction > |
Public Member Functions | |
GerberApertureList () noexcept | |
GerberApertureList (const GerberApertureList &other)=delete | |
~GerberApertureList () noexcept | |
QString | generateString () const noexcept |
Generate the aperture definitions string. | |
int | addCircle (const UnsignedLength &dia, Function function) |
Add a circle aperture. | |
int | addObround (const PositiveLength &w, const PositiveLength &h, const Angle &rot, Function function) noexcept |
Add an obround aperture. | |
int | addRect (const PositiveLength &w, const PositiveLength &h, const UnsignedLength &r, const Angle &rot, Function function) noexcept |
Add a rectangular aperture. | |
int | addOctagon (const PositiveLength &w, const PositiveLength &h, const UnsignedLength &r, const Angle &rot, Function function) noexcept |
Add an octagon aperture. | |
int | addOutline (const StraightAreaPath &path, const Angle &rot, Function function) noexcept |
Add a custom outline aperture. | |
int | addComponentMain () noexcept |
Add a component main aperture (for component layers only) | |
int | addComponentPin (bool isPin1) noexcept |
Add a component pin aperture (for component layers only) | |
GerberApertureList & | operator= (const GerberApertureList &rhs)=delete |
Private Member Functions | |
int | addOutline (const QString &name, const Path &path, const Angle &rot, Function function) noexcept |
Add a custom outline aperture. | |
QString | buildOutlineMacro (Path path, const Angle &rot) const noexcept |
Internal helper for addOutline() | |
int | addAperture (QString aperture, Function function) noexcept |
Helper method to actually add a new or get an existing aperture. | |
Private Attributes | |
QMap< int, std::pair< Function, QString > > | mApertures |
A helper class to generate the aperture definitions for a Gerber file.
The class provides methods to add certain apertures. Identical Apertures are added only once, i.e. if you call addCircle() multiple times with a diameter of 1mm, only one circle aperture of 1mm is created.
In addition, methods will always create the most simple aperture which represents the desired image. For example, if you call addObround() with both width and height set to the same value, a circle aperture is added instead of an obround (and the rotation parameter is ignored).
using Function = std::optional<GerberAttribute::ApertureFunction> |
|
noexcept |
|
delete |
|
noexcept |
|
noexcept |
Generate the aperture definitions string.
int addCircle | ( | const UnsignedLength & | dia, |
Function | function | ||
) |
Add a circle aperture.
dia | Circle diameter. According Gerber specs, it's allowed to create a circle with a diameter of zero. |
function | Function attribute. |
|
noexcept |
Add an obround aperture.
w | Total width. |
h | Total height. |
rot | Rotation. |
function | Function attribute. |
|
noexcept |
Add a rectangular aperture.
w | Width. |
h | Height. |
r | Corner radius. |
rot | Rotation. |
function | Function attribute. |
|
noexcept |
Add an octagon aperture.
w | Width. |
h | Height. |
r | Corner radius. |
rot | Rotation. |
function | Function attribute. |
|
noexcept |
Add a custom outline aperture.
path | The vertices. |
rot | Rotation. |
function | Function attribute. |
|
noexcept |
Add a component main aperture (for component layers only)
|
noexcept |
Add a component pin aperture (for component layers only)
isPin1 | Whether the aperture is for pin 1 or another pin. |
|
delete |
|
privatenoexcept |
Add a custom outline aperture.
name | Macro name (use only characters A..Z!). |
path | The vertices. ATTENTION: After closing the path, it must contain at least 4 vertices and it must not contain any arc segment (i.e. all angles must be zero)!!! |
rot | Rotation. |
function | Function attribute. |
Internal helper for addOutline()
path | The vertices. ATTENTION: After closing the path, it must contain at least 4 vertices and it must not contain any arc segment (i.e. all angles must be zero)!!! |
rot | Rotation. |
|
privatenoexcept |
Helper method to actually add a new or get an existing aperture.
aperture | The full content of the aperture to add (except the X2 attributes). |
function | Function attribute. |
|
private |
Added apertures