Commit Graph

57 Commits

Author SHA1 Message Date
Jeff Young 9a654ec8b9 wxT-ify utils. 2022-02-09 17:04:32 +00:00
Marek Roszko ebda02255c Fix step pcb coloring 2021-09-13 21:18:22 -04:00
Marek Roszko 4f861e084d Give the board boards unique names in STEP exports 2021-09-12 17:43:26 -04:00
Marek Roszko f42505b422 Expand the board in the step export to an assembly always 2021-09-11 22:56:16 -04:00
Jeff Young 6960ac04d4 Cleanup & formatting. 2021-09-04 18:10:25 +01:00
jean-pierre charras 47d5682b14 kicad2step: fix compatibility with wxWidgets 3.0
(commit 4670309 uses 2 functions existing only in 3.1.x)
2021-08-27 19:02:55 +02: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
Jeff Young 4736578793 Fix long-standing typo. 2021-08-14 13:16:11 +01:00
Jeff Young 507b386c79 Rationalize STEP file warnings
1) Use consistent terminology and formatting
2) Capitalize STEP
3) Don't double-report errors in MessageBox and REPORTER

Fixes https://gitlab.com/kicad/code/kicad/issues/7670
2021-08-14 11:08:49 +01:00
Wayne Stambaugh d36fbb864f KiCad2Step code cleaning. 2021-07-29 07:10:58 -04:00
jean-pierre charras 702c0d6f72 Step export: shows a report message if a 3D model is not loadable:
- When a vrml model is specified and model substitution is not allowed
- When the model substitution is allowed but the step model is not found
2021-07-08 17:22:33 +02:00
Jeff Young 4025603a1f Formatting. 2021-07-06 21:36:27 +01:00
Seth Hillbrand b891b5e1e2 Do not blindly substitute model names
Makes model substitution (VRML->STEP in STEP Export) optional.  This can
prevent nasty surprises where the user doesn't see/can't affect the
outcome

Also, when substituting models, do not maintain scale factor.  So a VRML
model with non-unity scaling will not be export as a STEP file (of the
same name) with non-unity scaling.  This is the first step to address
https://gitlab.com/kicad/code/kicad/-/issues/1781
2021-06-08 16:38:47 -07:00
Marek Roszko ab82b01714 Evict the last bits of wx.h 2021-06-07 20:23:27 -04:00
jean-pierre charras d7616fdca8 Fix a few compil or coverity warnings. 2021-06-01 09:04:37 +02:00
Karl Palsson 658bc2f4b2 kicad2step: provide a basic default product name
It would be ideal if it would use the s-expr
kicad_pcb.general.title_block.title by default, and then fall back to
something based on the output step file, but even just the output step
file is a far better default than the "open cascade step translator
version..." text it uses at the moment.

Similar improvements using the title_block would be future work.

Signed-off-by: Karl Palsson <karlp@etactica.com>
2021-03-04 17:01:07 +00: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
Mikołaj Wielgus a9feb1c2d4 Update PCBMODEL::SetMinDistance to set BRepBuilderAPI precision
Fixes #3818
2021-01-03 08:40:40 +00:00
Marek Roszko 7565f60a03 Swap wxFileInputStream/wxFileOutputStream for the buffered kind 2020-12-12 18:52:02 -05:00
Dominik Wernberger 99da663e82 Remove unused variables plus some more fixes from CppCheck
Remove unused variables plus a few more fixes from CppCheck

Remove unused variables plus a few more fixes from CppCheck
2020-11-19 02:28:47 +00:00
Werni 0e44f5128c Add const specifiers 2020-11-18 19:50:36 +00:00
jean-pierre charras d4eb7b0f3d Step export: fix Bezier curves export.
Fixes #6054
https://gitlab.com/kicad/code/kicad/issues/6054
2020-10-21 10:18:03 +02:00
jean-pierre charras 7414a62947 Attempt to support Bezier curves in STEP export: a fix.
The curve is still exported as segment
2020-10-20 18:40:01 +02:00
jean-pierre charras 12b106aba4 Attempt to support Bezier curves in STEP export. First code.
The bezier curves are in this code replaced by a segm between
the 2 ends curves
2020-10-20 16:45:38 +02:00
jean-pierre charras f18fb9fe64 Step exporter: fix a wxWidgets alert.
Fixes #4760
https://gitlab.com/kicad/code/kicad/issues/4760
2020-10-06 21:40:39 +02:00
jean-pierre charras 63471d861d Step exporter: avoid crash when the board to export has not closed outlines. 2020-10-06 16:03:43 +02: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 d0e43ab9f1 STEP: Export stpz files
Also include .stpz files as alternates to wrl/wrz models
2020-08-25 19:27:44 -07:00
jean-pierre charras 265f28afe1 Fix a minor compil warning and a Coverity warning 2020-07-30 10:40:51 +02:00
jean-pierre charras fd6c9c7685 kicad2step: fix a bug when the board has no hole.
kicad2step was trying to remove an empty hole list, generating a OCC error.

Fixes #4242
https://gitlab.com/kicad/code/kicad/issues/x4242
2020-04-22 10:43:28 +02:00
jean-pierre charras 5143f87678 Kicad2step: Many fixes in oce_utils.
- Better code and messages.
- Speedup calculations when removing cutouts and holes from main board.
- Do not stop step generation when trying to load a 3D modele having issues.
2020-04-15 11:44:12 +02:00
jean-pierre charras b68bdc22d7 Fix in kicadpcb reader. Update dialog export step
kicad2step: code cleanup, and more activity messages displayed
2020-04-15 10:51:35 +02:00
jean-pierre charras 110b05fe78 kicad2step: convert it from a wxAppConsole to a wxApp, using a wxFrame/wxPanel 2020-04-15 10:51:35 +02:00
Yegor Yefremov 99a28fa3e5 Fix typos in comments. 2020-03-24 16:24:53 +00:00
jean-pierre charras ad3c4b37ab Fix a few coverity warnings 2020-02-01 15:15:51 +01:00
Seth Hillbrand c6f5df134c Minor speed cleanup
This adjusts iterators to use const reference when only used for
copy.  It also ensures pre-allocation of vectors when size is known
ahead of time.
2019-12-05 14:20:59 -08:00
jean-pierre charras d77ba30a95 Replace __WXDEBUG__ (improperly used) by DEBUG in some #define.
__WXDEBUG__ comes from a build option of wxWidgets,
and is not related to a Debug versus Release Kicad build.
2019-10-14 11:17:38 +02:00
Simon Schubert a0ed40876d kicad2step: scale models
Fixes: lp:1784257
* https://bugs.launchpad.net/kicad/+bug/1784257
2019-08-15 14:29:03 -07:00
Maciej Suminski c120ae9e9d kicad2step: Implement overwrite protection, handle 'force overwrite' flag
Fixes: lp:1791826
* https://bugs.launchpad.net/kicad/+bug/1791826
2018-09-11 09:23:31 +02:00
Seth Hillbrand d3c82b0b57 kicad2step: limit small segment add/remove
The addition of very small segments in OCE triggers sliver
removal/cleanup in the BREP generation that can get stuck in a very long
loop during STEP export of boards.  These were introduced to ensure
closure of boards with small gaps that were too big for OCE to consider
joined.

Removing the small segments allows STEP export to proceed in a
reasonable time.  This also decreases the default minimum gap size that
kicad2step uses to determine curve matching.  This prevents mis-matching
small curves

Fixes: lp:1784626
* https://bugs.launchpad.net/kicad/+bug/1784626
2018-09-06 18:44:09 -07:00
Maciej Suminski a08c0ac08c kicad2step: Added minimum distance parameter 2018-06-19 10:37:07 +02:00
Maciej Suminski 04a462e48f kicad2step: Converted #defines to constexprs 2018-06-19 10:37:07 +02:00
Maciej Suminski 1541cbdf04 kicad2step: Add short segments to fix outline contiguity for arcs
STEP exporter keeps outline contiguous by storing the last point
coordinates and using them as the starting point for the next segment. It
might create a problem for arcs, as one of the arc end points may become
translated (changed to the last outline point), while the remaining
points (center and the other endpoint) are kept original. For large
deltas it renders an arc invalid, as it cannot pass through a modified
endpoint anymore.

To fix this, short segments are added to link the last outline point
with an arc endpoint, but only if the distance between the two is below
a certain threshold. This way the outline is kept contiguous and the arc
end point is unmodified, warranting its correctness.

Fixes: lp:1774351
* https://bugs.launchpad.net/kicad/+bug/1774351
2018-06-19 10:29:18 +02:00
Maciej Suminski ba3f2b30ee kicad2step: More diagnostic messages to determine export issues 2018-06-18 17:51:22 +02:00
jean-pierre charras 6d77e594b5 Python binding: fix pcbnew.Refresh() to make a better re-initialization.
Minor fixes in comments.

Fixes: lp:1775003
https://bugs.launchpad.net/kicad/+bug/1775003
2018-06-07 10:04:29 +02: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
Maciej Suminski eebabf165b kicad2step: Report lack of model definition rather than empty file names 2018-03-19 17:04:38 +01:00
Maciej Suminski 47e4798423 kicad2step: Report function name and line number only in debug builds 2018-03-19 17:04:38 +01:00
Oliver b80449b069 Fixes for 3D model offset
- Display offset units in 3D preview window (inches or mm)
- Fix offset in 3D renderer
- Fix offset in Raytracing renderer
- Fix offset in STEP export
- Fix offset in VRML export
2017-11-20 17:46:03 -05:00
Wayne Stambaugh f3908bd87c Revert premature commit of 17ab319b, "Fixes for 3D model offset".
This reverts commit 17ab319b99.
2017-11-11 20:04:46 -05:00