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
2 years ago
Alex Shvartzkop
26a52ecfe9
Move parts of import_gfx to common.
2 years ago
Mike Williams
6d93950dcc
PCB: abolish TEXT_TYPE::TEXT_is_*
PCB_TEXT is now always what was formerly TEXT_is_DIVERS and PCB_FIELDs
now what mandatory field type they are already.
2 years ago
jean-pierre charras
9537fd4e45
Pcbnew, graphic importer: convert arc with large radius to segment.
Arcs having a too large radius cannot be safely handled.
The criteria (not perfect) is radius < INT_MAX/2 to use arcs
Fixes #14210
https://gitlab.com/kicad/code/kicad/-/issues/14210
2 years ago
Seth Hillbrand
b56db30019
Ensure that even open paths with fills are filled
SVG paths that are "open" can still have a fill internally, so avoid
dropping fills for these non-standard polygons
Fixes https://gitlab.com/kicad/code/kicad/issues/14518
3 years ago
Jeff Young
bbd6c80507
Collapse FP_* down into their PCB_* equivalents.
3 years ago
Marek Roszko
aacc9746e3
Yeet the last of wxSize/wxPoint to stop leaking gdicmn everywhere
3 years ago
Kliment
68eac74458
pcbnew: Fix strokeWidth truncation to integer mm in SVG polygons import
The polygon conversion algorithm mistakenly stored the stroke width of
filled polygons in an integer variable. As a result, all stroke widths
were rounded down to the next smaller integer mm size. This commit changes
the types in the relevant functions and variables from int to double.
3 years ago
Wayne Stambaugh
022c913e8f
Fix another broken graphics import file filter.
3 years ago
Marek Roszko
fa7205ebbc
Handle block insert scaling a little better but incompletely
https://gitlab.com/kicad/code/kicad/-/issues/11614
3 years ago
Marek Roszko
0e42cb19f2
Realize we can just describe the dxf arb axis with our MATRIX3x3 class
3 years ago
Jon Evans
b85fab9ab6
Support DXF ellipses and elliptical arcs
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12563
3 years ago
Jeff Young
c0872364d4
Get rid of bloated bitmap buttons on wxWidgets 3.2.
3 years ago
jean-pierre charras
88038907fa
Pcbnew, graphic importer: do not import 0 length segments and smaller than 20 nm Bezier curves.
Degenerated Bezier curves (i.e. straight lines) are imported as segments.
They create issues in kicad because they are hard to edit and manage.
3 years ago
Marek Roszko
aa537fe559
Change bezier curve iteration to be easier to read
Fix #https://gitlab.com/kicad/code/kicad/-/issues/11153 somewhat
3 years ago
Marek Roszko
24ca892afb
Update tinysplice to latest
A few years worth of bug fixes
3 years ago
Seth Hillbrand
0ee7f8e2bd
Fix 436f95e02e
NanoSVG does handle opacity (thanks Mark) but the check needs to be
unsigned if we are comparing the resulting down-shifted value against
zero
Fixes https://gitlab.com/kicad/code/kicad/issues/13033
3 years ago
Seth Hillbrand
436f95e02e
Don't look for alpha in nanosvg color
Nanosvg colors are only RGB, so we will never get an alpha value here.
Fixes https://gitlab.com/kicad/code/kicad/issues/13033
3 years ago
Kliment
c5fe265eb4
Take axis inversion into account when importing graphics. Fixes #9351 .
3 years ago
jean-pierre charras
85e44c2dae
pcbnew, SVG import: fix an issue for SVG files using a CR+LF end of file
The issue was in a validity test working only if CR+LF is not replaced by LF
Fixes #10096
https://gitlab.com/kicad/code/kicad/issues/10096
3 years ago
Jeff Young
92f1ee556f
Don't fill drawing sheet rects with transparent fill.
It might make sense to do that with board and/or schematic items for
hit-testing or something, but it definitely doesn't make any sense for
the drawing sheet border.
Also, when reading in items with a transparent fill, treat them as
unfilled (otherwise we get filled with layer colour in at least PCBNew).
3 years ago
aris-kimi
6bc00eabaf
dialog_dxf_import dialog minor UI fixes
3 years ago
Jeff Young
1a812727cb
Fix some logic errors in importing SVG polygons with holes.
Fixes https://gitlab.com/kicad/code/kicad/issues/11479
3 years ago
Marek Roszko
3d5913c825
Remove convert_to_biu.h, merge contents to base_units.h
3 years ago
Marek Roszko
66e8931405
Remove IU_PER_MM thats standalone
3 years ago
Marek Roszko
a8613ee80f
Combine Iu2Millimeter & remove PcbMm2iu
3 years ago
Mark Roszko
b00178adb3
Nuke base_units from orbit
3 years ago
Jeff Young
8ae0ddf09d
Move import graphics dialog to UNIT_BINDER.
Also fixes a bug where the position gets scaled (because we're
applying it to the imported values, which are automatically scaled).
Fixes https://gitlab.com/kicad/code/kicad/issues/10483
3 years ago
Marek Roszko
bf964d8678
Commonize page_info by simply making the Iu scale a parameter on call.
3 years ago
Marek Roszko
98b3904c51
Fix reserve call with the wrong source for size
3 years ago
Jeff Young
763c77eab8
DXF parameters are for DXF (only).
Fixes https://gitlab.com/kicad/code/kicad/issues/12021
3 years ago
luz paz
af6ba1a16e
Fix typos in pcbnew sub-directory
Found via `codespell -q 3 -S *.po,./thirdparty,./Documentation/changelogs -L aactual,acount,aline,alocation,alog,anormal,anumber,aother,apoints,aparent,aray,ba,busses,dout,einstance,leaded,modul,ontext,ot,overide,serie,te,,tesselate,tesselator,tht`
3 years ago
Marek Roszko
b18e441a88
Free memory in dxf import sooner on bad_alloc
4 years ago
Marek Roszko
9f8c0a8185
Catch memory exhaustion trying to import large DXFs
See https://gitlab.com/kicad/code/kicad/-/issues/11308
4 years ago
Marek Roszko
d74a0cdaa3
Don't pre-scale the line width
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11122
4 years ago
jean-pierre charras
dbfdd3fb56
Fix some Coverity warnings.
4 years ago
jean-pierre charras
8de4f762e1
svg importer: fix a crash when importing some files with no graphic item
4 years ago
Tomasz Wlostowski
018f4531a5
Fixes in the SVG import polygon postprocessing:
- don't drop subsequent polys when a non-filled primitive is imported 'in between'
- fix missing holes (also related to the interleaving of stroke and filled shapes, depending on the software that wrote the SVG file)
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10813
4 years ago
Jeff Young
34a9a165c9
More wide-string declarations.
4 years ago
Jeff Young
c8a50d9b50
Remove unit-less angles from VECTOR2I/D APIs.
4 years ago
Jeff Young
1b19ff5f42
More EDA_ANGLE changes.
4 years ago
Marek Roszko
98ee6c5f85
Cleanup some wx/gdicmn.h includes
4 years ago
Marek Roszko
c4c56de708
Neurotically update position wxPoint usages
4 years ago
Tomasz Wlostowski
01d1f8723c
SVG_IMPORT_PLUGIN: enable postprocessing of polygons with degeneracy and holes
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6739
4 years ago
Tomasz Wlostowski
3fce15f442
GRPAHICS_IMPORTER_BUFFER: forgot to store the indices of the paths belonging to a compound shape
4 years ago
Tomasz Wlostowski
e1f32f13a2
pcbnew: SVG importer support for even-odd fill rule
4 years ago
Tomasz Wlostowski
5d87b37f52
pcbnew: GRAPHICS_IMPORTER can now recognize multi-path shapes (and postprocess polygons with holes into Kicad-compatible fractured polysets)
4 years ago
Jeff Young
86cb57f4a7
Cherry-pick TEXT_ATTRIBUTES and EDA_ANGLE from rockola/kicad-strokefont
4 years ago
Jeff Young
c3552a940a
Make sure standard OK/Cancel buttons respond to current language.
Fixes https://gitlab.com/kicad/code/kicad/issues/9635
4 years ago
Jeff Young
e26341d424
Cleanup.
4 years ago