130 Commits

Author SHA1 Message Date
jean-pierre charras
d2cb868829 Pcb editor and 3d viewer: fix some issues:
- Fix incorrect values of displayed layers of blind/buried vias
- Fix possible incorrect layer order in PCB_VIA::SanitizeLayers()
- fix some display issues in 3D viewer.
- fix issue in LAYER_RANGE::Contains(): sometimes the test was incorrect.
2024-09-14 15:57:56 +02:00
jean-pierre charras
02ec8acdb3 3D viewer: fix some issues after layer numbering changes (round 2). 2024-09-13 10:09:18 +02:00
Seth Hillbrand
5e0abadb23 Reorganize layer numbering
F_Cu = 0
B_Cu = 2
Remaining internal copper layers are even and incrementing

Non-copper layers are odd and incrementing.

This means that we can no longer do things like:
for( PCB_LAYER_ID layer = F_Cu; layer <= B_Cu; ++layer)
Instead, we have the class LAYER_RANGE:
for( PCB_LAYER_ID layer : LAYER_RANGE( F_Cu, B_Cu) )

Similarly, gt/lt tests should not refer to the integer value of the
layer.  We have functions such as IsCopperLayer to test whether a layer
is copper or not.

When using the connectivity RTree, the third dimension is layer, so we
provide B_Cu with the special INT_MAX value, ensuring that elements
between F_Cu and B_Cu will be identified.  There is a new, special
function GetBoardLayer() for interfacing with CN_ITEMS

Similarly, PNS layers remain unchanged and sequential.  A set of
interface functions is provided to map PNS layers to Board layers and
back.  This allows the PNS_LAYER_RANGE to function as expected
2024-09-06 23:07:58 +00:00
jean-pierre charras
1f608ec2b0 3D viewer: add option to use board editor copper colors for copper layers.
This is useful to analyze multilayers boards
2024-08-24 10:16:18 +02:00
Seth Hillbrand
0e1f7bceb4 Fix some copy-pasta 2024-07-09 09:35:55 -07:00
Seth Hillbrand
cc850d0da0 Split out LSEQ/LSET from LAYER_ID
Separate the layer grouping classes for easier modification
2024-07-08 20:59:46 -07:00
Seth Hillbrand
293075426b Clean up some LSEQ functions
We are derived from std::vector now.  We don't need our own prima donna
increment and dereference overload as these just create bloat and
non-standard coding practices
2024-07-08 20:59:46 -07:00
Jon Evans
5fc0f1f51e ADDED: Independent control of front/back via tenting 2024-06-11 21:50:25 -04:00
Jon Evans
4aab9f59aa ADDED: Support tenting control of individual vias
REMOVED: Tenting option from plot dialog (tenting is now
         controlled from Board Setup and via properties)

See https://gitlab.com/kicad/code/kicad/-/issues/2402
2024-06-11 21:25:02 -04:00
Alex Shvartzkop
16e3692e71 Build time optimizations. 2024-04-27 23:49:13 +03:00
jean-pierre charras
8754f6867f 3D viewer: fix some graphic issues:
Avoid issue when a copper layers thickness is 0 (min value is now 1 micrometer)
Fix incorrect rendering of plated graphic items and vias (vertical walls not drawn)
2024-03-28 14:52:31 +01:00
Alex Shvartzkop
f9ad0a434d Fix assert in BOARD_ADAPTER::createLayers. 2024-03-04 15:09:31 +03:00
Alex Shvartzkop
85b1978408 Use 64-bit type to represent microseconds.
int and long are 32-bit on Windows, causing overflows.
2024-03-03 21:40:26 +03:00
Jeff Young
e445249720 ADDED: PCB tables. 2024-02-24 20:05:51 +00:00
jean-pierre charras
4c61a79e47 3D viewer: show "not covered by solder mask" graphic items with the right color.
Previously, only pads and tracks were using the gold color when not covered by
the solder mask layer.
Fixes #16892
https://gitlab.com/kicad/code/kicad/-/issues/16892
2024-02-09 11:35:38 +01: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
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
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
Jeff Young
f97af9f254 Experimental feature to render off-board-footprint's pads to 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
Jeff Young
8cf291e423 Overhaul 3D degenerate shape protection. 2023-09-14 12:33:54 +01:00
Marek Roszko
7505fd0f37 Profile can live in core 2023-09-07 07:47:01 -04: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
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
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
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
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
c71cf21e2f Use rendered text to generate bounding box for knockout text.
Don't open-code knockout text shape generation in several different
places.

Make sure triangulated knockout text gets clearance added when
specified.

Collapse duplicated footprint text item plot routine (they're no
longer any different from plotting pcb text items).
2023-05-28 17:20:11 +01:00
Jeff Young
3b63d70d01 Centralize NPTH has-annulus processing.
Fixes https://gitlab.com/kicad/code/kicad/issues/13437
2023-04-08 15:06:49 +01:00
Jeff Young
bbd6c80507 Collapse FP_* down into their PCB_* equivalents. 2023-03-31 22:57:46 +01:00
Jeff Young
203f0f66fb Guard 3D viewer against degenerate shapes.
Fixes https://gitlab.com/kicad/code/kicad/issues/13693
2023-01-29 22:40:12 +00:00
Jeff Young
d16b23d16e Name shortening and line-break reduction. 2022-10-21 18:41:39 +01:00
Jeff Young
19b00b5d57 Cleanup. 2022-08-01 13:09:51 +01:00
Jeff Young
6f49b57f9b Cleanup & performance enhancements. 2022-08-01 13:09:51 +01:00
Jeff Young
0dc857b5ab Clean up pad handling in 3D viewer.
Most importantly, create F_Cu/B_Cu layers if they're otherwise empty
but we have plated pads to render on them.

Fixes https://gitlab.com/kicad/code/kicad/issues/10207
2022-03-06 13:57:12 +00:00
jean-pierre charras
9fec8aa269 3D viewer: disable thickness rendering on tech layers when disabled for copper.
Building the vertical walls around shapes to show layer tickness is very
time consuming. It can be disabled for copper layers but was always enabled
for other layers.
Now layer thickness is enabled or disabled for all layers.
2022-03-01 11:29:35 +01:00
Jeff Young
5739505aa3 TextBoxes for PCBNew. 2022-01-31 20:00:47 +00:00
Jeff Young
236feeb592 Cleanup GRText APIs, 3D Viewer <-> board APIs, and Plotter APIs.
Also fixes a bug where outline fonts weren't being handled for footprint
text in 3D Viewer, and a copy/paste error in stroke font handling for
both PCB and footprint text in 3D Viewer.

Fixes https://gitlab.com/kicad/code/kicad/issues/10319
2022-01-10 14:17:11 +00:00
Marek Roszko
2d1357dc54 Swap some of the 3d viewer to VECTOR2I 2021-12-29 14:20:40 -05:00
Jeff Young
68d2630d08 Flatten a layer of indirection out of 3D config settings. 2021-12-24 13:08:54 +00:00
Jeff Young
4b6bf3095a Radial dimensions.
ADDED radial type dimensions.

Fixes https://gitlab.com/kicad/code/kicad/issues/2056
2021-12-23 19:34:54 +00:00
Jeff Young
6c0110ecd3 Naming conventions.
There's nothing "legacy" about the OpenGL 3D renderer.
2021-10-21 14:30:03 +01:00