Commit Graph

257 Commits

Author SHA1 Message Date
Seth Hillbrand bcc3767c2a FABMASTER: Fill both kinds of silk polys
Silkscreen polygons are always filled (I think) in FABMASTER.  Other
layer polygons are not
2021-02-27 06:58:04 -08:00
Seth Hillbrand 5d352d2373 FABMASTER: Enforce KiCad limits on line width
We require unfilled polygons to have positive width
2021-02-26 17:16:54 -08:00
Seth Hillbrand 7e0168a99d FABMASTER: Process newer outline tag
Allegro uses the subclass "DESIGN_OUTLINE" in newer version for their
edge cuts instead of just "OUTLINE".  This handles both.

Fixes https://gitlab.com/kicad/code/kicad/issues/7735
2021-02-26 17:06:56 -08:00
Seth Hillbrand c9b39aaaed FABMASTER: Process REFDES position
The reference designator is stored separately with the Tracks, so we
need to extract position/size data from it there and match back to the
components later.

Fixes https://gitlab.com/kicad/code/kicad/issues/7733
2021-02-26 17:04:21 -08:00
Seth Hillbrand 75c525af4f FABMASTER: Handle polygons better
Polygons in non-etch layers need special handling to ensure they get
treated the same.

Fixes https://gitlab.com/kicad/code/kicad/issues/7731
2021-02-26 14:01:04 -08:00
Seth Hillbrand 2d5015c217 FABMASTER: Try harder to figure out nets
Find all intersecting points both forward and back between the filled
areas and the outlines in order to determine the proper net assignment
for the zones

Also creates rule areas for special zones instead of filled zones

Fixes https://gitlab.com/kicad/code/kicad/issues/7732
2021-02-26 13:06:06 -08:00
jean-pierre charras b31bf1e40f Always store via drill value in .kicad_pcb file.
Old boards were using UNDEFINED_DRILL_DIAMETER value in file for via drill when
the via drill value was the netclass value.
Recent boards always set the via drill to the actual value, but now we need
to be sure always store the drill value, because netclass value is not stored
in the board file. Otherwise the drill value of some (old) vias can be unknown
2021-02-26 20:57:43 +01:00
Seth Hillbrand 73dd93701a FABMASTER: demote odd graphics warning
Drill layers have many different shapes in FABMASTER.  These are not
used for board information, so we can ignore them.
2021-02-26 11:37:21 -08:00
Seth Hillbrand ae2a9ef538 Use std::locale::classic static local
Prevents performance issues when creating new locales under MSVC
2021-02-26 11:37:21 -08:00
Seth Hillbrand 103dde67f6 FABMASTER: Handle rotated/flipped custom pads
The rotate mirror actions need to line up with the expectation.
FABMASTER keeps elements board-referenced while KiCad has some elements
referenced to the board and some referenced to the footprint
2021-02-26 11:37:21 -08:00
Seth Hillbrand ff1300d13b FABMASTER: Preallocate vectors
Reserves memory for vector elements based on file size.  This helps
reduce the number of re-allocations needed when reading large files
2021-02-26 11:37:21 -08:00
Jeff Young 86aaa2e9cb Rationalize footprint bounding boxes and cache all of them.
Fixes https://gitlab.com/kicad/code/kicad/issues/7720
2021-02-26 13:50:27 +00:00
Seth Hillbrand c15a9e60d4 Used cached footprints without check in preview
Between the time the user loads the footprint preview in cvpcb or Add
Footprint in pcbnew, we don't need to verify cache integrity to display
the footprint.  We use the cache copy when displaying until we close the
selection window and re-open.  This limits our need to iterate over the
full directory on every footprint display.

Alternate solutions for v7 should include looking into libfswatch for
change detection
2021-02-25 15:46:52 -08:00
Seth Hillbrand 54539d2cd7 Calculate timestamp the same way both times
Timestamps were checked using a different routine than they were
generated with, leading to the cache always being out of date.

This uses the same routine for both.  While it iterates over the
directory twice during the initial load, this will never be dominant

Fixes https://gitlab.com/kicad/code/kicad/issues/7711
2021-02-25 14:36:49 -08:00
Seth Hillbrand 154d56b4f4 If items exist on the "Rescue" layer, prompt user
Don't allow Rescue items to enter the board design.  This prompts the
user to either delete them or move them to the Comments layer.
2021-02-23 09:25:00 -08:00
Roberto Fernandez Bautista 09ebfcd650 CADSTAR Importer: Fix Code Style
- Rename member variable names to use the 'm_' prefix
- Rename a few object types that clashed with KiCad object names, such
  as BOARD and SCHEMATIC, to avoid the use of '::' to access the KiCad
  objects.
- Remove some unused code.
2021-02-22 13:24:00 +00:00
Jon Evans 3bc9d7b95e Rework GAL layer enum to fix visibility import from legacy boards 2021-02-21 13:41:43 -05:00
Jeff Young 9dacd4abb7 Don't allow footprint children in groups outside their footprint.
Fixes https://gitlab.com/kicad/code/kicad/issues/7625
2021-02-20 18:09:56 +00:00
Marek Roszko 622baa6531 Silence more unused exception var warnings 2021-02-20 12:01:51 -05:00
Seth Hillbrand de7d9ef874 Fix tabs 2021-02-15 08:09:20 -08:00
Seth Hillbrand 55db1aa5f5 Fix minor Fabmaster issue 2021-02-13 16:32:39 -08:00
Roberto Fernandez Bautista 19d786852a CADSTAR PCB Archive Loader: Fix loading of zero sized pads
Some CADSTAR designs use zero sized pads because CADSTAR did not allow
arbitrarily assigning pad numbers: they had to be sequential. The
workaround to this was to use zero sized pads. However this causes DRC
errors in KiCad, so we load them just in a mask layer.
2021-02-10 18:49:21 +00:00
Roberto Fernandez Bautista aabe9c063f CADSTAR PCB Archive Loader: Some fixes to design rules
1. Make sure to convert to KiCad units
2. There are some KiCad rules that have no CADSTAR equivalent.
   Make a guess as to what an appropriate rule could be.
2021-02-10 18:49:21 +00:00
Roberto Fernandez Bautista 2d66abdc89 CADSTAR PCB Archive Importer: More improvements to loading of zones
Adds a new function Area() to SHAPE_POLY_SET
2021-02-10 18:49:21 +00:00
Roberto Fernandez Bautista 06c420a2a3 CADSTAR PCB Archive Importer: Improve loading of zones
Load fill state and guess zone priorities from fill state
2021-02-10 18:49:20 +00:00
Roberto Fernandez Bautista 80d8974f87 CADSTAR Archive Importer: Fix loading of non-cadstar font text sizes
Non-cadstar fonts use a width of 0.
2021-02-10 18:49:20 +00:00
Roberto Fernandez Bautista f559e94b00 Non-Kicad Project Importers: Fix the creation of project fp libraries
Adds a new function to PLUGIN GetImportedCachedLibraryFootprints() that
loads the library footprints of the board design that was imported
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7449
2021-02-10 18:49:20 +00:00
Roberto Fernandez Bautista 297ff282f1 CADSTAR Importer: Update copyright years and remove white spaces 2021-02-10 18:49:20 +00:00
Marek Roszko 872184fe8b Revert "Bump minimum required CMake version to 3.10"
This reverts commit a475f45753.
2021-02-09 18:46:13 -05:00
Simon Richter a475f45753 Bump minimum required CMake version to 3.10
This allows us to remove even more workarounds
2021-02-08 12:23:08 +00:00
Thomas Pointhuber 088ff5b2bb altiium: set fill version, which allows us to do a copper pour without a line 2021-02-06 23:58:30 +01:00
Thomas Pointhuber 8ee6694c57 altium: Set smaller zone MinThickness by default to better account for missing design rules 2021-02-06 23:45:28 +01:00
Thomas Pointhuber d444ed80a5 altium: parse Regions6 to fill zone on import 2021-02-06 23:06:59 +01:00
Seth Hillbrand 016bffc899 Remove some more unneeded atof() calls 2021-02-05 10:18:34 -08:00
Seth Hillbrand 2e67cd2db8 Fix locale issue in Fabmaster import 2021-02-04 16:32:02 -08:00
Seth Hillbrand aa0db969ca Caching ConvexHull routine
Stores a cache of the convex hull similar to the bounding box.  Modifies
the hull based on actions to allow  complex footprint graphics without delay

Fixes https://gitlab.com/kicad/code/kicad/issues/7341
2021-02-04 15:56:52 -08:00
jean-pierre charras 0de3d48db5 typo 2021-02-04 09:00:35 +01:00
Seth Hillbrand 22d78a5827 FABMASTER: Handle flipped custom pads and rounded rects
Adds error messages for more cases and fallback for custom pads to
prevent invalid pad generation
2021-02-02 19:33:18 -08:00
Seth Hillbrand b54e951ed8 Fix a couple of checks in Fabmaster 2021-01-31 14:12:40 -08:00
Marek Roszko 21fe8542df Remove shadowing of identical base m_parser member 2021-01-31 12:56:27 -05:00
Thomas Pointhuber 70e6d0e79f altium: use those new fancy user definable layers and import the name from Altium 2021-01-31 11:15:08 +01:00
Thomas Pointhuber 6a9e1ecf9e altium: Center board after import 2021-01-30 17:43:02 +01:00
Seth Hillbrand 89a72df0b1 Fix a few FABMASTER issues
- Custom pads now properly supported with offset/rotation
- Fix missing pads from alternate layers

Fixes https://gitlab.com/kicad/code/kicad/issues/7299
2021-01-27 17:50:14 -08:00
Wayne Stambaugh 6a39b81647 Fix the last of broken Doxygen comment specifiers. 2021-01-27 17:39:44 -05:00
Jon Evans bea310569b Fix parsing of track/via user sizes from legacy boards
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6134
2021-01-26 21:51:36 -05:00
Jeff Young 1e9639e89c Save pintype alongside pinfunction (in pads).
Fixes https://gitlab.com/kicad/code/kicad/issues/7283
2021-01-26 15:28:48 +00:00
Seth Hillbrand 5a9c0a9b5a Quiet a few coverity warnings 2021-01-24 14:53:18 -08:00
Jeff Young 9ac807bdd2 Freeze implicit footprint file version at last before explicit.
We have been writing footprint versions for a while now, but we were
still interpreting the lack of a version as "current".  This changes
lack of a version to mean "last format before we started writing out
versions".

Fixes https://gitlab.com/kicad/code/kicad/issues/7143
2021-01-23 00:10:01 +00:00
Seth Hillbrand 060635b14c fabmaster: Fix graphic handling in geometry section 2021-01-19 12:16:40 -08:00
Ian McInerney d030d1667b Fix improper string creation in fabmaster importer 2021-01-18 18:35:10 +00:00
Jon Evans 1754504234 Fabmaster: fix MSVC build
std::map is not move-constructable on MSVC because
it is not declared noexcept (and is not required to be
by the standard)

This means that a struct containing graphic_element
cannot be inserted into a vector with move semantics without
compile errors.  However, wrapping it in a unique_ptr
works.
2021-01-17 10:23:31 -05:00
Seth Hillbrand 950db6ff9c pcbnew: Add Fabmaster import
Allows importing ASCII design output from OrCAD designs
2021-01-16 14:28:33 -08:00
Thomas Pointhuber 9f24ea0bb7 altium: fix non-copper pads. Roundrect pads were not filled and SetLocalCoord() does not transform polygons into the local coordinates, which is unexpected. 2021-01-14 22:21:05 +01:00
Jeff Young 0bce280424 Make sure design rules get recompiled after netclass changes.
Fixes https://gitlab.com/kicad/code/kicad/issues/7082
2021-01-13 12:37:20 +00:00
Dominik Wernberger 07635d2fc7 Minor adjustments 2021-01-12 20:51:31 +00:00
Dominik Wernberger ac94d72d2d Add more const specifiers 2021-01-12 20:51:31 +00:00
Jeff Young 3467e643e5 Move pad locking from footprint to pads.
Fixes https://gitlab.com/kicad/code/kicad/issues/6997
2021-01-08 20:43:02 +00:00
Jeff Young 01fe3b91e9 Implement locking for graphic shapes.
Fixes https://gitlab.com/kicad/code/kicad/issues/6972
2021-01-07 17:39:18 +00:00
Carlo Bramini a06387fafd Fix warning at compile time 2021-01-02 22:42:16 +00:00
Allan Nordhøy 8d81abb57a Consistent use of spaces in strings. 2020-12-30 22:57:50 +00:00
Roberto Fernandez Bautista b168b74919 CADSTAR Archive Importer: Fix position of multiline text with NO_ALIGNMENT in CADSTAR 2020-12-30 18:53:43 +00:00
Roberto Fernandez Bautista ffee24be63 CADSTAR PCB Archive Importer: Rewrite loadBoardStackup routine
Uses BOARD_STACKUP::BuildDefaultStackupList instead of trying to build the stackup from scratch
Fixes several asserts / incorrect stackups in some older boards
2020-12-30 18:53:43 +00:00
Roberto Fernandez Bautista a2cbbb963e CADSTAR PCB Archive Loader: Correctly handle Dimension text
Do not parse fields in dimension text to allow splitting it into prefix and suffix
2020-12-30 18:53:43 +00:00
Roberto Fernandez Bautista 45b621a3d1 CADSTAR PCB Archive Importer: Fix Import of Linear Dimensions (Angular dimensions not supported) 2020-12-30 18:53:43 +00:00
Roberto Fernandez Bautista fbac766254 CADSTAR PCB Archive Importer: Refactor layer mapping and fix assert
An assert was being fired to due to incorrect BOARD_STACKUP_ITEM_TYPE on some boards
2020-12-30 18:53:43 +00:00
Roberto Fernandez Bautista 0a1045300b CADSTAR PCB Archive Importer: Fix loading of net class settings 2020-12-30 18:53:43 +00:00
Roberto Fernandez Bautista cde433c82e CADSTAR PCB Archive Importer: Transfer Project to allow importing of Text Variables 2020-12-30 18:53:43 +00:00
Roberto Fernandez Bautista 03a23db4f7 CADSTAR PCB Archive Importer: Load PCB Text Variables to KiCad project 2020-12-30 18:53:42 +00:00
Roberto Fernandez Bautista 9ed4780fec CADSTAR Archive Importer: Change architecture to Parse CADSTAR fields and store them in a static map
Architecture of the parser changed to have a shared PARSER_CONTEXT between all the individual parsers.
Parses CADSTAR fields such as <@DESIGN_TITLE@> or <@SHEET_NUMBER@> and replaces with an equivalent KiCad Text Variable.
2020-12-30 18:53:42 +00:00
Jan Mrázek 93466fa165
Fix crash when adding 3D Models via Python 2020-12-28 20:03:54 +01:00
Jon Evans 17cf2466aa Fix overlapping definitions warning 2020-12-27 19:42:04 -05:00
jean-pierre charras 97f3c323c3 Pcbnew: fix missing escaping of texts in DIMENSION when saving the .kicad_pcb file.
Fixes #6855
https://gitlab.com/kicad/code/kicad/issues/6855
2020-12-27 10:18:23 +01:00
Jon Evans 70c397a9b4 Implement free vias fully
CHANGED: manually-placed (stitching) vias won't have their nets automatically updated
(unless the via is placed directly on a track segment)

CHANGED: stitching vias can be placed on footprint pads and pick up their nets

Fixes https://gitlab.com/kicad/code/kicad/-/issues/5484
2020-12-20 16:29:50 -05:00
Wayne Stambaugh 06aa1506ee Add optional project parameter to PCB plugin load method.
The optional PROJECT parameter is primarily used for third party plugins
that need to store project information loaded by the plugin.
2020-12-18 10:40:51 -05:00
Jeff Young bb232e6ac6 Unify LIB_IDs now that both are stored in sexpr files.
Fixes https://gitlab.com/kicad/code/kicad/issues/6764
2020-12-18 00:30:26 +00:00
Marek Roszko 7565f60a03 Swap wxFileInputStream/wxFileOutputStream for the buffered kind 2020-12-12 18:52:02 -05:00
Roberto Fernandez Bautista 260219b0e6 CADSTAR PCB Archive Importer: Fix arc and filled shapes in footprints
- Need to call the PCB_SHAPE version of SetAngle in order to set the global coordinates for m_ThirdPoint
- Fill shapes also if in a footprint
2020-12-10 14:35:37 +00:00
jean-pierre charras ac684ac7a3 Fix minor compil warnings. 2020-12-08 18:28:03 +01:00
Jeff Young b1f0bf7334 More consistent naming. 2020-12-08 13:05:39 +00:00
Marek Roszko e88d41f764 Add bulk add/remove mode flag to the BOARD_LISTENER
This attempts to fix performance when importing large changesets from schematics.
The appearance control is a BOARD_LISTENER that would otherwise redraw per item imported which may cause lockups
2020-12-07 22:04:13 -05:00
Jeff Young f3e1ac8dbe Defensive code to prevent lookup of stale parent board.
Fixes https://gitlab.com/kicad/code/kicad/issues/6618
2020-12-04 14:01:54 +00:00
Jeff Young fd5e1fbdd4 Formatting and cleanup. 2020-12-04 14:01:54 +00:00
Roberto Fernandez Bautista 0691e942f4 CADSTAR Archive Importer: Fix duplicate KIID for loaded elements
Don't use clone to copy an EDA_ITEM. Use Duplicate().
Even if you give the clone a new KIID, all its children will still be clones.
Create Duplicate() in LIB_PART
2020-11-28 17:18:17 +00:00
Roberto Fernandez Bautista 71f9847601 CADSTAR Archive Importer: Only load the Master variant 2020-11-28 17:18:17 +00:00
Roberto Fernandez Bautista 78e3f917d9 CADSTAR PCB Archive Importer: Fix loading of old CADSTAR designs and Do Not Keep Upright
Older CADSTAR versions used 1/10 degree whereas newer versions use 1/1000 degree.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6437
2020-11-28 17:18:17 +00:00
Roberto Fernandez Bautista f2ba9f7ac3 CADSTAR PCB Archive Importer: Correctly load the pad numbers as per the original design
To load the pad numbers correctly we need to also check the PART DEFINITION for each component
2020-11-28 17:18:17 +00:00
Jeff Young 9c7c05c161 Mostly formatting cleanup but a few type-casting cleanups too. 2020-11-24 22:16:41 +00:00
jean-pierre charras 976c6262f4 French translation update (fix also trailing spaces in a few sentences) 2020-11-23 11:42:25 +01:00
Jeff Young 18ad58cf4c Replace legacy copper edge heuristics.
Fixes https://gitlab.com/kicad/code/kicad/issues/6435
2020-11-19 13:35:26 +00:00
Dominik Wernberger 99da663e82 Remove unused variables plus some more fixes from CppCheck
Remove unused variables plus a few more fixes from CppCheck

Remove unused variables plus a few more fixes from CppCheck
2020-11-19 02:28:47 +00:00
Werni 0e44f5128c Add const specifiers 2020-11-18 19:50:36 +00:00
Marek Roszko 16e3e59495 Split out arrayDim and MIRROR templates from macros.h
These were not macros
2020-11-17 20:21:04 -05:00
Jeff Young dff5173baf Exorcise some instances of "modedit". 2020-11-17 16:05:48 +00:00
jean-pierre charras a431fd99ca Fix crash when converting a Eagle board to a Kicad board.
During conversion a illegal layer number was used without filtering
2020-11-17 10:23:44 +01:00
Ian McInerney 7d1a4a4224 Add version information to footprint sexpr files and clipboard
This allows the parser to properly interpret the sexpr version
of the footprint so that it can throw future format errors or
do version specific parsing properly.
2020-11-16 23:19:09 +00:00
Jeff Young f21e308830 Tweak fill logic to also catch filled primitives in custom pad shapes. 2020-11-15 23:14:46 +00:00
Ian McInerney ceb51bb103 pcbnew: Only write fill flag for circles, rectangles and polygons
The other shapes don't have the same concept of being filled
(their fill is only a viewing mode, not an actual saved property).
2020-11-15 22:03:59 +00:00
Ian McInerney 8c08b861ab Cleanup some compiler and Coverity warnings 2020-11-15 21:41:38 +00:00
Ian McInerney b31e97cfed Fix FP/PCB_SHAPE fill sexpr syntax to be backwards compatible
Previously the fill for shapes inside a footprint was not being
properly imported from older versions becase the default of no
flag changed from representing filled to representing no fill.

Introduce explicit filling information, and continue to treat no
flag on a polygon as meaning it is filled (which is the legacy
behavior).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6393
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6390
2020-11-15 21:28:27 +00:00
Jeff Young 3f1a58bd06 Replace "module" with "footprint" in PCB sexpr. 2020-11-15 20:23:15 +00:00