KiCad PCB EDA Suite
Loading...
Searching...
No Matches
gbr_plotter_aperture_macros.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2020 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
26#pragma once
27
28// A aperture macro to define a rounded rect pad shape
29// In many gerber readers, the rotation of the full shape is broken
30// so we are using primitives that does not need a rotation around aperture origin.
31// Note also the primitive 1 (circle) can use 4 or 5 parameters
32// the 5th parameter is the rotation (not used by Kicad ) around aperture origin and is
33// a recent optional parameter and can create compatibility issues with old
34// Gerber viewer, so it is not output (default = 0).
35
36#define APER_MACRO_ROUNDRECT_NAME "RoundRect"
37
38#define APER_MACRO_ROUNDRECT_HEADER \
39"%AMRoundRect*\n\
400 Rectangle with rounded corners*\n\
410 $1 Rounding radius*\n\
420 $2 $3 $4 $5 $6 $7 $8 $9 X,Y pos of 4 corners*\n\
430 Add a 4 corners polygon primitive as box body*\n\
444,1,4,$2,$3,$4,$5,$6,$7,$8,$9,$2,$3,0*\n\
450 Add four circle primitives for the rounded corners*\n\
461,1,$1+$1,$2,$3*\n\
471,1,$1+$1,$4,$5*\n\
481,1,$1+$1,$6,$7*\n\
491,1,$1+$1,$8,$9*\n\
500 Add four rect primitives between the rounded corners*\n\
5120,1,$1+$1,$2,$3,$4,$5,0*\n\
5220,1,$1+$1,$4,$5,$6,$7,0*\n\
5320,1,$1+$1,$6,$7,$8,$9,0*\n\
5420,1,$1+$1,$8,$9,$2,$3,0*\
55%\n"
56
57// A aperture macro to define a rotated rect pad shape
58#define APER_MACRO_ROT_RECT_NAME "RotRect"
59
60#define APER_MACRO_ROT_RECT_HEADER \
61"%AMRotRect*\n\
620 Rectangle, with rotation*\n\
630 The origin of the aperture is its center*\n\
640 $1 length*\n\
650 $2 width*\n\
660 $3 Rotation angle, in degrees counterclockwise*\n\
670 Add horizontal line*\n\
6821,1,$1,$2,0,0,$3*%\n"
69
70
71// A aperture macro to define a oval pad shape
72// In many gerber readers, the rotation of the full shape is broken
73// so we are using a primitive that does not need a rotation to be
74// plotted
75#define APER_MACRO_SHAPE_OVAL_NAME "HorizOval"
76
77#define APER_MACRO_SHAPE_OVAL_HEADER \
78"%AMHorizOval*\n\
790 Thick line with rounded ends*\n\
800 $1 width*\n\
810 $2 $3 position (X,Y) of the first rounded end (center of the circle)*\n\
820 $4 $5 position (X,Y) of the second rounded end (center of the circle)*\n\
830 Add line between two ends*\n\
8420,1,$1,$2,$3,$4,$5,0*\n\
850 Add two circle primitives to create the rounded ends*\n\
861,1,$1,$2,$3*\n\
871,1,$1,$4,$5*%\n"
88
89// A aperture macro to define a trapezoid (polygon) by 4 corners
90// and a rotation angle
91#define APER_MACRO_OUTLINE4P_NAME "Outline4P"
92
93#define APER_MACRO_OUTLINE4P_HEADER \
94"%AMOutline4P*\n\
950 Free polygon, 4 corners , with rotation*\n\
960 The origin of the aperture is its center*\n\
970 number of corners: always 4*\n\
980 $1 to $8 corner X, Y*\n\
990 $9 Rotation angle, in degrees counterclockwise*\n\
1000 create outline with 4 corners*\n\
1014,1,4,$1,$2,$3,$4,$5,$6,$7,$8,$1,$2,$9*%\n"
102
103// A aperture macro to define a polygon by 5 corners
104// and a rotation angle (useful for chamfered rect pads)
105#define APER_MACRO_OUTLINE5P_NAME "Outline5P"
106
107#define APER_MACRO_OUTLINE5P_HEADER \
108"%AMOutline5P*\n\
1090 Free polygon, 5 corners , with rotation*\n\
1100 The origin of the aperture is its center*\n\
1110 number of corners: always 5*\n\
1120 $1 to $10 corner X, Y*\n\
1130 $11 Rotation angle, in degrees counterclockwise*\n\
1140 create outline with 5 corners*\n\
1154,1,5,$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$1,$2,$11*%\n"
116
117// A aperture macro to define a polygon by 6 corners
118// and a rotation angle (useful for chamfered rect pads)
119#define APER_MACRO_OUTLINE6P_NAME "Outline6P"
120
121#define APER_MACRO_OUTLINE6P_HEADER \
122"%AMOutline6P*\n\
1230 Free polygon, 6 corners , with rotation*\n\
1240 The origin of the aperture is its center*\n\
1250 number of corners: always 6*\n\
1260 $1 to $12 corner X, Y*\n\
1270 $13 Rotation angle, in degrees counterclockwise*\n\
1280 create outline with 6 corners*\n\
1294,1,6,$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$1,$2,$13*%\n"
130
131// A aperture macro to define a polygon by 7 corners
132// and a rotation angle (useful for chamfered rect pads)
133#define APER_MACRO_OUTLINE7P_NAME "Outline7P"
134
135#define APER_MACRO_OUTLINE7P_HEADER \
136"%AMOutline7P*\n\
1370 Free polygon, 7 corners , with rotation*\n\
1380 The origin of the aperture is its center*\n\
1390 number of corners: always 7*\n\
1400 $1 to $14 corner X, Y*\n\
1410 $15 Rotation angle, in degrees counterclockwise*\n\
1420 create outline with 7 corners*\n\
1434,1,7,$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$1,$2,$15*%\n"
144
145// A aperture macro to define a polygon by 8 corners
146// and a rotation angle (useful for chamfered rect pads)
147#define APER_MACRO_OUTLINE8P_NAME "Outline8P"
148
149#define APER_MACRO_OUTLINE8P_HEADER \
150"%AMOutline8P*\n\
1510 Free polygon, 8 corners , with rotation*\n\
1520 The origin of the aperture is its center*\n\
1530 number of corners: always 8*\n\
1540 $1 to $16 corner X, Y*\n\
1550 $17 Rotation angle, in degrees counterclockwise*\n\
1560 create outline with 8 corners*\n\
1574,1,8,$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$1,$2,$17*%\n"