Commit 134c07f9 authored by charras's avatar charras

Thermal shapes modification for round and oblong pads.

This is a workaround for a bug (i believe) of kbool.
parent 1eb6220a
...@@ -5,6 +5,18 @@ Started 2007-June-11 ...@@ -5,6 +5,18 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2008-Nov-8 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
++pcbnew
Thermal shapes modification for round and oblong pads.
This is a workaround for a bug (i believe) of kbool.
New thermal shapes have NO angle < 90 degrees between 2 adjacent segments.
For shapes that have angle < 90 degrees between 2 adjacent segments,
under certains circumstances kbool drops some holes and creates a bad filled area.
(see zones_convert_brd_items_to_polygons.cpp)
2008-Nov-8 UPDATE Dick Hollenbeck <dick@softplc.com> 2008-Nov-8 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
+gerview +gerview
......
...@@ -522,11 +522,29 @@ int CPolyLine::MakeKboolPoly( int aStart_contour, int aEnd_contour, std::vector< ...@@ -522,11 +522,29 @@ int CPolyLine::MakeKboolPoly( int aStart_contour, int aEnd_contour, std::vector<
void ArmBoolEng( Bool_Engine* aBooleng, bool aConvertHoles ) void ArmBoolEng( Bool_Engine* aBooleng, bool aConvertHoles )
{ {
// set some global vals to arm the boolean engine // set some global vals to arm the boolean engine
double DGRID = 1000; // round coordinate X or Y value in calculations to this
double MARGE = 0.001; // snap with in this range points to lines in the intersection routines // input points are scaled up with GetDGrid() * GetGrid()
// should always be > DGRID a MARGE >= 10*DGRID is oke
// DGRID is only meant to make fractional parts of input data which
/*
The input data scaled up with DGrid is related to the accuracy the user has in his input data.
User data with a minimum accuracy of 0.001, means set the DGrid to 1000.
The input data may contain data with a minimum accuracy much smaller, but by setting the DGrid
everything smaller than 1/DGrid is rounded.
DGRID is only meant to make fractional parts of input data which can be
doubles, part of the integers used in vertexes within the boolean algorithm.
And therefore DGRID bigger than 1 is not usefull, you would only loose accuracy.
Within the algorithm all input data is multiplied with DGRID, and the result
is rounded to an integer.
*/
double DGRID = 1.0; // round coordinate X or Y value in calculations to this (initial value = 1000.0 in kbool example)
// Note: in kicad, coordinates are already integer so DGRID can be set to 1
double MARGE = 2.0; // snap with in this range points to lines in the intersection routines
// should always be > DGRID a MARGE >= 10*DGRID is ok
// this is also used to remove small segments and to decide when // this is also used to remove small segments and to decide when
// two segments are in line. // two segments are in line. ( initial value = 0.001 )
double CORRECTIONFACTOR = 500.0; // correct the polygons by this number double CORRECTIONFACTOR = 500.0; // correct the polygons by this number
double CORRECTIONABER = 1.0; // the accuracy for the rounded shapes used in correction double CORRECTIONABER = 1.0; // the accuracy for the rounded shapes used in correction
double ROUNDFACTOR = 1.5; // when will we round the correction shape to a circle double ROUNDFACTOR = 1.5; // when will we round the correction shape to a circle
...@@ -534,13 +552,14 @@ void ArmBoolEng( Bool_Engine* aBooleng, bool aConvertHoles ) ...@@ -534,13 +552,14 @@ void ArmBoolEng( Bool_Engine* aBooleng, bool aConvertHoles )
double MAXLINEMERGE = 1000.0; // leave as is, segments of this length in smoothen double MAXLINEMERGE = 1000.0; // leave as is, segments of this length in smoothen
// DGRID is only meant to make fractional parts of input data which /*
// are doubles, part of the integers used in vertexes within the boolean algorithm. Grid makes sure that the integer data used within the algorithm has room for extra intersections
// Within the algorithm all input data is multiplied with DGRID smaller than the smallest number within the input data.
The input data scaled up with DGrid is related to the accuracy the user has in his input data.
// space for extra intersection inside the boolean algorithms Another scaling with Grid is applied on top of it to create space in the integer number for
// only change this if there are problems even smaller numbers.
int GRID = 10000; */
int GRID = 100; // initial value = 10000 in kbool example
aBooleng->SetMarge( MARGE ); aBooleng->SetMarge( MARGE );
aBooleng->SetGrid( GRID ); aBooleng->SetGrid( GRID );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment