Commit Graph

765 Commits

Author SHA1 Message Date
Érico Rolim 55a726e933 Fix sg_version detection for cross compilation
Fixes https://gitlab.com/kicad/code/kicad/issues/4525

(cherry picked from commit e9e72bd8e4)
2020-05-28 13:19:10 -04:00
jean-pierre charras 9c2bb85858 3D viewer: fix a minor problem: to many rotations when typing
Shift+z or Shift+y more than once.

From master, commit 00d9e77e
2020-03-31 17:48:50 +02:00
jean-pierre charras 85fa6d8025 3D viewer: apply patch from master 04d6ea982.
The 3D viewer does not show the issue on solder paste layer having
negative clearance.
However the bug was here and not seen just because some draw code was different:
The code tried to draw outlines with segments having a negative thickness.
It happens mainly on solder paste layers.
2020-03-27 10:36:14 +01:00
jean-pierre charras bd1fb845b1 3D viewer: fix a minor issue in solder paste rect pads:
the solder paste mask clearance was no taken in account
for rect and trap shapes.
2020-03-25 13:47:48 +01:00
Wayne Stambaugh 445bc75319 3D Viewer: fix broken check for write image permission check.
Fixes https://gitlab.com/kicad/code/kicad/issues/4081

(cherry picked from commit d8e99dc5be)
2020-03-21 17:20:04 -04:00
Wayne Stambaugh ad11b7ebd0 3D viewer: fix double warning attempting to save screen shot file.
Fixes https://gitlab.com/kicad/code/kicad/issues/4028.

(cherry picked from commit fc20f9f0b2)
2020-03-16 13:09:02 -04:00
Ian McInerney a530b600b8 Smoothen rotation in 3D viewer when crossing the 0-2pi line
Rotating to 0 when above pi would result in the board spinning back
through pi to get there. This led to jarring motion.

Also fix an issue added in b6f64815 where the board would rotate
2pi when crossing over the 0-2pi boundary.

(Cherry-pick of 4fc9b4e5ab)
2020-01-15 18:10:46 +00:00
jean-pierre charras d494a2bee2 3D viewer: normalize rotation angles between -2_PI and 2_PI.
Fixes #3761
https://gitlab.com/kicad/code/kicad/issues/3761

(Cherry-pick of b6f64815f4)
2020-01-15 16:30:41 +00:00
Ian McInerney 1f3a2dcd1d Fix cherry-pick error
Fixes https://gitlab.com/kicad/code/kicad/issues/3744
2020-01-08 09:41:01 +00:00
Mario Luzeiro 4205cb32c5 3d-viewer, make ortho projection zoom similar as prespective projection
Fixes #1843
Fixes reload of Raytracing when the projection button is pressed.

(cherry picked from commit 2c00540ad6)
2020-01-06 19:33:00 -08:00
Mario Luzeiro 6ab9bdb346 3d-viewer, ray-tracing, do not add coincident segments
Fixes #1946 (lp 1852970)

(cherry picked from commit 518c1df81b)
2020-01-06 13:56:25 -05:00
Mario Luzeiro a4aec1919c 3D-viewer: raytracing, implement multiple shape board.
Fixes #1879 (lp:1820099)
Fixes #2126 (lp:1764039)

(cherry picked from commit 37c3e34486)
2020-01-06 13:55:31 -05:00
Michal Jahelka 90fbf27114 c3d_render_ogl_legacy.cpp: initialize m_Emissive member of SMATERIAL to be sure it is set to 0, 0, 0 2019-09-10 17:46:35 +02:00
Seth Hillbrand 65f2af5849 3d: Disable floor rendering by default
The floor render in raytracing creates interesting shadow effects but
significantly increasing the processing time for renders and has the
side effect of making the bottom of the board very dark if you simply
flip it over.  Making this option off by default, we allow power users
to turn it on if needed for their renders while speeding up the default
raytrace and preventing new user confusion.

(cherry picked from commit 4fcfd266e0)
2019-08-16 11:42:21 -07:00
Seth Hillbrand 211d056728 3d-viewer: Remove dead code
The 2d-bbox of the 3d viewer was calculated and set but never used

(cherry picked from commit 59ed9f086f)
2019-08-16 11:01:01 -07:00
Simon Schubert 469c31da97 3d: min dot needs to be square
Given that we compare the dot product (square of length) to s_min_dot,
it means that s_min_dot also needs to be square, or we wind up
converting line segments into circles that are visually distinct from
circles, leading to gaps in polylines.

(cherry picked from commit 0823692dda)
2019-08-15 14:32:32 -07:00
Simon Schubert 5fb41e6ecc 3d canvas: use radius, not width for circles
(cherry picked from commit e01348cccc)
2019-08-15 14:32:32 -07:00
Seth Hillbrand f5284ced54 Allow null path in 3d model
This allows a setting where the path is not one of the options.  This
permits the user to select once to go to any path option (rather than
off the current and then back to currect) when the filetree doesn't
match the dropdown.  This also selects the drop down item if it matches
the tree.
2019-06-20 20:10:25 -07:00
Wayne Stambaugh a6bbe907ee Set about dialog name for 3D viewer frame.
(cherry picked from commit 2f2c358aef)
2019-06-18 15:32:09 -04:00
Mario Luzeiro 1dab468e20 Add some epsilon value to ray dir on orthographic mode
so they will not be zero when viewing the board com the top/bot.
This was causing problems with BBox intersect function that was using
invDir values.

Fixes lp:1828747
https://bugs.launchpad.net/kicad/+bug/1828747
2019-05-14 16:10:54 +02:00
Henner Zeller c5cd0c73a3 Raytracing - a more pleasing way sequencing blocks to render.
(cherry picked from commit 2aea26de1e)
2019-05-14 09:28:55 -04:00
Seth Hillbrand bb779b237a 3d-viewer: Refresh raytracing on rotate
(cherry picked from commit 89d2e67e45)
2019-04-09 15:18:48 -07:00
Seth Hillbrand 1294b4fec8 3d-viewer: Force canvas refresh before screenshot
In some linux configurations, the canvas refresh must be posted before
being handled.  Simply requesting the refresh can queue the event,
preventing an up to date GL canvas from being saved.

Fixes: lp:1819536
* https://bugs.launchpad.net/kicad/+bug/1819536

(cherry picked from commit 707e7b4b65)
2019-04-09 14:47:54 -07:00
John Beard 8b503a06fa 3D viewer: update icons from common settings
Use the icon scaling logic and call a toolbar rebuild when the
common settings change (echos the handling in Pcbnew and friends).

Remove an unused function.

(cherry picked from commit 8548e69382)
2019-04-08 14:30:26 +01:00
John Beard 4a201df556 3D viewer: use hi-DPI settings for canvases
The 3D viewer also uses OpenGL, so it also needs to
adjust based on DPI scale factors.

This patch moves the 3D viewer common config code solely
within the 3D viewer, and adds handling of the DPI scale. This
also avoids duplicated logic in PCB_BASE_FRAME::CommonSettingsChanged.

For now, as EDA_3D_VIEWER is not included in the Kiway settings
dispatch, still manually invoke the settings update from
PCB_BASE_FRAME.

The PANEL_3D_PREV gets a similar function to read the config, but
it doesn't have a listener for the update, so it's set just once
at dialog init, just like the existing pan settings.

Fixes: lp:1823681
* https://bugs.launchpad.net/kicad/+bug/1823681

(cherry picked from commit 124dd5e59a)
2019-04-08 14:30:26 +01:00
Jeff Young e71b215963 Restore 3D canvas to full size on Retina displays. 2019-02-19 16:18:11 -07:00
John Beard e6a6266f3d Build: libpolygon provides its own includes
Libpolygon can provide its own includes via target_include_dirs PUBLIC.
This means any linking targets do not need to specifiy them manually.

As common requires polygon, the polygon dep is also now no longer
required downstream of libcommon, as it's transisitvely implied
by libcommon's target_link_libraries.

This resolves a circular dependency previously detected and also
simplifies CMakeLists.
2019-02-04 19:29:31 -08:00
Seth Hillbrand 4a641ec5ea 3d-viewer: Center the about window
Fixes: lp:1814412
* https://bugs.launchpad.net/kicad/+bug/1814412
2019-02-04 07:18:52 +01:00
jean-pierre charras 098d9bf056 3D viewer: Fix: board outlines ignored in 3D for triangular board shapes
Fix also a few minor coding style issues.

Fixes: lp:1814324
https://bugs.launchpad.net/kicad/+bug/1814324
2019-02-02 17:59:53 +01:00
jean-pierre charras 4543bde56b Minor enhancements in 3D viewer hotkey code 2019-01-31 21:03:38 +01:00
Wayne Stambaugh 75f18cfe62 3D Viewer: disable ray tracing for OpenGL less than 2.1.
Add code to parse OpenGL version string and determine if ray tracing is
supported.

Rationalize ray tracing menu and toolbar to have the same behavior so
a single command ID can be used for setting states.

Fixes lp:1797500

https://bugs.launchpad.net/kicad/+bug/1797500
2019-01-19 08:03:09 -05:00
Wayne Stambaugh 4f0749b0b4 3D viewer: fix update UI event infinite loop.
Lay groundwork to fetch OpenGL version for disabling ray tracing when the
current OpenGL version lacks proper support.
2019-01-13 14:05:21 -05:00
Seth Hillbrand 6f5a7b3ab7 3d-viewer: Clear memset warnings
C++11 can clear by empty copy-constructor
2019-01-09 21:43:23 -08:00
jean-pierre charras 3dd5a912b6 remove dead code. 2019-01-07 19:42:18 +01:00
Seth Hillbrand 1e5ba6f1b1 Replace DIM() macro
The standard DIM() macro was not typesafe as it happily deferred errors
to runtime that can be caught at compile time.  Replacing it with a
generic C++11 constexpr allows for typecasting, comparison and compile
time error checking.
2019-01-06 08:43:12 -08:00
Seth Hillbrand 3b54a44540 wildcard strings update
Replace a few other cases where we used Windows-only or *nix specific
wildcard strings
2019-01-05 20:26:45 -08:00
Seth Hillbrand a46f5c3af5 3d-viewer: Clamp inner radius of rings
Thick segments can cause radius to be set negative.  Effective radius of
these segments should be 0.

Fixes: lp:1803797
* https://bugs.launchpad.net/kicad/+bug/1803797
2019-01-04 16:49:21 -08:00
Seth Hillbrand 25f8b1ce72 pcbnew: Update multiple zone segments
Where we can get away with lower segment counts (localizing an anchor),
we keep the low-def 16 segment count.  Intermediate values and values
that are visible to the user are set to high definition.  Most are
simply hints to the inflation correction but where they show, the user
show see smooth lines.
2019-01-03 17:34:59 -08:00
Seth Hillbrand 6662891f34 string update: Help->List hotkeys
The hotkey name "Help (this window)" does not describe what the hotkey
and associated action does.  It displays the current hotkey list, so the
action name should reflect that behavior
2019-01-02 15:44:13 -08:00
Stefan Brüns 9490fd9d30 Use absolute path CMAKE_INSTALL_FULL_LIBDIR for 3d viewer PLUGINDIR
Currently, the plugindir in the plugin manager is constructed as
{CMAKE_INSTALL_PREFIX}/bin/../{CMAKE_INSTALL_LIBDIR}/kicad/..., while
CMakes install uses {CMAKE_INSTALL_LIBDIR}/kicad/...

In case CMAKE_INSTALL_LIBDIR is a relative path "install" prefixes it
with CMAKE_INSTALL_PREFIX and both paths happen to match, otherwise
the constructed path ends up as e.g. "/usr/bin/../usr/lib/kicad/...".

For these cases where an absolute path is wanted CMake provides the
CMAKE_INSTALL_FULL_<dir> variants which works the same as
CMAKE_INSTALL_<dir> when used as DIRECTORY for install.
2018-12-11 14:28:01 -05:00
Seth Hillbrand 0769b0409f 3d-viewer: Remove threading on middle layer
The middle layer of the 3d contours does not need threading as it does
not have substantial calculations.  It also contains has a few
wx*Asserts that may not be called from other than the main thread.
Rather than remove useful error checking, we remove excess threading.

Fixes: lp:1802940
* https://bugs.launchpad.net/kicad/+bug/1802940
2018-12-10 19:51:32 -08:00
Seth Hillbrand 47fe01f793 3d-viewer: Remove duplicate call
Simplify is called by GetBoardPolygonOutlines(), it does not need to be
called a second time.
2018-12-09 07:52:58 -08:00
Wayne Stambaugh c7998cfc23 3D Viewer: fix screenshot file extension bug with GTK+
Append the appropriate file extension to the file name if the file name
does not have a file extension.  This is a know issue with the GTK+ file
dialog.

Make the last 3D viewer screenshot last file used code more coherent.

Add the 3D viewer main frame trace string to the trace environment
variables doxygen group.

Doxygen comment and other minor code cleaning.

Fixes lp:1804980

https://bugs.launchpad.net/bugs/1804980
2018-12-08 08:20:32 -05:00
jean-pierre charras 90139d540c 3D viewer: Fix hanging when a board is displayed in non realistic mode and the body is not shown. 2018-11-26 15:58:54 +01:00
jean-pierre charras a3b82d770e dialog_3D_view_option_base.cpp: fix a minor wxWidgets alert. 2018-11-26 14:49:06 +01:00
jean-pierre charras 65a967dca1 Fix minor I10n issues. 2018-11-18 14:40:36 +01:00
Jeff Young bcc8c64256 Consider edge cuts items to have zero width when filling zones.
Fixes: lp:1797787
* https://bugs.launchpad.net/kicad/+bug/1797787
2018-11-14 23:45:32 +00:00
Mario Luzeiro 350a6052c0 Fixes 3D Viewer: Raytracing line artifact, lp:1680530 2018-11-14 09:46:03 -05:00
John Beard e52688586a Don't use memset to initialise aggregate of floats.
In C3D_RENDER_OGL_LEGACY::setupMaterial(), the struct
m_materials (which is made up of floats and glm::vec3f's)
is initialised with a memset to 0. This is unsafe, as
floating point value representations in C++ are implementation-
defined (so 0 in memory is not 0-valued for sure).

Use empty-brace aggregate-initialisation, which does the right thing.
2018-11-13 13:37:59 -05:00
jean-pierre charras 830c5e7db7 3D viewer: ensure 0 sized circles (that crash the viewer) are skipped. 2018-11-05 08:30:54 +01:00