Commit Graph

117 Commits

Author SHA1 Message Date
Wayne Stambaugh 4d128b819a 3D viewer code cleaning round 3. 2020-12-13 18:02:57 -05:00
jean-pierre charras e6550fb92e 3D viewer: fix a draw issue: missing holes.
Fixes #6608
https://gitlab.com/kicad/code/kicad/issues/6608
2020-12-04 16:35:57 +01:00
Jeff Young 7f360a7188 Some renaming in 3D code for better SNR. Also formatting fixes. 2020-11-30 14:38:06 +00:00
Jeff Young 3ca06700fc Formatting. 2020-11-29 20:00:16 +00:00
Jeff Young 9c7c05c161 Mostly formatting cleanup but a few type-casting cleanups too. 2020-11-24 22:16:41 +00:00
Mario Luzeiro 8b9be2e129 3D-Viewer: fixes generations of layer lists
Fixes https://gitlab.com/kicad/code/kicad/issues/6385
2020-11-15 16:55:16 +00:00
Jeff Young bdbb68f813 MODULE -> FOOTPRINT. 2020-11-13 16:04:03 +00:00
Jeff Young 63a54d003e More module -> footprint. 2020-11-13 15:16:24 +00:00
Jeff Young 9106cc19bf Yet another tranche of module -> footprint. 2020-11-13 15:16:24 +00:00
Jeff Young fc9cf1d827 More module -> footprint. 2020-11-13 15:16:24 +00:00
Jeff Young 52a46341db More module -> footprint. 2020-11-13 15:16:24 +00:00
Jeff Young 84dd5108ba Remove some "class_" prefixes from files. 2020-11-13 15:16:23 +00:00
Ian McInerney 11e6cac42b Introduce EGL backend support for the OpenGL canvas
wxWidgets 3.1.5+ on Linux will compile with the Wayland EGL
canvas as the backend instead of the X11 backend. This requires a
version of GLEW compiled with the proper EGL defines and a different
header/code for certain parts that are X11 GLEW specific.

This introduces an in-tree version of GLEW that will be built with the
GLEW_EGL flag then statically linked into the KiCad executables when
EGL support is needed.
2020-11-11 00:41:02 +00:00
Mario Luzeiro 753383d6ec 3D-Viewer: disable layer subtraction operations on non realistic mode 2020-11-10 14:40:42 +00:00
Mario Luzeiro a9be08e1ce 3D-Viewer: skip layers not created
Fixes https://gitlab.com/kicad/code/kicad/issues/6324
2020-11-10 13:57:52 +00:00
Wayne Stambaugh 4ea3914d4e Coverity fixes.
CIDs: 312996, 305508, 305509, 305510, 312992, 312997, 312994, 312995,
312968, and 306650.
2020-11-10 08:50:16 -05:00
Mario Luzeiro 82bd232737 3D-Viewer: mark flag as initialized
Fixes https://gitlab.com/kicad/code/kicad/issues/6331
2020-11-09 13:19:28 +00:00
Roberto Fernandez Bautista 1bbc569151 Fix DoRePaint routine in EDA_3D_CANVAS
- Check that we aren't already painting (return if we are)
 - Check that GLEW functions exist before calling them in 3D canvas and throw exception if they are no longer available
 - Catch above exceptions in paint routine and show an infobar message to the user
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6246
2020-11-07 15:39:57 +00:00
Mario Luzeiro 9454f9df92 3D-Viewer: OpenGL, enable by default the AA
fixes an issue that disables AA when it back from Raytracing mode
2020-11-06 20:21:40 +00:00
Mario Luzeiro 89fea36ddd 3D-Viewer: OpenGL, remove outline polygons where it intersects a hole at edge of board 2020-11-06 20:21:40 +00:00
Mario Luzeiro 4b6c602537 3D-Viewer: OpenGL, cut outline on plated pads 2020-11-06 20:21:40 +00:00
Mario Luzeiro 5e371b5f29 3D-Viewer: OpenGL, fix z-fight issue 2020-11-06 20:21:40 +00:00
Mario Luzeiro 78b461a41d 3D-Viewer: OpenGL outline, implement an outline board cut 2020-11-06 20:21:40 +00:00
jean-pierre charras 73c7154891 Fix another Coverity warning. 2020-10-27 14:16:38 +01:00
Seth Hillbrand f8a4edb1c9 First pass renaming module to footprint
This is mostly in comments and the few remainin text strings that
reference module
2020-10-20 20:49:11 -07:00
Jeff Young 1703729269 Require explicit decl of maxError and errorLocations.
This should reduce both performance issues and clearance issues.
2020-10-13 13:49:07 +01:00
Jeff Young 07f139381b Nullptr safety.
Fixes https://gitlab.com/kicad/code/kicad/issues/5893
2020-10-06 12:49:29 +01:00
Jeff Young 52794b3456 Nullptr safety.
Fixes https://gitlab.com/kicad/code/kicad/issues/5893
2020-10-06 12:08:31 +01:00
Mark Roszko a28a0e14ba Fix conversion warnings 2020-10-05 10:41:14 +00:00
Mario Luzeiro cea1a56f5f 3D-Viewer: set default alpha when import from legacy
keep the current alpha when import colors from stackup.
request a refresh instead of a reload when using OpenGL render.

Fixes https://gitlab.com/kicad/code/kicad/issues/5717
2020-10-02 23:14:42 +00:00
Jeff Young 5b7c6e100d Clip tech layers to board in 3D renderer.
Fixes https://gitlab.com/kicad/code/kicad/issues/4873
2020-10-01 16:50:22 +01:00
Jeff Young 3c01147f10 Fix 3D hole knock-out of silkscreen.
It still doesn't knock-out the board edges, but this is a good first
step.

Fixes https://gitlab.com/kicad/code/kicad/issues/4837
2020-10-01 11:49:28 +01:00
Seth Hillbrand bf3cb0b1d0 Standardize pad type enums 2020-09-30 08:38:35 -07:00
Mario Luzeiro ab57c93c98 3D-Viewer: add selection color as an option 2020-09-28 02:26:25 +00:00
Mario Luzeiro ec3c20bf84 3D-Viewer: do not use selection while on preview 2020-09-28 02:26:25 +00:00
Mario Luzeiro 5205709399 3D-Viewer: use LAYER_SELECT_OVERLAY color for selection
preserve material transparency while rendering as selected
2020-09-28 02:26:25 +00:00
Mario Luzeiro 6bc19dbfe9 3D-Viewer: intercect modules and cooper items
show module and net information.
highlight shapes when selected.
2020-09-28 02:26:25 +00:00
Mario Luzeiro fe51cc947c 3D-Viewer: render 3D shapes in green if footprint is selected 2020-09-28 02:26:25 +00:00
Mario Luzeiro 0ab82ef66a 3D-Viewer: add an option to enable render of plated pads
by default this option is disabled and will render as in previous
version.
2020-09-27 13:35:55 +00:00
jean-pierre charras 98339cd5eb 3d viewer: fix incorrect calculation of pad hole size of vertical shape.
Fixes #5627
https://gitlab.com/kicad/code/kicad/issues/5627
2020-09-15 10:17:31 +02:00
Jeff Young e2bc7557cc Clean up arc/circle polygonization.
1) For a while now we've been using a calculated seg count from a given
maxError, and a correction factor to push the radius out so that all
the error is outside the arc/circle.  However, the second calculation
(which pre-dates the first) is pretty much just the inverse of the first
(and yields nothing more than maxError back). This is particularly
sub-optimal given the cost of trig functions.

2) There are a lot of old optimizations to reduce segcounts in certain
situations, someting that our error-based calculation compensates for
 anyway.  (Smaller radii need fewer segments to meet the maxError
condition.) But perhaps more importantly we now surface maxError in the
UI and we don't really want to call it "Max deviation except when it's
not".

3) We were also clamping the segCount twice: once in the calculation
routine and once in most of it's callers.  Furthermore, the caller
clamping was inconsistent (both in being done and in the clamping
value). We now clamp only in the calculation routine.

4) There's no reason to use the correction factors in the 3Dviewer;
it's just a visualization and whether the polygonization error is
inside or outside the shape isn't really material.

5) The arc-correction-disabling stuff (used for solder mask layer) was
somewhat fragile in that it depended on the caller to turn it back on
afterwards.  It's now only exposed as a RAII object which  automatically
cleans up when it goes out of scope.

6) There were also bugs in a couple of the polygonization routines where
we'd accumulate round-off error in adding up the segments and end up with
an overly long last segment (which of course would voilate the error
max). This was the cause of the linked bug and also some issues with vias
that we had fudged in the past with extra clearance.

Fixes https://gitlab.com/kicad/code/kicad/issues/5567
2020-09-11 11:23:49 +01:00
Mario Luzeiro f0edbd088c 3D-Viewer: fixing z-fight issues 2020-09-08 21:02:20 +00:00
Mario Luzeiro 1ab968e72f 3D-Viewer: render different materials plated and non plated copper
implement on OpenGL
2020-09-08 21:02:19 +00:00
Jeff Young 2251716784 Don't show 3D models with their show flag set to false.
Fixes https://gitlab.com/kicad/code/kicad/issues/5548
2020-09-08 20:42:09 +01:00
Mario Luzeiro 820e3089a2 3D-Viewer: use the correct opacity meaning in the color settings 2020-09-01 01:08:38 +00:00
Mario Luzeiro 40d5746df6 3D-Viewer: Parameterize body board transparency
Fix/workarround raytracing render issues related with refraction
2020-09-01 01:08:38 +00:00
Mario Luzeiro 0302fe5570 3D-Viewer: Parameterize soldermask transparency 2020-09-01 01:08:37 +00:00
Wayne Stambaugh ede39780e2 Remove all debugging output that cannot be disabled.
The use of printf, wxLogDebug, and std::err/std::out causes excessive
debugging output which makes finding specific debugging messages more
difficult than it needs to be.

There is still some debugging output in test code that really needs to
be moved into a unit test.

Add debugging output section to the coding policy regarding debugging
output.
2020-08-18 10:17:36 -04:00
Joshua Redstone ad99d85390 3d-viewer: add option to clip silkscreen around via annular ring
Add more conservative clipping of silkscreen layers around vias.
Clips at outside of annular ring rather than outside of copper plating.
2020-07-16 22:36:06 +00:00
Mario Luzeiro 74c6f6ab82 3D-Viewer: set missing scale and position to the list
Fixes https://gitlab.com/kicad/code/kicad/issues/4826
2020-07-11 16:55:49 +00:00