235 Commits

Author SHA1 Message Date
Seth Hillbrand 3b09eedb3e Fix VRML submodel scaling for PCBnew exports
When loading VRML files exported by PCBnew with Inline nodes, submodels
were incorrectly scaled. The parent file correctly disabled unit
conversion after detecting a top-level scale transform, but inline
submodels were loaded as separate WRL2BASE instances that defaulted to
legacy unit conversion mode.

Propagate the parent's unit conversion setting to inline submodels so
they use the same scaling behavior as the main VRML file.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19091
2026-01-27 13:02:12 -08:00
Seth Hillbrand 34990d5280 3D Viewer: Apply triangulation location transform for STEP models
When OpenCASCADE returns triangulation data via BRep_Tool::Triangulation(),
it also returns a TopLoc_Location parameter that represents the transformation
from the triangulation's local coordinate system to face coordinates.

The existing code retrieved this location but never applied it to vertex
coordinates, causing some STEP models to display with misplaced or distorted
geometry.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15762
2026-01-25 21:49:54 -08:00
Seth Hillbrand 0800482133 Fix VRML import for PCBnew-exported files with Inline nodes
PCBnew-exported VRML files use a top-level Transform with a scale factor
and reference external component models via Inline nodes.

Skip legacy scaling when we know the export comes from pcbnew and
respect the useInline parameter

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19091
2026-01-09 13:03:56 -08:00
Jeff Young c4b72c386a Formatting. 2025-12-15 16:38:43 +00: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
jean-pierre charras 87cf37c847 wip 2024-08-31 11:38:51 +02:00
jean-pierre charras 19ee73e7f7 STEP exporter: fix some issues:
* do not try to load vrml files for file formats that do not use them
* more tolerant test for step file: search header using up to 3 first lines
instead of only the first line
* dialog export: ensure the file ext is synchronized with the file format
the first time the dialog is opened
* more info messages: now a message is printed if the actual file format of
a 3D file is not recognized
2024-08-31 11:12:12 +02:00
Jeff Young bab97f91cc Tidy up string find API usages. 2024-05-28 15:30:29 +01:00
Wayne Stambaugh 795a9eea60 Coding policy fixes.
This is primarily to change all instances of wxLogDebug with wxLogTrace
so developers do not have to sift through debugging output that is always
dumped.  The only exception is for code blocks built in debug builds and
called on demand for dumping object states.
2024-05-23 07:59:45 -04:00
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
Alex Shvartzkop 9c1ece71a3 Show actual IO_ERROR message at VRML import.
https://gitlab.com/kicad/code/kicad/-/issues/17727


(cherry picked from commit 97b15a1708)
2024-04-11 11:38:40 +00: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
Seth Hillbrand 42f17dfbef Add debugging info to vrml reader 2024-02-02 16:35:32 +01: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
Marek Roszko aa0d39dfe4 Fix the moving truck leaving behind IO_ERROR and friends 2023-10-02 18:16:17 -04:00
Marek Roszko b5d5eb842a Start a kicommon shared lib 2023-09-09 18:04:50 -04:00
jean-pierre charras 3a4f3cb0b8 Minor Coverity and compil warnings fixes. 2023-07-17 16:19:22 +02:00
Marek Roszko dd8dc4e513 Add a sequential read flagged fopen helper
Trying to squeeze out some kind of gain by informing the OS we will read a file sequentially.
In particular our FILE_LINE_READER just uses fgetc until the end
2023-05-10 20:24:27 -04:00
Marek Roszko ea077bc34d Banish ignore.h to core 2023-04-18 22:44:04 -04:00
qu1ck 0c049eccc7 Fix a bunch of compiler warnings 2023-04-11 17:01:30 +00: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
Seth Hillbrand 5ed7e28252 Remove KICAD_OCC build option
We don't really support builds without OCC these days.  Removing to
clear up build flags and settings
2022-08-18 17:06:29 -07:00
Wayne Stambaugh 898ec0d094 Fix wxWidgets 3.1 and later deprecated build warnings.
wxWidgets 3.1 has deprecated wxPATH_NORM_ALL when normalizing file
paths when calling wxFileName::Normalize().  This change keeps the
existing behavior except in places where our own internal
ExpandEnvVarSubstitutions() to expand environment variables.
2022-08-15 08:00:40 -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 7256831944 vrml2 box translation to scenegraph can reserve space in the vectors 2022-07-16 15:23:03 -04:00
Marek Roszko 85fbfae1f4 emplace instead of insert vrml node nodes 2022-07-16 15:20:40 -04: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
Wayne Stambaugh 44e4abde0e Fix X3D model parser.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10385
2022-01-12 18:55:40 -05:00
Ian McInerney e57bde6582 Remove last vestiges of the KICAD_USE_OCE build flag
This build flag was removed in a previous commit, but some last uses
remained.
2021-12-01 15:53:00 +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 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