Commit Graph

209 Commits

Author SHA1 Message Date
jean-pierre charras ae05cd80c3 Remove arcs support in zone outlines: this is a legacy code from FreePCB, never used, never tested, never maintained. 2012-07-31 15:12:51 +02:00
jean-pierre charras f96d557e73 Fix issues in zones creation (DRC and merging) I created in 3658.1 2012-07-30 09:40:25 +02:00
jean-pierre charras 99b90d2fa3 More work on a better support of polygons in Kicad (code cleaning). 2012-07-25 20:46:25 +02:00
jean-pierre charras ef5f1b9e6b Start work on a better support of polygons in Kicad (code cleaning).
Some coding style policy fix.
2012-07-25 09:36:56 +02:00
jean-pierre charras 018b080001 Pcbnew: Add keepout areas (Copper zones without tracks or/and vias).
This is *a work in progress*, so some features are missing, and/or could be modified.
Mainly keepout zones are not yet exported to autorouters, and pads are not taken in account.
Some code cleanup in polygon.*
2012-07-13 20:55:29 +02:00
Dick Hollenbeck d3f9554841 CPolyPt constructors 2012-06-10 04:48:42 -05:00
Marco Mattila 64c1ea5cec Add missing checks and undo support to pcbnew zone duplication. 2012-06-05 14:44:22 +03:00
jean-pierre charras 6d1fe6fe5e Fix 2 minor warning compil (unused variables) 2012-05-16 22:44:21 +02:00
Dick Hollenbeck 3fa7c200b7 Add tools/parser_gen.cpp which is the beginnings of an s-expression parser
generation tool.  For now, it is just an s-expression beautifier using
our "non-specctra mode" version of s-expressions.
2012-04-29 21:57:48 -05:00
jean-pierre charras fa3ebc4043 Define MM_TO_IU_SCALING_FACTOR (scaling factor from mm to internal units) only in convert_to_biu.h
Other scaling factors (MILS_TO_IU_SCALING_FACTOR and DECIMILS_TO_IU_SCALING_FACTOR)
also defined only in convert_to_biu.h.
Allows different scaling value for Gerbview.
Needs more tests.
2012-04-25 21:33:24 +02:00
Dick Hollenbeck 33616f3051 * Add DRECT, DPOINT, and DSIZE (double rect, point, and size) using Torsten's vector2d.h
as a starting point
* Make double Distance() take double arguments and remove internal range checking.
* Start on EDA_DRAW_FRAME::AdjustScrollBars() and use "double" for most all calculations
  in anticipation of setting INT_MAX INT_MIN limits eventually.
2012-04-23 16:56:26 -05: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 72d4b2353b uncrustify math_for_graphics, add copyright legacy_plugin.h 2012-04-17 09:18:14 -05:00
jean-pierre charras 36dac0c14d Pcbnew nanometer: fix hatch lines issue in polyline.cpp
Some minor code cleaning.
2012-04-11 11:47:57 +02:00
Dick Hollenbeck e730219b31 add PCNBEW nanometer support to specctra round-tripper, use micro-meters to do it. 2012-04-10 11:28:26 -05:00
Dick Hollenbeck 107ef8f102 see CHANGELOG.txt 2012-02-19 22:33:54 -06:00
Dick Hollenbeck b90d657cb8 fix bug 921553 2012-02-08 09:06:06 -06: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
Dick Hollenbeck e6c8515873 switch to C++'s false and true from C's FALSE and TRUE 2012-01-22 11:20:22 -06:00
jean-pierre charras 3383d6c8a5 Code cleaning and better comments.
Gebview: fix issue in export to pcbnew (Track arc shapes are now exported, approximated by segments)
2012-01-13 19:35:46 +01:00
jean-pierre charras 1c98200721 Pcbnew: fix issue when KICAD_NANOMETER is defined: when zones use htcth to show zones areas, hatch lines were incorrectly calculated (hunded of thousand lines created)
Eeschema: fix issue in search: search not made in reference strings.
Minor fixes, code cleaning and comment enhancements.
2012-01-10 21:12:46 +01:00
jean-pierre charras 2df818b844 Fix issue in GPcb footprints import.
Better code in test connections in zones.
Very minor other fixes
2011-12-22 09:07:50 +01:00
Dick Hollenbeck b6508af0f4 KICAD_PLUGIN and nanometer intermediate checkin, work in progress... 2011-11-30 15:15:56 -06:00
Dick Hollenbeck cc097762c7 Temporarily reverse out the evolving support for finer Board Internal Units (BIU)s. 2011-11-24 11:32:51 -06:00
Vladimir Ur 09a61396ba Some code restyling: VECTOR_PCB is an array. Cleanup uncontrolled definitions of abs, max, etc. max is now overloaded function and MAX is a macro. 2011-11-15 22:26:06 +04: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
Wayne Stambaugh a338e0e5b3 Minor GCC3 compiler warning fixes. 2011-03-17 09:53:19 -04:00
Marco Mattila d3932f5f25 Pcbnew: Fix add similar/cutout zone. Fix zone corner smoothing for zones with cutouts. 2011-02-23 23:34:28 +02:00
Wayne Stambaugh c9688deedf MSVC compiler error and GCC warning fixes.
* Fixed ambiguous call to sqrt() MSVC compiler error.
* Fixed a bunch of type conversion warnings in GCC 3 (MinGW).
2011-02-22 09:38:48 -05:00
Marco Mattila cbee247737 Add zone corner smoothing to pcbnew. 2011-02-21 21:43:59 +02:00
jean-pierre charras e7d5770f42 Fix some Doxygen warnings.
Eeschema: cleaning code. Start work to enhance annotation algorithm.
Already added an option to annotate using sheet number (sheet 1 uses numbers 100 to 199, sheet 2 uses 200 to 299..).
Works fine if deleting existing annotation, but needs work to be used when the existing annotation is kept .
2011-01-01 18:28:21 +01:00
jean-pierre charras fdb18547a6 Eeschema: fix bug 676532. Minor enhancements. 2010-11-17 19:41:20 +01:00
jean-pierre charras 746dea5ae3 Pcbnew: fix a serious bug in ZONE_CONTAINER::HitTestFilledArea( ) which could break connectivity calculations relative to copper areas.
Fix also very minor issues relative to copper zones.
Update boost::polygon from Boost svn repository.
2010-11-13 20:21:16 +01:00
Dick Hollenbeck 6c9244e8c3 fix function comments, this time ones in *.cpp files until they
can be deleted later if they exist in the headers, or moved to 
headers if they should exist in the headers.
2010-11-12 10:59:16 -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
Dick Hollenbeck 845d61acc5 coding standards consistency updates 2010-11-12 09:17:10 -06:00
jean-pierre charras fd1c159a59 Fix bug in PolyLine.cpp, Fix bug in DRC calculations (see changelog). Cvpcb: move dialog files in dialogs/ 2010-10-28 15:02:07 +02:00
jean-pierre charras a188f9d06e added orto2 patch 2010-10-04 14:58:07 +02:00
jean-pierre charras f1df65c51f DRC code cleaning, and added DRC tests for trapezoidal pads. Needs more tests 2010-09-20 18:21:47 +02:00
charras bee0d118f0 fixed a potential bug in fill zone.
Tried to fix a problem under Vista and Window 7 in fill zone: sometimes Pcbnew crashes.
Could be a bug in Kbool (see changelog).
2010-01-03 16:47:46 +00:00
charras da20f1109f Fixed my filling problem in pcbnew by changing some parameters in kbool
But this problem needs more investigations
2009-11-16 12:10:37 +00:00
charras ab66f9ecba rework on zones:try to fix a filling problem with kbool 2009-11-14 19:47:52 +00:00
charras 4537ac8c99 Fixed cvpcb crash (only when compiled in Debug version) 2009-09-19 16:15:40 +00:00
charras 7776dd61eb use kbool 2.1 in zones calculations. see CHANGELOG for others changes and more info 2009-09-17 17:48:40 +00:00
charras ef2e41e347 2009-09-10 13:04:04 +00:00
charras cfdb28394e Pcbnew: Work on undo/redo in Pcbnew almost finished. 2009-08-23 15:22:44 +00:00
charras cffe0cfcaa support for bezier curves 2009-06-25 20:45:27 +00:00
f3nix 7fc9e5f177 Clean some CMakeLists.txt files. 2009-06-21 13:37:27 +00:00
stambaughw 8bf7911125 Build improvements, compiler warning fixes and build fixes, and lots of clean up.
* Created separate SVN version header.
* Add true config.h for platform dependency checks.
* Add dependency check cmake module.
* Remove some leftover hand crafted make files.
* Remove non-cmake build instructions from COMPILING.txt.
* Fix split _() strings causing Visual C++ compiler error.
* Fix lots of compiler warnings.
* Change project file parameter container from wxArray to boost::vector_ptr.
* Removed lots of redundant header definitions.
* Fixed green_xpm redefinition in ercgreen.xpm.
* Remove some dead code and unnecessary class methods.
2009-05-21 17:42:42 +00:00
charras 13a1c6be37 delete "old" makefiles. Use CMakefiles only 2009-05-07 17:33:05 +00:00
charras 71ca194b68 overbar patch merged mainly in eechema/class_pin.cpp. Some cleanup and compil problem fixes. 2009-04-06 10:56:17 +00:00
stambaughw 689579bde1 Global variable unobfuscation, new library path search, and lots of other changes. See CHANGELOG.txt. 2009-04-05 20:49:15 +00:00
charras f2c03f2b97 gr_basic.cpp now clips filled polygons,using the Sutherland and Hodgman algo to clip the poly against a rectangle
Filled polygons are now correctly displayed under Linux(i hope)
2009-02-20 14:31:16 +00:00
charras c39ef78ddc minor changes. 2009-01-15 20:41:41 +00:00
charras 67fa1ddb92 comments updated 2008-12-03 19:45:57 +00:00
charras 75b3c3bf37 Switch to polygons in zones (old way no more supported)
areas can be now filled using solid polygons, or using segments to fill areas inside polygons.
2008-12-03 10:32:53 +00:00
charras 43f75cda0d code cleaning 2008-11-23 17:43:53 +00:00
charras b3b9c12173 code cleaning 2008-11-23 16:31:35 +00:00
charras 1c6ff86768 Zones now have a min thickness filled area parameter 2008-11-22 20:50:30 +00:00
charras 178bc946e3 First version of pcbnew using polygonal filled areas in zones in rats nets calculations. 2008-11-18 18:13:55 +00:00
raburton ba25d20f1a set eol-style native on new files 2008-11-14 22:40:31 +00:00
charras 521f428c35 Using the last version (1.9) of kbool, downloaded from the wxArt2D project site. 2008-11-14 19:38:58 +00:00
charras b3c064b0b4 Thermal shapes modification for round and oblong pads.
This is a workaround for a bug (i believe) of kbool.
2008-11-09 17:14:53 +00:00
charras 134c07f94b Thermal shapes modification for round and oblong pads.
This is a workaround for a bug (i believe) of kbool.
2008-11-09 15:01:35 +00:00
charras f723c540d0 code cleaning. Some comments translated into English.
Added: Zones unfill in polygon mode
2008-10-29 15:26:53 +00:00
charras 3c97a45f48 code cleaning, and some minor bugs solved 2008-10-25 10:21:46 +00:00
charras 544ca4c90d solved a very subtle bug in polygon_test_point_inside.cpp. Sometimes a point outside a polygon was seen inside the polygon 2008-10-15 17:14:51 +00:00
charras 2c60c00640 Some enhancements about code for zones 2008-10-13 12:01:12 +00:00
charras 72fae7e9e3 updating polygon lib code. A bug removed. 2008-10-12 15:30:23 +00:00
charras b7db0ef850 updating polygon lib code. A bug removed. 2008-10-12 15:29:43 +00:00
charras 7c5feb61e7 pcbnew: insulated islands in copper pour removed 2008-10-11 19:27:43 +00:00
charras 4cccb0dd7e First tests about copper zones filled by polygons, without grid (see changelog)
Only for tests! not for production.
2008-10-02 13:24:31 +00:00
charras ab1df3f1d7 more about non copper zones (see changelog) 2008-09-27 19:26:29 +00:00
charras 27cf4ad0ad pcbnew: addded zones in non copper areas and starting work to use polygons in zone fill algos in not copper areas
work in progress: see changelog
2008-09-26 19:51:36 +00:00
charras 5a904e460a Solved kbool lib compil problem under Windows and wxWidgets shared version
Pcbnew: Add position edition in footprint dialog edition
2008-09-05 16:08:13 +00:00
kajtek1 a8a351327d Fixed compiler warnings 2008-06-20 22:17:59 +00:00
f3nix 6bb111cb8e CMake files cleaning. 2008-06-06 12:39:00 +00:00
raburton 1e1a1bb620 set eol-style native on new files 2008-06-05 18:35:58 +00:00
charras 9131e2a104 compiling problems in kbool 2008-06-02 10:23:50 +00:00
charras 44743723d1 removed GPC library due to its unacceptable license. Using the great and powerfull kbool library insteed 2008-05-30 18:06:21 +00:00
charras b8ea76fe63 Solved netlist problems for multiple parts per package components in complex hierarchies.
B.O.M. generation still have a minor problem wih this.
2008-05-15 11:20:19 +00:00
f3nix 6ed78f5b16 Compiler warnings fixes. 2008-05-01 17:12:38 +00:00
plyatov dd38594d39 Compiler warnings elimination (Thanks to the unknown Martin!). 2008-05-01 16:16:36 +00:00
charras 9039a0a579 minor changes and cleanup 2008-04-03 18:03:42 +00:00
dickelbeck 4a2830e4a4 compiler warning 2008-03-31 13:44:42 +00:00
raburton 2a45c24880 removing 3rd party pdfs from svn, saving a couple of mb from the source tree
moved them to the files section of the kicad-devel yahoo group
2008-03-31 12:19:00 +00:00
f3nix 08467e0959 Kill compiler warnings. 2008-03-30 11:48:18 +00:00
charras 157298ba5b minor changes 2008-03-12 11:49:16 +00:00
f3nix 07a0e142ed Lowercase CMake commands. 2008-03-11 15:57:54 +00:00
CHARRAS 4a0b560766 zone outlines edition refinements 2008-02-01 11:01:32 +00:00
CHARRAS af445e70ea remove the old EDGEZONE class. Cleaning code in polyline.x 2008-01-31 20:53:44 +00:00
f3nix af1c15646f CMake:
* Change tabs to spaces.
* Make Boost required.
2008-01-30 09:42:19 +00:00
dickelbeck 11ddcd8e9b commented out a troublesome assert 2008-01-22 20:38:43 +00:00
CHARRAS e9b3322fc0 On line DRC when creating a zone outline 2008-01-20 19:55:22 +00:00
CHARRAS e6c938856a changed ASSERT to wxASSERT in math_for_graphic.cpp 2008-01-17 16:09:00 +00:00
CHARRAS f85ade75d8 see changelog 2008-01-16 20:37:50 +00:00
CHARRAS 638ab25498 more about zones. 2008-01-06 20:58:27 +00:00
CHARRAS 339a90e7ac Block commands now works with zones. 2008-01-06 12:43:57 +00:00
dickelbeck bd5ca82f63 use pad_shapes.h 2008-01-05 17:30:56 +00:00
CHARRAS 97be005035 Added: Delete cutout outline in zone popup menu 2008-01-05 13:37:51 +00:00
CHARRAS ffd3a7133a more about zones. current No DRC for outlines 2008-01-04 12:27:16 +00:00
CHARRAS 62a28440e0 wxstruct modified and wxPcbStuct.h added. some minor other changes 2008-01-01 11:46:47 +00:00
CHARRAS 738d00ba72 more about new zone handling: fill zones now exists 2007-12-30 18:20:51 +00:00
f3nix cbea44a663 * Fix CMake build.
* Add polygon library.
2007-12-30 03:30:34 +00:00
raburton e126042b1e set eol-style native on new files 2007-12-29 19:27:58 +00:00
CHARRAS 5eda8a52ce First draft (and first code..) about new zone handling 2007-12-29 19:15:58 +00:00
CHARRAS 7e7a793753 some changes about zones: enhanced dialog, and files reorganisation 2007-12-17 20:18:04 +00:00
raburton 4ce4631da6 set eol-style and mime-type properties for new polygon related files 2007-12-08 18:19:48 +00:00
CHARRAS dab0fd9edb added: libraries and infos relatives to polygons (usefull for zone redesign) 2007-12-08 17:49:55 +00:00