Commit Graph

61 Commits

Author SHA1 Message Date
jean-pierre charras 9ed0f2184b Fix: Gerber plot output creates incorrect custom pads when a rectangular anchor pad with x size > y size is used.
Fixes: lp:1738384
https://bugs.launchpad.net/kicad/+bug/1738384
2017-12-15 12:33:28 +01:00
jean-pierre charras bdc6a5950b rename plot_common.h to class_plotter.h, a better name, consistent with other class definitions. 2017-11-16 15:53:30 +01:00
jean-pierre charras f074b57094 Pcbnew: fix minor issue in %TO.C advanced attribute, and avoid creating an unused D10 tool in Gerber files. 2017-07-02 16:41:31 +02:00
jean-pierre charras 4f2ed1b05f Plot gerber: fix a minor issue: an aperture attribute was incorrectly set on non copper layers when drawing some pads. 2017-05-04 08:55:17 +02:00
jean-pierre charras 873e57e63e remove useless or incorrect wxASSERTs 2017-04-21 14:32:06 +02:00
Jon Evans a52250a91e Change from EDA_COLOR_T to COLOR4D globally; arbitrary color support
eeschema now supports arbitrary colors for all object types, and
pcbnew does in GAL canvas.  When switching from GAL to legacy canvas,
pcbnew will convert colors to the nearest legacy color.
2017-02-22 17:35:00 +01:00
jean-pierre charras e9c0dc1a2b Fix a minor issue when creating net attributes in Gerber files for oval pads when they are not horizontal or vertical . 2016-09-25 10:55:24 +02:00
jean-pierre charras 6edee2ae1d Prepare Plot Gerber file to include advanced aperture and net attributes.
This option is not yet activated because the net attributes are not yet fully fixed by Ucamco, in Gerber file format specifications.
(To activate it, see dialog_plot.cpp, line 43)
2016-09-19 13:01:36 +02:00
jean-pierre charras 829fa97f3c Gerber files: ensure the "level polarity dark" is set in each file (this is the default, but ensuring that is better and can avoid issues when panneling files) 2016-04-14 09:32:35 +02:00
jean-pierre charras 5658ed9c8e Prepare rounded rect and custom shaped pads: add plot functions. It fixes also a pcbnew crash in HPGL mode when plotting trapezoidal pads. 2016-02-10 17:02:40 +01:00
unknown 71b3125d8e Cleanup: remove unnecessary macros EXCHG and NEGATE. add MIRROR macro. 2015-06-26 15:41:56 +02:00
jean-pierre charras 85bc2ae015 Rework on Gerber plot functions: add X2 attributes in J5 version. Minor code cleaning. 2015-03-25 14:07:05 +01:00
jean-pierre charras b1cd42cf08 Pcbnew: simplify draw code in default canvas and plot functions by removing the plot LINE option, which is not existing in all plotters, not existing in opengl/cairo canvas, and not usefull in default canvas. 2015-02-02 09:06:39 +01:00
jean-pierre charras 7b5318ff64 Fix minor issues about translated strings and coding style. Add comment relative to file function info in X1 gerber file format. 2014-10-31 19:59:37 +01:00
Wayne Stambaugh e8362df15f Add missing source file licenses and code policy fixes. 2014-10-19 16:20:16 -04:00
jean-pierre charras 9c64b061fe Pcbnew: fix Bug #1380943 (Filled polygons with thick outlines are missing last outline thick segment in gerber)
Remove a debug message in searchhelpfilefullpath.cpp.
2014-10-17 20:30:56 +02:00
jean-pierre charras cab7e67b59 fix Bug #1345193: Drill Map coordinates alway 0 when using Gerber format (due to a missing plotter initialization). 2014-07-21 11:42:36 +02:00
jean-pierre charras 49884da3e6 Gerber files generation: fix a rounding issue when drawing circles. (explains bug Bug #1339086 ).
Gerbview: allows x.7 format (recently indroduced in Gerber format)
Also minor coding style fixes.
2014-07-09 18:31:39 +02:00
jean-pierre charras ab58dbfced Pcbnew: Rework on Gerber ouput: allows choice between format 4.5 and 4.6. Fix a minor issue in Gerber layers attributes.
fix print issue when printing each layer on a separate page.
2014-07-04 16:22:38 +02:00
jean-pierre charras 8a1fd49377 Minor fixes in Gerber files, in file attribute for copper layers. 2014-07-01 21:20:38 +02:00
jean-pierre charras a543f99eb3 Enable technical layers when starting Pcbnew with no board.
Use format 4.6 (full resolution of Pcbnew) in Gerber files to avoid the creation of self-intersecting polygons.
2014-06-30 17:46:47 +02:00
jean-pierre charras b50872edca Gerber output: Some changes after evaluation of Gerber files by Ucamco (the manager of GERBER format):
* default file ext is now .gbr (the "official extension")
* some outdated commands remoded.
* mainly use mm and 4.5 format instead of inches and 3.4 format. this is mandatory,
  because the 3.4 format (comming from old pcbned internal units) creates truncations in coordinates.
  (with serious issues in polygons which can appear self-intersecting afer truncation)
2014-06-30 12:00:21 +02:00
jean-pierre charras 9ee8dac056 Pcbnew, python console: make it not dockable (workaround to avoid the fact accelerator keys which are used in the main menu are not sent to the console, in docked mode).
Minor cosmetic enhancement.
2014-06-19 08:26:53 +02:00
jean-pierre charras 41e41b95f8 Plot DXF: better generation of filled zone polygons. 2014-05-16 21:03:45 +02:00
jean-pierre charras 4374e25219 Plot functions: some enhancements in mirror mode (Pcbnew specific): boards are mirrored horizontally, and the page layout is no more mirrored, and therefore is always readable. 2013-12-06 19:31:15 +01:00
jean-pierre charras dd64b2f284 3D board display: better rendering of the board: the board polygon outlines (generated by the specctra function) is now used to create the 3D body of the board. 2013-10-04 10:42:09 +02:00
Lorenzo Marcantonio 8430508272 Closes bug 1176915
Mass parameters in gerbers can't use scientific notation (altough some software 
allow it), so the %g format was not correct.
2013-05-06 19:47:01 +02:00
Lorenzo Marcantonio d00c83cde9 Migrated the interfaces accepting angles to the double type
The plan goes like this:
- eeschema still uses int in decidegrees
- all the other things internally use double in decidegrees (or radians
  in temporaries)
- in pcbnew UI the unit is *still* int in decidegrees

The idea is to have better precision everywhere while keeping the user with int i
angles. Hopefully, if a fractional angle doesn't come in from the outside, everything
should *look* like an integer angle (unless I forgot something and it broke)

When the time comes, simply updating the UI for allowing doubles from the user should
be enough to get arbitrary angles in pcbnew.
2013-05-05 09:17:48 +02:00
Lorenzo Marcantonio 78e41187b3 Moved utilities for angles in trigo.h
New conversion routines and sin/cos implementation for angles in decidegrees
2013-05-02 20:06:58 +02:00
Lorenzo Marcantonio 0e903dba5b Angle and distances cleanup (preparing for angles in doubles)
- Removed spurious int casts (these are truncated anyway and will break
  doubles)

- Applied the Distance, GetLineLength, EuclideanNorm, DEG2RAD, RAD2DEG
  ArcTangente and NORMALIZE* functions where possible

- ArcTangente now returns double and handles the 0,0 case like atan2, so
  it's no longer necessary to check for it before calling

- Small functions in trigo moved as inline
2013-05-01 19:32:36 +02:00
jean-pierre charras 621a43c4ad Eeschema: always stores sheet filename in unix-like notation, and fix a bug when editing sheet file name.
Pcbnew: add PDF format  for drill map generation.
Plotter classes: tweaking code.
2012-10-13 20:54:33 +02:00
Lorenzo Marcantonio 7cef5395b3 Minor plot driver enhancements 2012-08-29 22:13:47 +02:00
Marco Mattila 9e20800f8c Fix axis offset issue in pcbnew gerber circular interpolation. 2012-07-18 22:32:47 +03:00
Marco Mattila 5a6c088bd9 Use circular interpolation for circles and arcs in pcbnew gerber plots. 2012-07-15 20:28:52 +03:00
jean-pierre charras 61acac28e1 Add patch from Lorenzo Marcantonio. Fix some warning issues, and zlib issue under Windows (zlib sources added) 2012-05-03 20:37:56 +02:00
Dick Hollenbeck c24863c078 // Dick Hollenbeck's KiROUND R&D
// This provides better project control over rounding to int from double
// than wxRound() did.  This scheme provides better logging in Debug builds
// and it provides for compile time calculation of constants.


#include <stdio.h>
#include <assert.h>
#include <limits.h>

//-----<KiROUND KIT>------------------------------------------------------------

/**
 * KiROUND
 * rounds a floating point number to an int using
 * "round halfway cases away from zero".
 * In Debug build an assert fires if will not fit into an int.
 */

#if defined( DEBUG )

// DEBUG: a macro to capture line and file, then calls this inline

static inline int KiRound( double v, int line, const char* filename )
{
    v = v < 0 ? v - 0.5 : v + 0.5;
    if( v > INT_MAX + 0.5 )
    {
        printf( "%s: in file %s on line %d, val: %.16g too ' > 0 ' for int\n", __FUNCTION__, filename, line, v );
    }
    else if( v < INT_MIN - 0.5 )
    {
        printf( "%s: in file %s on line %d, val: %.16g too ' < 0 ' for int\n", __FUNCTION__, filename, line, v );
    }
    return int( v );
}

#define KiROUND( v )    KiRound( v, __LINE__, __FILE__ )

#else

// RELEASE: a macro so compile can pre-compute constants.

#define KiROUND( v )  int( (v) < 0 ? (v) - 0.5 : (v) + 0.5 )

#endif


//-----</KiROUND KIT>-----------------------------------------------------------

// Only a macro is compile time calculated, an inline function causes a static constructor
// in a situation like this.
// Therefore the Release build is best done with a MACRO not an inline function.
int Computed = KiROUND( 14.3 * 8 );


int main( int argc, char** argv )
{
    for( double d = double(INT_MAX)-1;  d < double(INT_MAX)+8;  d += 2.0 )
    {
        int i = KiROUND( d );

        printf( "t: %d  %.16g\n", i, d );
    }

    return 0;
}
2012-04-19 01:55:45 -05:00
Dick Hollenbeck b8a0ab4c52 switch to <> for includes from "" per conversation with Jean-Pierre and Wayne, adjust search paths 2012-01-22 22:33:36 -06:00
Wayne Stambaugh b774d96fb0 Minor coding policy and code readability improvements. 2012-01-03 12:14:17 -05:00
Wayne Stambaugh cd0b231656 Minor fixes, dead code removal, and coding policy fixes.
* Use version of DateAndTime that returns a wxString and delete the
  version that takes a char* as it is no longer required.
* Merge StrNumICmp() and StrLenNumICmp() into StrLenNumCmp() to create a
  single function for comparing strings with integers and remove a lot
  of duplicate code.
* Remove unused strupper from string.cpp.
* Use wxArrayString for sorting the EDA_LIST_DIALOG contents.
2011-11-08 11:37:25 -05:00
Wayne Stambaugh 4230ac4ca7 Remove sine and cosine look up tables and other minor fixes.
* Remove sine and cosine look up tables from trigo.cpp and replace them with
  sin() and cos() math functions.
* Large include file clean up to prevent header ordering dependency build
  failures.
* Translate French code names and comments.
* Lots of coding style policy and doxygen comment fixes.
2011-09-20 09:57:40 -04:00
jean-pierre charras 4402c97c7a Eeschema: Fix a subtle bug in undo command when editing texts and labels.
Add a new schematic item: SCH_BITMAP. One can insert now images in a schematic.
Add Fabrizio Tappero as contributor  in Kicad About dialog
2011-08-31 16:59:20 +02:00
Wayne Stambaugh baa0d7920a EESchema bug fixes and other minor changes (fixes lp:793373).
* Fix debug build warning (lp:793373).
* Changed sheet edit restore and undo to use object copy and replace method.
* Add minimum width and height constraints when resizing sheets that have
  hierarchical pins.
* Fix drag sheet hot key bug.
* Change Doxygen configuration to extract private methods and members
  when creating documentation.
* Fix a bunch of Doxygen comment warnings.
2011-06-07 11:29:01 -04:00
jean-pierre charras 864426fb71 Pcbnew: fix bug 792399.
dialog_about: add translator name.
2011-06-06 08:51:42 +02:00
jean-pierre charras c89070da83 Plot poly code cleaning. Suppress erreurs for malformed polygons (< 2 corners) 2011-04-20 10:13:21 +02:00
jean-pierre charras 92952b70aa Use UTF-8 encoding only in kicad files. Under Linux, this was already the case. Under Windows, texts with non ascii characters must be corrected.
This ensure compatibility between platforms.
2011-02-28 19:36:19 +01:00
jean-pierre charras a9010796e0 Doxygen comment warning fixes. 2010-12-29 18:47:32 +01:00
Wayne Stambaugh 7cb34aece7 Schematic component object encapsulation and Doxygen comment warning fixes. 2010-12-14 10:56:30 -05:00
jean-pierre charras e9f557e65a Pcbnew plot functions: code cleanup, coding policy fixes and minor enhancements 2010-12-11 19:40:39 +01:00
Marco Mattila 9dc9cc1f78 Board manufacturers typically do not print silkscreen on areas without
soldermask. Nevertheless, it would be nice to have proper gerbers to
begin with, i.e., gerbers with no silkscreen in soldermaskless areas.
Of course, most of the problem can be taken care of by drawing the
footprints properly. However, sometimes the silkscreen of one
footprint ends up on the pads of another one (think components under a
so-dimm card, for example). The attached patch adds an option to
subtract the soldermask from the silkscreen when doing gerber output.

marco
2010-12-06 16:05:12 -06:00
Dick Hollenbeck 636b2d301e function comments, fix ones in *.cpp files until they can be deleted if they exist in the headers 2010-11-12 10:36:43 -06:00