Commit Graph

147 Commits

Author SHA1 Message Date
jean-pierre charras 5e742d97b6 Export VRML: fix bug that prevent to merge 3D footprint shapes to the board file.
Fixes #9127
https://gitlab.com/kicad/code/kicad/issues/9127
2021-09-09 18:05:17 +02:00
jean-pierre charras 567767346c VRML exporter: fix broken export, at least on msys2.
For an obscure reason, some floating values were fully broken. the small
change in code fixes this strange issue.
2021-09-09 16:08:51 +02:00
Anton Lazarev 42086a455d fix blind via early return in VRML exporter 2021-07-25 12:22:55 +00:00
Wayne Stambaugh cf00319c85 More NULL expunging. 2021-07-20 07:27:18 -04:00
Wayne Stambaugh 9d348d7e6d Coverity issue fixes. 2021-07-06 13:32:34 -04:00
Wayne Stambaugh 175b474c3e Coverity issue fixes.
Fixes issues #280412, #314755, #329615, #332459, #332157, #332167,
2021-06-30 18:08:49 -04:00
Jeff Young 096e342386 Prefix TRACK, ARC and VIA. 2021-06-11 22:07:02 +01:00
Marek Roszko 10e60acf34 Clean up including of board_design_settings.h 2021-06-06 15:03:42 -04:00
Marek Roszko 4712d7a918 Remove a leaky wx/msgdlg.h include 2021-06-06 08:45:38 -04:00
Marek Roszko 03cf2b517f Enum class PAD_ATTR_T
Renamed such that python stays the same
2021-05-01 10:51:54 -04:00
jean-pierre charras 4a53917efa wrml exporter: optimize circle to segment approximation. 2021-03-20 18:16:58 +01:00
Jon Evans c04e19f9ac Include optimization: move some things from common.h to point-of-use 2021-03-20 12:09:18 -04:00
jean-pierre charras 6d5536707c wrml exporter: remove all duplicate code with Pcbnew. Especially, converting layers to polygons exist in Pcbnew, so no need to rebuild item shapes in the exporter. Moreover, in exporter, rebuilding shapes was not up to date and did not include changes in Pcbnew. 2021-03-20 13:44:52 +01:00
jean-pierre charras 4073153e75 vrml exporter: fix incorrect export of zones on solder mask layers. minor changes in colors. 2021-03-20 11:13:55 +01:00
jean-pierre charras 3fec3a3a15 Fix a minor Coverity warning 2021-03-19 15:01:16 +01:00
jean-pierre charras af88b01068 export_vrml: Better export of pad shapes, both on copper and paste layers.
It removes duplicate code between Pcbnew and the vrml exporter.
Remove also an useless option (plain board) that exported just the board body.
2021-03-18 20:43:27 +01:00
jean-pierre charras 8d5161dae2 export_vrml: more code cleanup and export solder mask 2021-03-18 16:44:28 +01:00
jean-pierre charras 16ef1910ff export_vrml: more code cleanup and fix incorrect shape of round chamfered pads 2021-03-18 13:35:06 +01:00
jean-pierre charras 074f0432f0 vrml exporter: more cleaning code and enhancements. Dialog exporter: Add option to use board center as coord origin. 2021-03-18 09:52:04 +01:00
jean-pierre charras b050823c98 export_vrml.cpp: mainly clean code and add some fixes. 2021-03-18 09:52:03 +01:00
Seth Hillbrand 283d176cdc Use std::locale::classic() globally
This is a better alternative when imbuing streams
2021-02-26 17:21:55 -08:00
Seth Hillbrand 8ee324b1a9 Add bezier output to VRML 2021-01-10 11:28:15 -08:00
Wayne Stambaugh f311831c27 Coverity fixes.
280252, 314742, 314745, 314747, 314755, 314756, 314757, 314758,
314935, 314936
2020-12-20 13:24:47 -05:00
Jeff Young 9c7c05c161 Mostly formatting cleanup but a few type-casting cleanups too. 2020-11-24 22:16:41 +00:00
Jeff Young b123318cf6 Encourage use of full DRC for board & footprint malformed outlines.
It shows much more detail.  Removes some nag dialogs and places
hypertext links in others.

Also fixes the auto-layer-showing to correctly show Edge.Cuts or
F.CrtYd or B.CrtYd for errors relating to them.

Fixes https://gitlab.com/kicad/code/kicad/issues/6446
2020-11-20 17:24:52 +00:00
Werni 0e44f5128c Add const specifiers 2020-11-18 19:50:36 +00:00
Marek Roszko 16e3e59495 Split out arrayDim and MIRROR templates from macros.h
These were not macros
2020-11-17 20:21:04 -05:00
Jeff Young bdbb68f813 MODULE -> FOOTPRINT. 2020-11-13 16:04:03 +00:00
Jeff Young 63a54d003e More module -> footprint. 2020-11-13 15:16:24 +00:00
Jeff Young 2cc9dad4ff More module -> footprint. 2020-11-13 15:16:24 +00:00
Jeff Young 52a46341db More module -> footprint. 2020-11-13 15:16:24 +00:00
Jeff Young f5443de7f9 D_PAD -> PAD. 2020-11-13 15:16:24 +00:00
Jeff Young 84dd5108ba Remove some "class_" prefixes from files. 2020-11-13 15:16:23 +00:00
Jeff Young f7333ad64a Update some classnames including archaic zone names. 2020-11-12 10:31:25 +00:00
Jeff Young 1703729269 Require explicit decl of maxError and errorLocations.
This should reduce both performance issues and clearance issues.
2020-10-13 13:49:07 +01:00
Jeff Young 37906511f5 Class renaming.
DRAWSEGMENT  -> PCB_SHAPE
EDGE_MODULE  -> FP_SHAPE
TEXTE_PCB    -> PCB_TEXT
TEXTE_MODULE -> FP_TEXT
2020-10-05 11:55:33 +01:00
Jeff Young 7a4900b8dc PCB_LINE_T -> PCB_SHAPE_T and PCB_MODULE_EDGE_T -> PCB_FP_SHAPE_T
Also updated footprint text and zone types for consistencey.
2020-10-04 16:49:04 +01:00
jean-pierre charras 0b23cb7dbb more cleanup about removing useless include 2020-10-03 15:26:03 +02:00
Seth Hillbrand bf3cb0b1d0 Standardize pad type enums 2020-09-30 08:38:35 -07:00
Jeff Young 4badcba4c2 Zone fill performance improvements
1) better load-balancing for deferred zones
2) sort zones by priority before filling
3) retire BOARD::GetZoneList() which had a horrible performance profile
4) implement a zone bounding box cache
5) better checks for IsCancelled() so long fills can be exited

Fixes https://gitlab.com/kicad/code/kicad/issues/5738
2020-09-21 21:09:58 +01:00
Ian McInerney b1160660d9 Check return value for zone fill in VRML exporter
If the zone fill failed, then don't add the zone to the
exported VRML because it might not be correct.

Also test that the Python command in DIALOG_SCRIPTING worked.
This dialog actually isn't used anywhere currently, so it
could in theory be removed - but it is simple enough and
it provides a decent testing dialog that it is more work to remove
it.
2020-09-21 12:32:30 +01:00
Jeff Young e2bc7557cc Clean up arc/circle polygonization.
1) For a while now we've been using a calculated seg count from a given
maxError, and a correction factor to push the radius out so that all
the error is outside the arc/circle.  However, the second calculation
(which pre-dates the first) is pretty much just the inverse of the first
(and yields nothing more than maxError back). This is particularly
sub-optimal given the cost of trig functions.

2) There are a lot of old optimizations to reduce segcounts in certain
situations, someting that our error-based calculation compensates for
 anyway.  (Smaller radii need fewer segments to meet the maxError
condition.) But perhaps more importantly we now surface maxError in the
UI and we don't really want to call it "Max deviation except when it's
not".

3) We were also clamping the segCount twice: once in the calculation
routine and once in most of it's callers.  Furthermore, the caller
clamping was inconsistent (both in being done and in the clamping
value). We now clamp only in the calculation routine.

4) There's no reason to use the correction factors in the 3Dviewer;
it's just a visualization and whether the polygonization error is
inside or outside the shape isn't really material.

5) The arc-correction-disabling stuff (used for solder mask layer) was
somewhat fragile in that it depended on the caller to turn it back on
afterwards.  It's now only exposed as a RAII object which  automatically
cleans up when it goes out of scope.

6) There were also bugs in a couple of the polygonization routines where
we'd accumulate round-off error in adding up the segments and end up with
an overly long last segment (which of course would voilate the error
max). This was the cause of the linked bug and also some issues with vias
that we had fudged in the past with extra clearance.

Fixes https://gitlab.com/kicad/code/kicad/issues/5567
2020-09-11 11:23:49 +01:00
Jeff Young 452171e055 Remove more dead code (mostly includes). 2020-08-31 17:29:44 +01:00
Jeff Young 9e12ea9bb6 Cleanup some dead code and make better use of iterators.
Also applies coding style around auto and lambdas.
2020-08-28 11:05:58 +01:00
Jeff Young 8fc8e2c5f1 Add support for RECTs to VRML exporter. 2020-08-22 22:17:23 +01:00
Wayne Stambaugh ede39780e2 Remove all debugging output that cannot be disabled.
The use of printf, wxLogDebug, and std::err/std::out causes excessive
debugging output which makes finding specific debugging messages more
difficult than it needs to be.

There is still some debugging output in test code that really needs to
be moved into a unit test.

Add debugging output section to the coding policy regarding debugging
output.
2020-08-18 10:17:36 -04:00
Jeff Young 393bb0fd83 Fix assert where geometry routine wasn't ready to handle layers.
This introduces layer handling to a lot of the geometry routines.
Many of them don't do much with it now, but it does help multi-layer
zones and will help when padstacks are implemented.
2020-08-12 22:20:08 +01:00
Jeff Young a6d44676b3 Move commit handling outside of ZoneFiller.
This allows us to rever the commit on a cancel.

Fixes https://gitlab.com/kicad/code/kicad/issues/5107
2020-08-12 22:20:07 +01:00
Jon Evans 0d4ee39f75 CHANGED: Copper zones can be on more than one layer
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1963
2020-06-28 08:52:37 -04:00
Jeff Young d01b29ab37 Cleanup pad geometry handling.
There were a lot of plotters, exporters, etc. that were rolling their
own implementations.

This also introduces a lazily-built set of SHAPE objects for doing
collision detection and some forms of rendering (and later DRC).
2020-06-22 22:28:37 +01:00