15 Commits

Author SHA1 Message Date
Seth Hillbrand
e0fc7b2b88 Some fixes for DXF import
In order to find elements, we need to have bbox correctly set.  ::min()
for doubles, just gives the smallest positive value.  So negative placed
graphics don't trigger the right bbox and they get nopped out of
existence.

Similarly, following the advice from @msteinbeck, we elevate the degree
of the spline before converting it to beziers in order to properly
represent in KiCad

Fixes https://gitlab.com/kicad/code/kicad/-/issues/11153
2024-08-21 16:24:13 -07:00
Seth Hillbrand
a724b3d8b1 Handle DXF files with out of bounds values
First, ensure that we calculate the bbox of the imported elements.

If the total BBOX is outside our allowed value, refused to import.  This
needs to be scaled or addressed in an external editor

If the bbox fits, then make sure that we clamp it such that the largest
element is still within our bounds

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18523
2024-08-14 13:06:18 -07:00
Alex Shvartzkop
35c5c0c4d7 Fix an off-by-one error in DXF unicode control code parsing.
See https://gitlab.com/kicad/code/kicad/-/issues/18524
2024-08-10 02:50:33 +03:00
Alex Shvartzkop
c3bf894d81 Use wide char to satisfy macOS build. 2024-08-10 02:15:27 +03:00
Alex Shvartzkop
7d7ddcf3a1 Support \U control code in DXF MText content.
See https://gitlab.com/kicad/code/kicad/-/issues/18524
2024-08-10 02:10:57 +03:00
Alex Shvartzkop
55b3ef2ff2 Improve DXF MText content import.
Support more than 250 characters, improve control codes conversion.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18524
2024-08-10 01:26:04 +03:00
dsa-t
ca18112041 Fix ellipse angles when importing DXF.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18121


(cherry picked from commit 044a2305e3fcaace9625b48ad14fb465a698331e)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2024-06-04 04:19:51 +00:00
Alex
767ab72cdb DXF import: INSERT angles are in degrees.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16656
2024-01-21 07:56:20 +03:00
Jeff Young
88e34fd482 Coding style. 2023-09-25 16:21:11 +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
Jeff Young
a946f7ab1b Handle non-cardinal major-axis arcs when importing DXF. 2023-08-27 16:36:12 +01:00
Jeff Young
75b160e83a Handle DXF arcs with a flipped coord system.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14905
2023-08-27 13:16:49 +01:00
Alex Shvartzkop
5131dae568 Graphics import improvements/fixes:
- add support for color
- support non-uniform scale
- add GetImageBBox()
- fix SVG GetImageWidth/Height not being in mm
- fix import offset not being in mm
- add graphics importer for LIB_SYMBOL
2023-08-18 22:52:49 +03:00
Alex Shvartzkop
4e43d4e0db Graphics import: support loading from memory buffer. 2023-08-18 22:52:40 +03:00
Alex Shvartzkop
26a52ecfe9 Move parts of import_gfx to common. 2023-08-18 22:43:54 +03:00