Browse Source
Gerbview: fix some issues related to comments and primitives in macros:
Gerbview: fix some issues related to comments and primitives in macros:
- comments on more than one line were not fully skipped, creating read errors - in macros, some primitives (not all) were incorrectly rotated: they must be rotated around the aperture macro origin, not the primitive origin. - a new test file with rotated primitives in macros is added. Fixes #16049 https://gitlab.com/kicad/code/kicad/-/issues/16049newinvert
6 changed files with 162 additions and 30 deletions
-
25gerbview/am_primitive.cpp
-
7gerbview/gerber_file_image.h
-
125gerbview/gerber_test_files/aperture_macro_with_prim_rotation_test.gbr
-
14gerbview/readgerb.cpp
-
13gerbview/rs274d.cpp
-
8gerbview/rs274x.cpp
@ -0,0 +1,125 @@ |
|||
G04 ================================================================================================ |
|||
Copyright (C) 2023 Tony Luken <tonyluken62+gerberfileparser.gmail.com> |
|||
|
|||
This file is part of GerberFileParser. |
|||
|
|||
GerberFileParser is free software: you can redistribute it and/or modify it under the terms of |
|||
the GNU General Public License as published by the Free Software Foundation, either version 3 of |
|||
the License, or (at your option) any later version. |
|||
|
|||
GerberFileParser is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License along with GerberFileParser. If |
|||
not, see <http://www.gnu.org/licenses/>. |
|||
===================================================================================================* |
|||
|
|||
G04 Demonstrate rotation of all macro primitives* |
|||
|
|||
G04 Set coordinate format and units* |
|||
%FSLAX26Y26*% |
|||
%MOMM*% |
|||
|
|||
G04 Demo Circle Primitive* |
|||
%AMSomeCircles* |
|||
0 1, Exposure, Diameter, Center X, Center Y[, Rotation]* |
|||
1,1,4,8,-5,0* |
|||
1,1,4,8,-5,120* |
|||
1,1,4,8,-5,240* |
|||
% |
|||
|
|||
G04 Demo Polygon Primitive* |
|||
%AMSomePolygons* |
|||
0 5, Exposure, # vertices, Center X, Center Y, Diameter, Rotation* |
|||
5,1,5,7,8,7.5,0* |
|||
5,1,5,7,8,7.5,120* |
|||
5,1,5,7,8,7.5,240* |
|||
% |
|||
|
|||
G04 Demo Thermal Primitive* |
|||
%AMSomeThermals* |
|||
0 7, Center X, Center Y, Outer diameter, Inner diameter, Gap, Rotation* |
|||
7,-15,-5,3,2,0.5,0* |
|||
7,-15,-5,3,2,0.5,120* |
|||
7,-15,-5,3,2,0.5,-120* |
|||
% |
|||
|
|||
G04 Demo Outline Primitive* |
|||
%AMSomeOutlines* |
|||
0 4, Exposure, # vertices, Start X, Start Y, Subsequent points..., Rotation* |
|||
4,1,3,15,2,15,5,19,2,15,2,0* |
|||
4,1,3,15,2,15,5,19,2,15,2,120* |
|||
4,1,3,15,2,15,5,19,2,15,2,240* |
|||
% |
|||
|
|||
G04 Demo deprecated Lower Left Line Primitive* |
|||
%AMSomeLowerLeftLines* |
|||
0 22, Exposure, Width, Height, Lower Left X, Lower Left Y, Rotation* |
|||
22,1,20,3,-10,-25,0* |
|||
22,1,20,3,-10,-25,120* |
|||
22,1,20,3,-10,-25,240* |
|||
% |
|||
|
|||
G04 Demo Center Line Primitive* |
|||
%AMSomeCenterLines* |
|||
0 21, Exposure, width, height, center X, center Y, rotation* |
|||
21,1,13,1.5,2,20,0* |
|||
21,1,13,1.5,2,20,120* |
|||
21,1,13,1.5,2,20,-120* |
|||
% |
|||
|
|||
G04 Demo Vector Line Primitive including deprecated version (2)* |
|||
%AMSomeVectorLines* |
|||
0 20 (or 2), Exposure , Width, Start X, Start Y, End X, End Y, Rotation* |
|||
20,1,1.5,-2,2,-6,7,0* |
|||
20,1,1.5,-2,2,-6,7,120* |
|||
2,1,1.5,-2,2,-6,7,240* |
|||
% |
|||
|
|||
G04 Demo deprecated Moire Primitive* |
|||
%AMSomeMoires* |
|||
0 6, Center X, Center Y, Outer Diameter, Ring Thickness, Ring Gap, Max #Rings, |
|||
Crosshair Thickness, Crosshair Length, Rotation* |
|||
6,3,-17,5,0.5,0.5,2,0.1,6,0* |
|||
6,3,-17,5,0.5,0.5,2,0.1,6,120* |
|||
6,3,-17,5,0.5,0.5,2,0.1,6,-120* |
|||
% |
|||
|
|||
%ADD10SomeCircles*% |
|||
%ADD11SomePolygons*% |
|||
%ADD12SomeThermals*% |
|||
%ADD13SomeOutlines*% |
|||
%ADD14SomeLowerLeftLines*% |
|||
%ADD15SomeCenterLines*% |
|||
%ADD16SomeVectorLines*% |
|||
%ADD17SomeMoires*% |
|||
|
|||
G01* |
|||
%LPD*% |
|||
|
|||
D10* |
|||
X0Y0D03* |
|||
|
|||
D11* |
|||
X0Y0D03* |
|||
|
|||
D12* |
|||
X0Y0D03* |
|||
|
|||
D13* |
|||
X0Y0D03* |
|||
|
|||
D14* |
|||
X0Y0D03* |
|||
|
|||
D15* |
|||
X0Y0D03* |
|||
|
|||
D16* |
|||
X0Y0D03* |
|||
|
|||
D17* |
|||
X0Y0D03* |
|||
|
|||
M02* |
Write
Preview
Loading…
Cancel
Save
Reference in new issue