Commit Graph

182 Commits

Author SHA1 Message Date
Jeff Young 47e86d76fb Cleanup prior to adding filled flag. 2020-11-13 21:07:36 +00:00
Jeff Young bdbb68f813 MODULE -> FOOTPRINT. 2020-11-13 16:04:03 +00:00
Jeff Young 522d64968e Yet more module -> footprint. 2020-11-13 15:16:24 +00:00
Jeff Young fc9cf1d827 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 7c60c2e404 Module -> footprint. 2020-11-07 18:50:30 +00:00
Jeff Young 55c25f3cc4 Work around a round-off bug in Clipper.
Fixes https://gitlab.com/kicad/code/kicad/issues/6260
2020-11-02 17:43:13 +00:00
Marek Roszko 304e5faf36 Move wxStringSplit to kicad_string 2020-10-24 00:17:07 -04:00
Jeff Young 59f3fefd17 When polygonizing arcs don't use synthesized center and angle.
Start, mid and end are the "real" properties and come with less
error.

Also collapses two arc polygonization routines into one.

Also fixes DRC checks to be cognizant of arc approximation error.

Fixes https://gitlab.com/kicad/code/kicad/issues/6039
2020-10-23 23:55:45 +01:00
Seth Hillbrand f8a4edb1c9 First pass renaming module to footprint
This is mostly in comments and the few remainin text strings that
reference module
2020-10-20 20:49:11 -07:00
Marek Roszko 84fbb0e382 Remove some includes in random pcbnew files 2020-10-14 20:47:48 -04:00
Jeff Young bbe7573d1c Performance enhancements to roundrect pads and clearance outlines.
Aka: avoid Clipper at all costs.

Fixes https://gitlab.com/kicad/code/kicad/issues/5900
2020-10-14 15:56:43 +01: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 87a220b8e2 more cleanup about removing useless include 2020-10-02 14:51:11 +02:00
Seth Hillbrand bf3cb0b1d0 Standardize pad type enums 2020-09-30 08:38:35 -07:00
Jeff Young d3f8f2b81e Remove confusion between pad->IsOnLayer and pad->IsPadOnLayer 2020-09-30 11:50:51 +01:00
Jeff Young 7e5a6371c1 Cleanup. 2020-09-23 01:14:35 +01: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
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
Mario Luzeiro 1ab968e72f 3D-Viewer: render different materials plated and non plated copper
implement on OpenGL
2020-09-08 21:02:19 +00:00
qu1ck 636285311e Make DRAWSEGMENT::GetRectCorners return vector
... instead of modifying the argument.
This will make the method usable in python API and will not incur
permormance penalty because named return value optimization (NRVO)
is a thing since C++11.
But even if copy is not elided vector is moved instead of copied.
https://en.cppreference.com/w/cpp/language/copy_elision
2020-09-07 05:33:10 +00:00
Jeff Young 56a531109a Don't try and shrink shapes generated from pads.
It ends up being different from shrinking the final outline.
2020-08-28 20:48:47 +01:00
Jeff Young ebb9a636fa Handle differential x:y clearance for solder mask.
Fixes https://gitlab.com/kicad/code/kicad/issues/5363
2020-08-28 14:00:37 +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 4410df50a8 Remove layer check that prevents synthetic layer drawing.
In this particular case it was LAYER_PAD_FR.

Fixes https://gitlab.com/kicad/code/kicad/issues/5190
2020-08-15 17:32:13 +01: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 463100d67f Remove a long-standing hack to keep divots out of adjacent zones.
The new algorithm unions any adjacent zones before doing the
chamfer/fillet and then subtracts the other zones back out afterwards.

Fixes https://gitlab.com/kicad/code/kicad/issues/3812
2020-08-12 22:20:08 +01:00
jean-pierre charras eae739d98e ZONE_CONTAINER::TransformSolidAreasShapesToPolygonSet(): for polygons with outline
thickness, use another algo to create shapes mainly used in 3D viewer.
For the 3D viewer, the calculation time to build zones is significantly faster.
2020-08-12 10:13:54 +02:00
jean-pierre charras 9c817638d9 ZONE_CONTAINER::TransformSolidAreasShapesToPolygonSet(): fix incorrect transform
For zones filled using the new algo (filled areas without thickness), a outline
with thickness was added, that is incorrect.
Used only in 3D viewer.
2020-08-11 11:49:08 +02:00
jean-pierre charras 29d6fe88f0 3D viewer: do not show via/pad shapes of pads not connected on copper layers.
Show the same vias/pad shapes as plot functions.
2020-08-11 11:26:00 +02:00
Seth Hillbrand 370bc89d5a Lowercasing private variables in class_pad 2020-08-10 03:27:27 +00:00
jean-pierre charras 4cf5662ea1 Fix incorrect shape of trapezoidal pad shapes. They were not the same as stable branch. 2020-07-31 14:37:21 +02:00
Jeff Young d85a707385 Move rest of DRC to SHAPE collision architecture. 2020-07-06 20:00:50 +01:00
jean-pierre charras 82da739786 Better calculations in TransformRoundChamferedRectToPolygon().
the old calculations was creating a slightly too small shape for rounded corners.

Now the polygon is outside the perfect shape (as required to create a shape with clearance)

Fixes #4805
https://gitlab.com/kicad/code/kicad/issues/4805
2020-07-05 19:32:07 +02:00
Jeff Young 441dfa30f0 Return individual custom pad shapes instead of a SHAPE_POLY_SET.
Also implements an optional pointer to return the actual distance
from all the SHAPE collision routines.

Fixes https://gitlab.com/kicad/code/kicad/issues/4774
2020-07-02 17:09:15 +01:00
Jeff Young 40a72d9530 Add SH_RECT handling to 3D shape conversion.
Also add some debugging for not-implemented shape cases in other
places to catch simmilar issues in future.

Fixes https://gitlab.com/kicad/code/kicad/issues/4757
2020-06-30 18:32:31 +01:00
jean-pierre charras a229e51962 Pcbnew: fix incorrect clearance of oval pads in zone fill.
(The clearance value was only half of the correct value)
2020-06-29 09:57:36 +02: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 da2b7071b4 WYSISYG custom pad editor.
Fixes https://gitlab.com/kicad/code/kicad/issues/2153

Fixes https://gitlab.com/kicad/code/kicad/issues/2305
2020-06-27 14:37:01 +01: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
Jeff Young 986c1a27cd Make sure line widths (and clearances) are handled on rectangles. 2020-06-20 14:34:53 +01:00
Jeff Young aeed8e6e2c Finish implementation of DRAWSEGMENT::C_RECT.
It's currently only supported in the Footprint Editor.  It could be
easily added to the board editor (all the code is there), but the board
editor is a little short on room in the drawing tools toolbar.
2020-06-15 20:51:31 +01:00
Jeff Young 874f13e29e Fix some issues with rotated oval pads. 2020-05-01 18:49:42 +01:00
Jeff Young 2b6089240a Change super/subscript syntax to ^{foo} and _{foo}. 2020-04-18 21:04:41 +01:00
Jeff Young 9c8941e040 Remove a bunch of globals. 2020-04-16 17:34:46 +01:00