Commit Graph

51 Commits

Author SHA1 Message Date
Seth Hillbrand bcf6b620a8 Large rework of BEZIER_POLY
Add direct handling of quadratic beziers to save compute time and number
of points.  Update cubic interpolation to reduce number of points
generated for a given smoothness

Cache data on open and used cached data to avoid multiple re-calcs

Remove minimum line length and number of segments and replace with
standard max error level.  Allows us to specify the tolerance of bezier
interpolation
2024-06-18 17:55:41 -07:00
Marek Roszko 8b4253cda4 Drop the first point of an arc when building an outline when there's a previous point that's being changed
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18125
2024-05-31 18:40:16 -04:00
Alex Shvartzkop 3f704cb1f1 Fix an assert in isCopperOutside.
(cherry picked from commit dfd8aa402d)
2024-05-18 22:52:41 +03:00
Jeff Young 8184ed64e7 Explicit control over hidden text in bounding boxes.
In particular, don't consider hidden text when plotting,
and only when AsItemCheckboxes is checked for printing.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17958
2024-05-06 21:36:19 +01:00
Jeff Young cfa55d958a performance efficiencies 2023-12-18 18:45:02 +00:00
Alex Shvartzkop a161829f86 Use SCOPED_FLAGS_CLEANER more carefully.
Other methods used ConvertOutlineToPolygon's SKIP_STRUCT state.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16321
2023-12-09 19:24:51 +03:00
Alex Shvartzkop 12f529d6e0 Fix build error. 2023-12-04 10:44:37 +03:00
Alex Shvartzkop 111a8d6ab3 Improve/fix Expand connection for graphics. 2023-12-04 09:52:31 +03:00
Seth Hillbrand 75c6b0ab28 Added IPC2581 support
IPC2581 is a modern production file exchange system.  It provides
single-file data output for an entire board including BOM and netlist
information.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1954
2023-11-26 15:30:58 -08:00
Jeff Young 62d959ed0e Don't assume an error location for PAD::GetEffectivePolygon().
While ERROR_INSIDE was good for plotting, 3D generation, etc., it's
not good for generating router hulls.

Also reverts part of the change to always use polygons for PNS::SOLIDs.  A single shape in a SHAPE_COMPOUND will be faster (and
more accurate).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14898
2023-10-13 13:59:26 +01:00
jean-pierre charras 79a45c4803 TestBoardOutlinesGraphicItems(): handle small arcs. 2023-10-12 19:59:11 +02:00
Wayne Stambaugh e3c491424b Coding policy, Doxygen comment, and spelling fixes. 2023-10-12 12:27:30 -04:00
jean-pierre charras a7d540ce94 TestBoardOutlinesGraphicItems(): add missing case.
DRC_TEST_PROVIDER_MISC::testOutline(): use a smaller size to dectedt small items.
2023-10-12 15:53:21 +02:00
jean-pierre charras 499f3ca95b DRC_TEST_PROVIDER_MISC::testOutline(): add test to detect questionable items.
Graphic items (segments, rects, circles) on Edge.Cuts can create issues when
building board outlines, when they are very small (a few nm in size), because
they are not easily handled when trying to search connected graphics.
Also protect RC_ITEM::SetItems() against null pointer.
Fixes #15865
https://gitlab.com/kicad/code/kicad/-/issues/15865
2023-10-12 14:48:24 +02:00
Jeff Young c7e865e4a2 Safety for negative pen widths. 2023-09-14 13:39:35 +01:00
Alex Shvartzkop ab6a049b90 Add a routine for joining PCB shapes. 2023-09-04 06:46:24 +03:00
jean-pierre charras 15f5a14217 Fix minor compil warnings 2023-08-27 11:11:08 +02:00
Alex Shvartzkop f842e6ac7a STEP: export arcs in board contours as curves, not polygons.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13825
2023-08-24 21:53:53 +03:00
Jeff Young 6a6e839cc4 Move checking for null parent higher.
(Otherwise we set the failure flag without telling the user why.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15415
2023-08-18 10:32:45 +01:00
jean-pierre charras a16ab0aae1 Replace SHAPE_T::RECT by SHAPE_T::RECTANGLE: RECT creates a collision name
issue with a Windows header on msys2.
Change very similar to the commit 9a47b344 about class PAD_SHAPE.
No actual code change
2023-07-25 09:11:55 +02:00
jean-pierre charras 66651327bd STEP export: in board outlines, export Circles as Cylinders, round 2.
Other arcs (not 360 deg arcs) are still exported as polylines
2023-05-16 13:39:16 +02:00
jean-pierre charras 99bdb82dff Revert "STEP export: in board outlines, export Circles as Cylinders."
This reverts commit 09515fe821.
It does not pass a QA test
2023-05-16 09:59:53 +02:00
jean-pierre charras 09515fe821 STEP export: in board outlines, export Circles as Cylinders.
Other arcs (not 360 deg arcs) are still exported as polylines
2023-05-16 08:46:34 +02:00
Seth Hillbrand 4b91c0c8ee Handle multiple holes in footprints
Our basic logic for whether we have a hole or an outline in a footprint
checks if there is copper pads outside of the closed edge.  This misses
the case where the footprint is used to align multiple holes but has no
copper.  Since we do not support multiple outlines in a board, we can
safely assume that multiple, closed edges in a footprint represent holes
and not outlines

Fixes https://gitlab.com/kicad/code/kicad/issues/14468
2023-04-20 14:56:36 -07:00
jean-pierre charras 97a4e535dc ConvertOutlineToPolygon(): fix handling of polygons living in footprints.
Due to recent changes in PCB_SHAPE items, the polygon coordinates are now
in board coordinates, not in coord relatives to the parent footprint.
Fixes #14530
https://gitlab.com/kicad/code/kicad/issues/14530
2023-04-13 17:22:03 +02:00
Jeff Young bbd6c80507 Collapse FP_* down into their PCB_* equivalents. 2023-03-31 22:57:46 +01:00
jean-pierre charras 7256a51e8e Fixes in build board outlines as polygon and convert_shape_list_to_polygon:
- Ensure Bezier curves have their polygon build before use it.
- When building board outlines as polygon the same chaining epsilon value
for DRC, export step and 3D view (default 0.01mm).
Fixes #14115
https://gitlab.com/kicad/code/kicad/issues/14115
Fixes #14009
https://gitlab.com/kicad/code/kicad/issues/14009
2023-02-28 16:45:03 +01:00
Marek Roszko aacc9746e3 Yeet the last of wxSize/wxPoint to stop leaking gdicmn everywhere 2023-02-18 22:57:18 -05:00
Jeff Young 53b6993d2b Don't report errors in first pass of board outline generation.
Segments which aren't used to build holes in footprints can still
be used by the second pass to build the board outline.

Fixes https://gitlab.com/kicad/code/kicad/issues/13321
2022-12-30 22:32:08 +00:00
Jeff Young c85590a470 Correct is-inside logic.
Fixes https://gitlab.com/kicad/code/kicad/issues/13259
2022-12-27 14:34:35 +00:00
Jeff Young ab6aa08f33 Fix typo.
Fixes https://gitlab.com/kicad/code/kicad/issues/13263
2022-12-26 20:33:04 +00:00
Jeff Young 8c97a7b8c6 If fps contain complete board-edge holes then exclude those edges from main calc.
Fixes https://gitlab.com/kicad/code/kicad/issues/12921
2022-12-04 11:51:44 +00:00
jean-pierre charras c378d01068 code cleaning. 2022-12-01 16:01:38 +01:00
jean-pierre charras 8098db2a20 BuildBoardPolygonOutlines: enable multiple main outlines: it works fine in 3D viewer. 2022-10-15 09:33:27 +02:00
Jeff Young 6f9bc0980b Refactor poly outline generator to handle multiple outlines.
Note: disjoint outlines are handled in footprint courtyards, but not
for board outlines.

Fixes https://gitlab.com/kicad/code/kicad/issues/7660
2022-10-14 20:32:04 +01:00
Marek Roszko a8613ee80f Combine Iu2Millimeter & remove PcbMm2iu 2022-09-16 21:09:26 -04:00
Jeff Young 5679b9dbdc Remove a few EDA_RECT instances. 2022-08-31 01:22:49 +01:00
Seth Hillbrand b736460e71 Move optional access from value() to *operator
`value()` throws.  Where we check for existence, we don't need to use
the throwing version and should just use the unprotected variant
2022-08-30 13:59:39 -07:00
Seth Hillbrand f1261e71d4 Replace boost::optional with std::optional 2022-08-25 15:50:47 -07:00
Jeff Young aa2ad3b44c Move KICAD_T[] to std::initializer_list<KICAD_T>. 2022-08-20 10:28:11 +01:00
Jeff Young 65185f53a1 Rotate fp zones before comparing with library versions.
Also includes some performance fixes to not copy around triangulation
data when it's not needed.

Fixes https://gitlab.com/kicad/code/kicad/issues/10143
2022-03-14 15:53:24 +00:00
Jeff Young 7ccac79192 More wxString wide literals. 2022-02-05 21:29:34 +00:00
Jeff Young dcaec78cc5 A bit more angle cleanup. 2022-01-18 02:18:55 +00:00
Jeff Young 07013d00e1 More EDA_ANGLE. 2022-01-14 16:08:19 +00:00
Jeff Young abd3f5bc2b Move footprints to EDA_ANGLE. 2022-01-14 16:08:18 +00:00
Marek Roszko 7d671cff1e Scoop up some more wxPoints 2022-01-01 21:06:40 -05:00
Marek Roszko c4c56de708 Neurotically update position wxPoint usages 2022-01-01 11:55:51 -05:00
Jeff Young 2bc86fa0a8 Shapes for schematic.
ADDED arc, circle and rectangle shapes for schematic.  Shapes support
line styles and fill colors.

CHANGED sheet background color in Edit Text & Graphics Properties to
fill color (and it now affects shapes).

Pushed STROKE_PARAMS down into common and moved all shapes to using it
for stroke descriptions.
2021-12-23 20:36:07 +00:00
Jeff Young 6f0a4ccdee Formatting. 2021-11-26 18:14:29 +00:00
Jeff Young 9b9e379aa0 Overhaul arc internal model to not over-specify information. 2021-10-15 12:45:43 +01:00