Commit Graph

40 Commits

Author SHA1 Message Date
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 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
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 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
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
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 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
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
Seth Hillbrand 03813b3751 3d: Fix double-clear in oce loadmodel 2018-10-09 05:37:48 -07:00
Seth Hillbrand 2bab30d9ac Allow Kicad to use OpenCascade
Adds the option of using OpenCascade not just the community edition.

Fixes: lp:1628950
* https://bugs.launchpad.net/kicad/+bug/1628950
2018-05-11 17:04:32 -07:00
Seth Hillbrand 6fb47faebd Workaround for IGES import bug in OCE-0.18
This changes the IGES import parameter precision to be file-defined
instead of hard-coded in KiCad.  OCE-0.18 does not handle faces with
a set of points whose approximation creates a single point.

By allowing the file to set the precision level, we leave it to the
generating program to create a file with non-degenerate faces.

Fixes: lp:1738872
* https://bugs.launchpad.net/kicad/+bug/1738872
2018-04-04 13:03:34 -07:00
Cirilo Bernardo 2b2b73ee4b Fix bug: Footprint add 3D shape recognizes only files with lower case ext on Windows
Fixes: lp:1659027
https://bugs.launchpad.net/kicad/+bug/1659027
2017-02-22 10:22:33 +01:00
Cirilo Bernardo b656a8180a Added 3D plugin for OCE; this plugin is activated by -DUSE_OCE=ON 2016-08-22 15:50:38 +10:00