Commit Graph

29 Commits

Author SHA1 Message Date
jean-pierre charras 72ce955066 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/16049
2023-11-08 10:45:13 +01:00
jean-pierre charras 72984c5c40 Gerbview: add refinements to option to set offset and rotation of layers.
Fix incorrect calculation of bounding boxes when the rotation is not n*90 deg.
2023-09-08 10:43:59 +02:00
jean-pierre charras efdead2008 Gerbview: added (in Layers Manager) a new setting to adjust draw offset
and rotation of the active layer. This is a draw option only.
2023-09-06 20:08:45 +02:00
jean-pierre charras 9df65d7f54 Gerbview: code refactor: move APERTURE_MACRO defs from am_primitive to aperture_macro.
Some other code cleaning, but no actual code change.
2023-01-20 10:47:18 +01:00
Jeff Young 4f0136db3b Attempt to fix std::initializer_list lifetime issue. 2022-08-21 20:54:41 +01:00
Jeff Young aa2ad3b44c Move KICAD_T[] to std::initializer_list<KICAD_T>. 2022-08-20 10:28:11 +01:00
Marek Roszko a8505d9c76 SEARCH_RESULT -> INSPECT_RESULT
To fix the name squatting it's doing for future functionality
2022-07-29 20:01:10 -04:00
Seth Hillbrand 54b20cb049 Fix overflow vulnerability in Gerbview
Corrects an unguarded read that could lead to arbitrary code execution
in specifically crafted gerber files.

Fixes https://gitlab.com/kicad/code/kicad/issues/10700
2022-02-01 15:50:27 -08:00
Mike Williams da2e7e158b Gerbview: Attempt to parse unknown files as gerber/drill
Test parsing function transmogrified from gerbv 2.7.0. gEDA suite is GPL
2+ so should be license compatible with our GPL3.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/1848
2022-01-24 08:40:49 -05:00
Marek Roszko c91d3e3cf9 Remove some more wxPoint 2022-01-01 14:12:20 -05:00
jean-pierre charras 210671b10a Gerbview, Excellon reader: add preference to configure default coordinates format. In Excellon drill files, the coordinate format is not specified, and sometimes units and zero option are even not specified, so some drill files cannot be read. In Preferences, default setting options are now added to specify by hand missing info. 2021-08-02 12:55:41 +02:00
Mike Williams f2241d25c6 Gerbview: implement ;FILE_FORMAT parsing
Apparently Altium likes to output drill files with a specific header
setting the number format

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7519
2021-08-02 08:48:15 +00:00
jean-pierre charras b1fd462d28 Gerbview, Excellon reader: use Leading Zeros format when not specified in file.
Some very poor files do not specify the coordinates format.
In this case, the default is INCH,LZ that looks like the more usual.
2021-08-01 11:44:45 +02:00
luz paz 0446d35f0d Fix source comment/doc typos (follow-up)
Found via `codespell -q 3 -S *.po,./thirdparty -L aactual,acount,aline,alocation,alog,anormal,anumber,aother,apoints,aparent,aray,dout,einstance,modul,ot,overide,serie,te,,tesselate,tesselator,tht`
2021-07-13 10:48:17 +00:00
Wayne Stambaugh 4619d5e112 Fix more broken Doxygen comment specifiers. 2021-01-26 12:17:52 -05:00
jean-pierre charras d146839f0f Gerbview: add a error message for invalid files missing G74 or G75 commands.
They are mandatory to read arc coordinates.
2020-04-10 12:57:29 +02:00
Seth Hillbrand 7c28c3838a Comment-only changes
Makes class comments conform to coding standards
2020-01-10 16:43:01 -08:00
jean-pierre charras 8d649b5351 Gerbview: cleanup code.
Remove GERBER_FILE_IMAGE_LIST dependency to EDA_ITEM, useless.
GERBER_FILE_IMAGE: replace DLIST by std::deque to store gerber draw items.
Remove dead code
2019-12-31 11:58:43 +01:00
jean-pierre charras c59fa1b672 Gerbview: Fix outdated warning message about missing D-Codes and old RS274D files.
RS274X Gerber files using only regions (polygons) can be valid, and are not old RS274D files
Now a warning is raised only if there are some missing D codes definitions
(RS274D file or broken RS274X file)

Remove unused var and add comments

Fixes: lp:1850821
https://bugs.launchpad.net/kicad/+bug/1850821
2019-11-01 08:34:24 +01:00
jean-pierre charras 937b5bd69a Gerbview allows larger DCodes values (previously DCode id number max 999, now 10000)
This is not the DCodes max count but the DCode id (like in %ADD20C,0.05*%: the id is 20)
2019-09-16 14:49:26 +02:00
Jeff Young a25368cc6b Improve spelling.
The groundwork here is thanks to kunda1.

Fixes: lp:1831510
* https://bugs.launchpad.net/kicad/+bug/1831510
2019-08-20 19:14:05 +01:00
jean-pierre charras ecfe564f4d Gerber viewer: Ensure arc interpolation is used only after a arc command.
Remove also non existing G command codes.
2018-12-01 18:52:27 +01:00
jean-pierre charras 4136aca221 Gerbview: Excellon drill files reader: add a better support of routing mode.
Previously, the M and G00, G01, G02 and G03 commands were read, but nothing was actually done.
The current support is a bit rough, but it allows reading some drill files with routing commands.
2018-09-24 13:12:47 +02:00
jean-pierre charras c291505830 Gerbview, read Excellon files: fix a few issues.
The main issue is the fact Excellon files have no coordinate fine format definition.
Only the units are defined.
Units are floating point numbers or integer numbers.
Integer numbers can be defined as 3.3 or 2.4 numbers (mm/inches)
However some files (altium drill files for instance) use an other notation.
This fix is a workaround to accept 2.x (inch) or 3.x (mm) notations.

Fixes: lp:1754121
https://bugs.launchpad.net/kicad/+bug/1754121

Fixes: lp:1782053
https://bugs.launchpad.net/kicad/+bug/1782053
2018-07-17 14:29:28 +02:00
jean-pierre charras d8687e4eaf Gerbview: minor code cleanup 2018-05-14 09:05:11 +02:00
jean-pierre charras 8da242c593 Gerbview: accept any structured comment as X2 attribute.
A structured comment is a comment line starting by "G04 #@! " and in fact containing
a X2 attribute. It is used to create Gerber files contianing X2 metadata, but compatible
with X1 file format
2018-05-14 09:05:09 +02:00
jean-pierre charras 66d5d10b49 Gerbview: bigger line buffer to read some gerber files that have only one (very long) line.
small code refactor.
2018-03-14 10:42:18 +01:00
jean-pierre charras a0ac1a48c2 Gerbview: fix code after renaming files 2018-01-29 13:26:58 +01:00
jean-pierre charras 6255239b52 Gerbview: rename files class_xxx to xxx according to the class names of classes defined inside the files 2018-01-29 11:51:47 +01:00
Renamed from gerbview/class_gerber_file_image.h (Browse further)