149 Commits

Author SHA1 Message Date
Jeff Young
31100451c6 Fill in some missing 3D render code.
1) add footprint graphics and text to copper
polys when differentiating plated from non-plated
copper

2) simplify adding footprint graphics and text
for contour walls

3) add dimension text and shapes for contour walls

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20111
2025-04-23 10:41:36 +01:00
Jeff Young
824c7ecfa7 Improve readability.
Also drops a parameter that hasn't been implemented
since early 2022.
2025-03-19 08:55:32 +00:00
Jeff Young
142f8265c5 Simplify (and fix) plated copper differentiation.
Also a few fixes for 3D rendering textboxes and
tables.
2025-03-17 20:11:20 +00:00
Jeff Young
683444733a Formatting. 2025-03-17 20:11:20 +00:00
Jeff Young
f33f10bb38 User-defined layers for 3D viewer. 2025-03-15 16:14:33 +00:00
Jeff Young
f3f9730f2c Render tables & their borders to 3D view.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19981
2025-03-13 14:04:31 +00:00
Jeff Young
50174ec528 Beware of infinite recursion on colliding hatched shapes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20264
2025-03-08 21:23:14 +00:00
Jeff Young
f00947266f Don't render thickness walls of text we're not going to draw.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20200
2025-03-04 11:29:05 +00:00
Jeff Young
28684cfeba Formatting. 2025-02-24 11:08:29 +00:00
jean-pierre charras
ca5f867957 F3D viewer: fix incorrect code in commit becaba53 2025-01-20 17:47:34 +01:00
jean-pierre charras
becaba531b 3D Viewer: fix incorrect render of platted copper of texts.
Previously, with option "Use bare copper color for unplated copper", the
plated area of texts were drawn using their bounding box.
2025-01-20 17:15:49 +01:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
Seth Hillbrand
e9bc8cfe9d Give Clipper1 a Viking funeral
Clears out the last spot where we were only using Clipper1 (how'd I
miss that?) and remove all calls to the Clipper1 structures
2024-12-23 17:12:09 -08:00
Alex Shvartzkop
c3fb1445c7 Fix assert failures in 3D renderer after padstack changes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19069
2024-11-05 19:41:20 +03:00
Andrzej.W
b49ebaeb16 ADDED: Soldermask layer option for graphic shapes
Allows adding a soldermask opening for shapes on a copper layer.
Soldermask expansion can also be specified.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/2125
2024-10-10 12:46:06 +00:00
Andrzej Wolski
537d3ac81a ADDED: Soldermask layer option for tracks
Allows adding a soldermask opening for individual tracks.
Soldermask expansion can also be specified.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/2125
2024-10-08 02:48:33 +00:00
Jon Evans
2a605e4a4e Infrastructure and file format for via stacks 2024-10-06 18:45:25 -04:00
Jon Evans
56e0811516 Phase 2 of padstack support
CHANGED: PCB file format now supports saving/loading complex padstacks

CHANGED: PTH pads are now rendered per copper layer in the copper color;
         the PTH pad color is no longer used.

ADDED: support for importing complex pad stacks from Altium PCBs

Enforce padstack-aware access to pad properties across KiCad

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8182
2024-10-01 19:55:03 -04:00
jean-pierre charras
c45938d50b 3D viewer: fix incorrectb rendering of mask layers with blind/buried vias
Blind/buried vias not on a external copper layer are also not on the mask layer.
2024-09-15 10:00:34 +02:00
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