Commit Graph

322 Commits

Author SHA1 Message Date
Seth Hillbrand bf68b11ff9 Cleanup unused vars 2024-06-18 21:35:32 -07:00
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
Jon Evans 02502342a5 Try harder to keep searchable text hidden in SVG exports 2024-06-18 12:01:15 -04:00
Seth Hillbrand a9ae86eefd Cleanup geometry functions
Added Distance(VECTOR2) function that returns a double.  Removed
superfluous EuclideanNorm, GetLineLength, integer constructor for
EDA_ANGLE (this promotes to double in the CTOR), DistanceLinePoint and
HitTestPoints

Also extended the size for arc calculations that get distances to center
points to avoid overflow
2024-05-31 12:26:37 -07:00
Jeff Young 51004e42f4 Improve comments. 2024-05-28 15:37:11 +01:00
Jeff Young e9a1c3032d Update commenting following a bit of research into commit history. 2024-05-27 12:23:56 +01:00
Jeff Young 233ebb3e09 Add commenting regarding double-output of text.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18090
2024-05-27 12:14:08 +01:00
Alex Shvartzkop 16e3692e71 Build time optimizations. 2024-04-27 23:49:13 +03:00
Jeff Young c59ed0bbb7 Flip symbol editor's Y axis to match other editors. 2024-04-27 13:47:56 +01:00
Marek Roszko 24a790a7dc Don't compare against the wrong type
Technically this is still wrong because of doubles..
2024-04-12 19:53:26 -04:00
Alex Shvartzkop b905b4eac8 Improve moving, rendering and plotting of very small angle arcs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17110
2024-04-03 00:40:18 +03:00
Jeff Young f22f5f47cb Reset penWidth before stroking.
(PlotPoly will have set it to "1".)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17218
2024-03-14 17:40:04 +00:00
Jeff Young e30b6398b7 ADDED: optional PDF metadata from AUTHOR and SUBJECT variables.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17289
2024-03-14 17:40:04 +00:00
Alex Shvartzkop 4d66a8ebdb Fix rendering/plotting of arcs with tiny angle and huge radius.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17343
2024-03-09 02:07:24 +03:00
jean-pierre charras f086038684 GERBER_PLOTTER, round-rect aperture: ensure primitives have non null size.
for round-rect pads with a radius = 50% of the smaller dim, one of primitives
used to create the shape can have a 0 size.
Ensure a min size >= 10 nm (It should not create a actual change)
2024-02-28 17:31:10 +01:00
Jeff Young e7abeb3c38 Cleanup. 2024-02-24 20:05:51 +00:00
Alex Shvartzkop 82a0227c20 Don't plot polygon borders when they are disabled. 2024-01-15 22:35:35 +03:00
jean-pierre charras 3626a9e4cc SVG_PLOTTER: Update brush color also when the alpha value has changed.
Previously, the alpha value change was not tested, so the SVG style was
not always updated.
Fixes #16530
https://gitlab.com/kicad/code/kicad/-/issues/16530
2024-01-06 09:11:40 +01:00
Alex Shvartzkop 9c2c291255 Gerber plotter: work around CAM350 circle bug. 2023-12-05 15:33:55 +03:00
jean-pierre charras 0b1cb0e19d Gerber plotter: do not skip not filled polygons with a 0 line thickness.
It is legal in Gerber files, although lines with thickness = 0 are not
displayed by some viewers.
2023-12-04 17:49:01 +01:00
Jeff Young df83e24eb7 Cleanup.
It's been a long time since line style was specific to plotting.
2023-11-25 13:12:45 +00:00
Alex Shvartzkop dc9df9517d PDF plot: match mirror state between hidden and plotted text.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16066

(cherry-picked from commit 31e79ef54f)
2023-11-12 01:28:03 +03:00
Wayne Stambaugh 50ec069a01 Fix build warnings. 2023-10-12 10:10:09 -04:00
Alex Shvartzkop b0f4adf052 Improve borderless items logic in schematic plotting. 2023-10-12 08:40:37 +03:00
Alex Shvartzkop d9c123b1ec HPGL plotting: write rects as polygons to prevent always filling. 2023-10-12 06:11:12 +03:00
Alex Shvartzkop 45791ff8d6 HPGL plotting: fix random lines connecting to circles. 2023-10-12 06:11:12 +03:00
Alex Shvartzkop 4c0a75cbd4 Fix an assert in HPGL plotter. 2023-10-12 06:11:11 +03:00
Alex Shvartzkop 3e82e59c24 DXF plotting: write zero-sized rects and circles as points.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15862
2023-10-12 06:11:11 +03:00
Alex Shvartzkop 843bd4f79c PDF plotting: fix zero-sized or too thick rectangles.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15862
2023-10-12 06:11:11 +03:00
jean-pierre charras 37df47a3e7 genDrillMapFile: reduce the pen width used to plot oval shapes (better look) 2023-10-04 15:47:47 +02:00
jean-pierre charras 23e064aaaf fix buf in PLOTTER::sketchOval()
(incorrect parameters to plot arcs).
Fixes #15816
https://gitlab.com/kicad/code/kicad/-/issues/15816
2023-10-03 19:39:21 +02:00
Marek Roszko a347aa7647 StartPlot can fail and leave a broken file handle
Related https://gitlab.com/kicad/code/kicad/-/issues/15782
2023-09-29 19:52:21 -04:00
Jeff Young c7e865e4a2 Safety for negative pen widths. 2023-09-14 13:39:35 +01:00
Marek Roszko 11de95778b Unwrap the FROM_UTF8 macro in favor of direct function
The extern just gets annoying to try to export the func later. We also yeet TO_UTF8 to string_utils.h for parity.
2023-09-09 00:10:57 -04:00
Marek Roszko 96bec8c553 promote base64.cpp to core 2023-09-06 23:27:08 -04:00
Alex Shvartzkop 0317a1f687 Fix arcs in gerber export once again.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15559
2023-09-02 00:00:34 +03:00
Alex Shvartzkop 10e2e4a12d Another try at fixing arcs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15471
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15469
2023-08-22 16:10:58 +03:00
Alex Shvartzkop 865fa10fb2 Fix pad arcs in Gerber plot when aperture macros are disabled.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15452
2023-08-19 22:49:37 +03:00
Alex Shvartzkop 556120554e SVG plotter: fix hidden text orientation when plot is mirrored.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15422
2023-08-16 10:43:24 +03:00
Jeff Young 60f0db09aa Make sure text gets rendered in correct colour. 2023-08-07 21:44:04 +01:00
Jeff Young f43b90b15f Lazy context handling for SVG plotting.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15325
2023-08-07 14:01:58 +01:00
Alex Shvartzkop 717ee350c8 Support >180 deg arcs in schematic. 2023-08-07 14:18:38 +03:00
Jeff Young 5e112ca78e ADDED: parameterize font metrics and allow customization of overbar height. 2023-08-06 20:57:41 +01:00
Seth Hillbrand e71422d2cf Avoid bulking drawing sheet polygons
On the drawing sheet, the polygons are always filled and shouldn't have
additional stroking

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15242
2023-07-21 11:22:32 -07:00
jean-pierre charras 34e9de72ae fix a compil warning (shadowed var) 2023-07-13 07:46:08 +02:00
Alex Shvartzkop 2689037bde PDF plotting: support bitmaps with transparency.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5979
2023-07-07 23:29:46 +05:00
jean-pierre charras 88ffcec4b5 Plotters (especially DXF) add more precision when plotting arcs (and others)
- in DXF coordinates were using 6 digits for coordinate mantissa: this is not
enough for coord in inches. Now use 16 digits
- Arc( VECTOR2I& aCentre, EDA_ANGLE& aStartAngle, EDA_ANGLE& aEndAngle, ...)
was using integers for coord. This creates significant errors for start point
and end points of the arc. Now the center is given in double, and its position
is calculated from angle end points (and radius) to do not generate a position error
for these end points (previously the error could be 20 ... 50 nm)
Fixes #15056
https://gitlab.com/kicad/code/kicad/-/issues/15056
2023-07-06 18:09:38 +02:00
Alex Shvartzkop afe176abe2 Optimize PDF plot data size for property popups; fix unicode escape.
Adds a document-level action JSInit, which defines ShM function,
allowing more compact data representation. Also reduces whitespaces.
2023-07-04 08:57:29 +03:00
Alex Shvartzkop 698fffb128 PDF plotting: Fix "Show Page" in Foxit PDF Reader.
pageNum is an Integer. Acrobat seems to convert automatically.
2023-07-03 09:13:37 +03:00
Alex Shvartzkop 0d7b4bbb09 Blend transparent images with background color in PDF plotter. 2023-07-03 02:15:05 +03:00