Commit Graph

388 Commits

Author SHA1 Message Date
jean-pierre charras 427de4cda6 BOARD::GetBoardPolygonOutlines(): add option to add NPTH as board holes.
Used in 3D viewer to truncate plated holes intersecting NPTH.
Fixes #16325
https://gitlab.com/kicad/code/kicad/-/issues/16325
2023-12-13 08:31:29 +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
Jeff Young 2ec3cd91fa Nullptr safety. 2023-11-20 13:47:24 +00:00
Jeff Young af9fc5be2f Hack to keep 3D Viewer's "home" zoom from being too small. 2023-11-19 14:07:50 +00:00
Jeff Young f9530d0b3f Remove "Reset View", which does the same as "Home View".
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16115
2023-11-19 14:07:50 +00:00
jean-pierre charras abcbba5635 PCB_TEXTBOX, create 3D shape: fix incorrect transform of the box, round 2:
when the box is a polygon (rotated rect by a non cardinal angle) the polygon
is not filled, so the shape is just a set of thick segments.
So we cannot use PCB_TEXTBOX::TransformShapeToPolygon to create the 3D view
Fixes #16072
https://gitlab.com/kicad/code/kicad/-/issues/16072
2023-11-11 18:11:50 +01:00
jean-pierre charras d8498b62e0 PCB_TEXTBOX::TransformShapeToPolygon(): fix incorrect transform: when it
is a polygon (rotated rect by a non cardinal angle) the polygon is not
filled, so the shape is just a set of thick segments.
Fixes #16072
https://gitlab.com/kicad/code/kicad/-/issues/16072
2023-11-11 16:44:04 +01:00
Alex Shvartzkop 5cd1a4674f Fix a crash in 3D viewer when changing preferences.
It was possible for OnMouseMove to come after ReloadRequest
but before DoRePaint.

Which meant m_3d_render_raytracing->Reload() has't been called yet,
thus the BVH contained invalid data.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16059
2023-11-09 20:52:39 +03:00
Marek Roszko bee6e6be01 AddMenuLanguageList should live in EDA_BASE_FRAME, its only user 2023-10-16 19:49:52 -04:00
Wayne Stambaugh b5eee9dd7e Coverity warning fixes. 2023-10-16 17:04:14 -04:00
Jeff Young d5d07e64c9 Use IsShownOnScreen(), not IsShown(), if you really want to know if its visible. 2023-10-14 23:51:37 +01: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
Alex Shvartzkop d7863b09c5 Move CORNER_STRATEGY out of SHAPE_POLY_SET. 2023-10-06 15:42:50 +03:00
Marek Roszko 37479c4154 HIDPI_GL_3D_CANVAS needs CAMERA so move it over 2023-09-23 20:06:57 -04:00
Jeff Young da1405ec6a Draw off-board pads when drawing off-board silk. 2023-09-22 20:57:31 +01:00
Jeff Young c1a988e3ff Handle plated vs non-plated copper for copper other than pads.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5569
2023-09-22 18:48:29 +01:00
Jeff Young 78f70b45e6 Minor readability improvements. 2023-09-22 18:48:29 +01:00
Jeff Young a954c1d93c Conversion safety. 2023-09-22 18:48:29 +01:00
Jeff Young 8d06a794f4 Simplify code.
DrawAllCameraCulled() can handle up to 4 knockout lists, and any
of them can be null, so don't dance around how we call it.
2023-09-21 14:02:23 +01:00
jean-pierre charras b1ed0529d7 3D viewer: Simplify polygons before triangulation.
It reduce the risk to create bad triangulation.
Fixes #15706
https://gitlab.com/kicad/code/kicad/-/issues/15706
2023-09-21 11:32:32 +02:00
Jeff Young f97af9f254 Experimental feature to render off-board-footprint's pads to silk. 2023-09-20 23:28:50 +01:00
Jeff Young 0126841c44 ADDED: 3D appearance setting for off-board silk. 2023-09-20 23:28:50 +01:00
Jeff Young c0ce543464 Use standard KiCad abbreviations for TH and NPTH. 2023-09-20 14:27:57 +01:00
Marek Roszko ee91b550d8 gl_context_mgr and gl_util belong in the gal folder 2023-09-19 23:06:44 -04:00
jean-pierre charras a7b1448ccd Fix a compil warning.
Fix also an incorrect comment.
2023-09-14 15:19:46 +02:00
Jeff Young 8cf291e423 Overhaul 3D degenerate shape protection. 2023-09-14 12:33:54 +01:00
Jeff Young 47dc86c1e2 Run filled-test before degenerate-ring-test.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15642
2023-09-13 23:34:25 +01:00
jean-pierre charras 2c10d5e3a0 Pcbnew: fix some issues with very small arcs (size a few internal units)
these very small arcs do not allow to calculate a reliable center position,
and therefore a reliable radius.
So seeing them as a very small segment fix plotting/drawing issues.
Fixes #15639
https://gitlab.com/kicad/code/kicad/-/issues/15639
2023-09-13 17:54:57 +02: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 7505fd0f37 Profile can live in core 2023-09-07 07:47:01 -04:00
Marek Roszko a6a20bf8dc Evict the Pgm() dependency in GAL 2023-09-06 20:13:46 -04:00
Jeff Young 70bbaae670 Don't attempt to render degenerate 3D shapes.
Sentry KICAD-382
2023-09-04 22:10:47 +01:00
Josue Huaroto 4d84bee6f6
Add Zoom level to the 3D viewer in PCB 2023-09-01 17:51:50 +00:00
Marek Roszko 60af0448c5 Add missing if intending to border check 2023-08-30 22:51:08 -04:00
Marek Roszko 2e58f4ea60 Fix three spots it always failed to check if the border was enabled 2023-08-30 22:39:07 -04:00
Jeff Young 22256c97f3 Fix logic errors in handling board body visibility.
Also fixes a bug where models were placed above the silk when the
solder paste layer was shown, but on the solder paste layer when
it wasn't shown.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15510

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6770
2023-08-26 17:33:57 +01:00
Seth Hillbrand db8e15ce88 Require wxWidgets 3.2
Removes old defines and work arounds for earlier wx versions and adds a
CMake requirement to use at least 3.2 (or the minimum matching wxPython
version)
2023-08-23 22:02:56 +00:00
Jeff Young 0c37e3c443 Remove realistic-mode (and duplicated settings from preferences).
Most of these settings are now available in the appearances panel.
It was concluded in a Zulip discussion that any missing items can
be added back in time if people find they need them (ie: complain).

Also hooks up 3DViewer to the common language framework.
2023-08-23 14:07:58 +01:00
Ian McInerney 2d8b707a3a Remove dummy pad from group before deleting
The dummy pad doesn't need group information, and it asserts when it has
it and is deleted.

Fixes KICAD-3B9
2023-08-21 10:32:50 +01:00
Jeff Young 686704bb31 ADDED: plot control over FP text.
(Also adds said control to "Follow Plot Settings" in 3D viewer.)
2023-08-15 16:56:46 +01:00
Jeff Young f45760062b ADDED: appearances manager for 3D viewer.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12413
2023-08-14 18:08:36 +01:00
Jeff Young 5e112ca78e ADDED: parameterize font metrics and allow customization of overbar height. 2023-08-06 20:57:41 +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
Seth Hillbrand 32ad42a435 Add 3dconnexion driver version check
Re-enable 3dconnexion driver by default as we are able to gate the
driver versions

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13362
2023-07-24 18:09:52 +00:00
Jeff Young a85a2b9cbc Add via solder mask to 3D viewer rendering.
(Of course, only when vias are not tented.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15164
2023-07-12 18:28:02 +01:00
Jeff Young 300a60e88e Eradicate a bunch of calls to dyn_cast. 2023-06-25 11:10:05 +01:00
Ian McInerney 6a2dcd1936 Refactor 3D viewer view into enum class 2023-06-20 21:52:50 +01:00
Mike Williams 993bb84240 PCB_FIELD: bug fixes 2023-06-20 18:34:52 +00:00
Mike Williams 37837dc392 PCB: introduce PCB_FIELD_T 2023-06-20 18:34:52 +00:00
Jeff Young 5875f89531 Centralize text size clamping.
Also introduces alg::clamp to improve readability of
std::max( min, std::max( value, max ) )

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14876
2023-06-03 20:29:51 +01:00