Commit Graph

57 Commits

Author SHA1 Message Date
Alex Shvartzkop 4a60c3b71e 3D viewer: apply OCC colors in order: XCAFDoc_ColorSurf > XCAFDoc_ColorCurv > XCAFDoc_ColorGen
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14906

(cherry picked from commit f15551a6b5)
2024-04-29 01:27:03 +03:00
arturo182 41147dc3b3 kicad_advanced: Make OCE tesselation deflection configurable
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17168
2024-02-29 19:04:39 +00:00
Alex Shvartzkop 9345b73af5 Don't crash when OCC fails to read a model and didn't open the doc. 2023-12-06 03:16:46 +03:00
Alex Shvartzkop e9c5b4755b 3D OCE plugin: make two-sided faces for non-solid shapes (shells).
Fixes single-face shells display in the 3D viewer.
2023-11-22 18:53:59 +03:00
Nimish Telang f7bf3011fb Use bundled Find{CURL,ZLIB}.cmake 2023-03-24 12:54:52 +00:00
Marek Roszko c6540575b5 Fix step colors some more
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13611

I need to refactor the overall structure and know what to do, but ugh lazy
2023-02-14 19:44:20 -05:00
Marek Roszko df022acc11 Fix step model colors again
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13882
2023-02-13 22:21:20 -05:00
Marek Roszko ffaaa17d1c IGES files love faces instead of solids, maybe support them
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/11175
2023-01-29 22:35:07 -05:00
Marek Roszko b154e47774 Start adding support for STEP with RGB+A 2022-09-08 21:49:10 -04:00
luz paz 79fa911e0e Fix various typos
Found via `codespell -q 3 -S *.po,./thirdparty,./Documentation/changelogs -L aactual,acount,aline,alocation,alog,anormal,anumber,aother,apoints,aparent,aray,ba,busses,dout,einstance,leaded,modul,ontext,ot,overide,serie,te,,tesselate,tesselator,tht`
2022-07-21 16:31:41 +00:00
Marek Roszko 25507ad6cf Don't forget to cache bust oce 2022-03-09 21:39:05 -05:00
Marek Roszko 2de4906d65 Avoid loading duplicate shapes due to hierarchy structure
Fix https://gitlab.com/kicad/code/kicad/-/issues/9416
Fix https://gitlab.com/kicad/code/kicad/-/issues/6107
2022-03-09 21:36:23 -05:00
Marek Roszko b438810b6b Fix double parsing solids from step models resulting in triangle z-fighting
Fix https://gitlab.com/kicad/code/kicad/-/issues/9416
Fix https://gitlab.com/kicad/code/kicad/-/issues/9835
Fix https://gitlab.com/kicad/code/kicad/-/issues/10554
2022-02-20 18:51:41 -05:00
Marek Roszko e9f4f5ab2a Fix autocomplete woops resize -> reserve 2022-02-06 12:13:25 -05:00
Marek Roszko d211ef1ea3 Ensure we close the occt document at the end of loading 2022-02-06 11:16:19 -05:00
Marek Roszko 41f54349a5 Replace inserts/push_backs with emplace in some spots 2022-02-05 19:53:31 -05:00
Jeff Young 34a9a165c9 More wide-string declarations. 2022-02-05 22:26:31 +00:00
Seth Hillbrand 098e8f7d9b Revert "cmake: adding KICAD_MACOSX_APP_BUNDLE option"
This reverts commit ea9f960cc1.

Reverted for updates as this currently breaks kicad-mac-builder
2022-01-31 15:57:56 -08:00
Davide Gerhard ea9f960cc1 cmake: adding KICAD_MACOSX_APP_BUNDLE option
ADDED: with cmake KICAD_MACOSX_APP_BUNDLE option the user can disable
the macOS app bundle creation when compiling on macOS. This permit to
use/install KiCad like any other *nix platform (/usr/bin, /usr/share,
ecc.). By default, cmake build the app bundle.
2022-01-28 15:49:37 -08:00
Christoph Moench-Tegeder 8f87638de5 remove references to old OpenCascade API
@mroszko figured out that the "new" API exists in all supported
OpenCascade versions (>=7.3 for KiCad 6), so just remove the old
code.
2021-11-18 04:38:50 +00:00
Christoph Moench-Tegeder 12152d4331 Adapt OCE 3D plugin to OpenCascade 7.6.0
In line with
https://dev.opencascade.org/doc/overview/html/occt__upgrade.html#upgrade_occt760_poly
the Poly_Triangulation does not provide direct access to the internal
arrays anymore - use the accessor functions instead.
2021-11-18 04:38:50 +00:00
Marek Roszko 8baea9004f Bump oce plugin version to cache bust I think
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9458
2021-11-07 09:29:21 -05:00
Marek Roszko d3e5739364 Restore ability to process compound step shapes correctly
Fix #9458
2021-11-06 00:55:52 -04:00
Marek Roszko f2783a86e0 On second thought, make the label dump runtime based on enabled log masks 2021-10-15 22:35:47 -04:00
Marek Roszko 0acd707650 Add step label dumping helper 2021-10-11 19:29:15 -04:00
Marek Roszko 4a3658027e Simplify getting the absolute string tag for a label
It actually is roughly equivalent as TagList() does a loop to build the list but this is a bit cleaner to read
2021-10-10 20:47:35 -04:00
Marek Roszko e77cdad6fa Add useful helper function for getting label name 2021-10-10 20:43:57 -04:00
Marek Roszko e81b516a82 Process step components by labels rather than shapes.
Labels are the true structure. Extracting purely just shapes won't get you instances of shapes that are virtually placed by reference labels.

Note, this may break the 3d placement of existing user models but they were most likely wrong loaded in the first place and losing any location data as simple as a boring offset from 0. There's no way to preserve the broken behavior and still allow complex step assemblies to locate correctly.

Fixes https://gitlab.com/kicad/code/kicad/issues/4181
2021-10-09 20:52:00 -04:00
Marek Roszko 8c8d66a181 Add some wxLogTrace to the oce loader 2021-10-07 22:48:19 -04:00
jean-pierre charras 4670309ec1 kicad2step: fix broken handing of UTF8 filenames.
the conversion between UTF8 std::strings and wxString were missing in some places.
3D model: fix management of file having double ext .stp.gz
Fixes #9038
https://gitlab.com/kicad/code/kicad/issues/9038
2021-08-27 16:58:23 +02:00
Wayne Stambaugh 4c457b5ed3 More NULL expunging. 2021-07-18 14:31:55 -04:00
Marek Roszko c794a6ce7a Add pdb install option for msvc 2021-07-14 23:42:45 -04:00
Seth Hillbrand 01426d914a Fix merge error in stpz import
Don't exit early when loading files.  Also adds a busy cursor as STEP
loading can take a while.
2021-03-02 10:34:28 -08:00
Seth Hillbrand 1d3159c1cb Add support for PKZIP-based stpZ files
FreeCAD uses gzip-based stpZ files but many programs will compress using
the archive format of PKZIP (e.g. WinZIP).  This handles the archive
format, taking the first file from the archive, which by the standard
should be the STEP file

Fixes https://gitlab.com/kicad/code/kicad/issues/5376
2021-02-27 16:44:54 -08:00
Marek Roszko 7565f60a03 Swap wxFileInputStream/wxFileOutputStream for the buffered kind 2020-12-12 18:52:02 -05:00
Seth Hillbrand cce11e40a1 Remove errant printf 2020-10-23 12:36:53 -07:00
Seth Hillbrand 75c2d1a0bf Be diligent in our search for color information
Just because we find a label reference does not mean that is where the
color is stored.  We do an exhaustive search through the hierarchy for
the correct color data

Fixes https://gitlab.com/kicad/code/kicad/issues/6107
2020-10-21 15:40:19 -07:00
Ian McInerney b59c7e8632 Add stp.gz as a valid compressed step extension in the chooser dialog
Fixes https://gitlab.com/kicad/code/kicad/issues/5429
2020-10-17 23:20:13 +01:00
Seth Hillbrand b51ca1ab0e Bump OCE Plugin version
We modified how we search for color information.  Changing the version
data will for models to reload instead of keeping the cached data with
(possibly) missing color information
2020-10-14 08:47:49 -07:00
Seth Hillbrand a2168c6add Seach full model for color information
Assemblies may not have their face information in the top level of the
file.  Search recurses to get the explicit shape in sub assemblies as
well.

Fixes https://gitlab.com/kicad/code/kicad/issues/5163
2020-10-13 13:47:59 -07:00
Mark Roszko a28a0e14ba Fix conversion warnings 2020-10-05 10:41:14 +00:00
Seth Hillbrand f1b1e59cf0 Catch error when decompressing
Make sure we catch errors when thrown by zlib

Fixes https://gitlab.com/kicad/code/kicad/issues/5376
2020-08-26 14:19:46 -07:00
Seth Hillbrand 17de78d1dd 3D: fix typo including extension '.'
Fixes https://gitlab.com/kicad/code/kicad/issues/5360
2020-08-25 14:19:27 -07:00
Seth Hillbrand ccdcdf5071 Deal with case-sensitive extensions
Standards that specify differing case in the extension were designed by
marketing departments and should be rejected on sight.  But here we are.
2020-08-25 12:38:45 -07:00
Seth Hillbrand f5371ee65d Fix build issue on MacOS 2020-08-19 06:07:43 -07:00
Ian McInerney c8917a0951 Cleamup some compiler warnings 2020-08-19 11:35:00 +01:00
Seth Hillbrand a38c2aad1f ADDED: Support compressed STEP and VRML files
This adds support for opening .stpZ, step.gz and .wrz files where the
files have been compressed using ZIP or gzip according to the "standard"
published by the MBx volunteer forum at
https://www.cax-if.org/documents/rec_prac_file_compression_v12.pdf

Fixes https://gitlab.com/kicad/code/kicad/issues/2479
2020-08-19 03:20:30 +00:00
Ian McInerney 7bda8178d1 Move library includes to main CMake file
Placing them behind the SYSTEM directive tells CMake to tell
the compiler they are system libraries, so it shouldn't show
warnings created from them.
2020-04-19 01:11:56 +01:00
Seth Hillbrand 6983c56cf8 Use const references where possible
This avoids copy cost on local vars where we only read.
2019-12-05 14:40:22 -08:00
Seth Hillbrand b5f021ff9f Cleanup: Replace push_back with emplace_back
In cases where we create a new item and immediately push into a
container, the emplace idiom is faster and more efficient.
2019-12-05 13:41:21 -08:00