Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
da20f110
Commit
da20f110
authored
Nov 16, 2009
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed my filling problem in pcbnew by changing some parameters in kbool
But this problem needs more investigations
parent
f2f4cd53
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
debug_kbool_key_file_fct.cpp
pcbnew/debug_kbool_key_file_fct.cpp
+2
-2
PolyLine.cpp
polygon/PolyLine.cpp
+14
-5
No files found.
pcbnew/debug_kbool_key_file_fct.cpp
View file @
da20f110
...
...
@@ -47,8 +47,8 @@ void CreateKeyFile()
fprintf
(
kdebugFile
,
"LASTACC {%s}; # last access time
\n
"
,
sDate_Time
);
fprintf
(
kdebugFile
,
"LIBNAME trial;
\n
"
);
fprintf
(
kdebugFile
,
"UNITS;
\n
#
U
nits are in 0.0001 inch
\n
"
);
fprintf
(
kdebugFile
,
"USERUNITS 1; PHYSUNITS
0.000
1;
\n\n
"
);
fprintf
(
kdebugFile
,
"UNITS;
\n
#
Internal pcbnew u
nits are in 0.0001 inch
\n
"
);
fprintf
(
kdebugFile
,
"USERUNITS 1; PHYSUNITS 1;
\n\n
"
);
}
else
{
...
...
polygon/PolyLine.cpp
View file @
da20f110
...
...
@@ -540,17 +540,19 @@ void ArmBoolEng( Bool_Engine* aBooleng, bool aConvertHoles )
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)
double
DGRID
=
1
000
.0
;
// round coordinate X or Y value in calculations to this (initial value = 1000.0 in kbool example)
// kbool uses DGRID to convert float user units to integer
// kbool unit = (int)(user unit * DGRID)
// Note: in kicad, coordinates are already integer so DGRID could be set to 1
// we choose DGRID = 1.0
// we can choose 1.0,
// but choose DGRID = 1000.0 solves some filling problems
// (perhaps because this allows a better precision in kbool internal calculations
double
MARGE
=
1
0.0
;
// snap with in this range points to lines in the intersection routines
double
MARGE
=
1
.0
/
DGRID
;
// snap with in this range points to lines in the intersection routines
// should always be >= 1/DGRID a MARGE >= 10/DGRID is ok
// this is also used to remove small segments and to decide when
// two segments are in line. ( initial value = 0.001 )
// For kicad we choose MARGE = 1
0, with DGRID = 1.0
// For kicad we choose MARGE = 1
/DGRID
double
CORRECTIONFACTOR
=
0.0
;
// correct the polygons by this number: used in BOOL_CORRECTION operation
// this operation shrinks a polygon if CORRECTIONFACTOR < 0
...
...
@@ -569,7 +571,13 @@ void ArmBoolEng( Bool_Engine* aBooleng, bool aConvertHoles )
Another scaling with Grid is applied on top of it to create space in the integer number for
even smaller numbers.
*/
int
GRID
=
1000
;
// initial value = 10000 in kbool example
int
GRID
=
(
int
)
10000
/
DGRID
;
// initial value = 10000 in kbool example
// But we use 10000/DGRID because the scalling is made
// by DGRID on integer pcbnew units and
// the global scalling ( GRID*DGRID) must be < 30000 to avoid
// overflow in calculations (made in long long in kbool)
if
(
GRID
<=
1
)
// Cannot be null!
GRID
=
1
;
aBooleng
->
SetMarge
(
MARGE
);
aBooleng
->
SetGrid
(
GRID
);
...
...
@@ -579,6 +587,7 @@ void ArmBoolEng( Bool_Engine* aBooleng, bool aConvertHoles )
aBooleng
->
SetSmoothAber
(
SMOOTHABER
);
aBooleng
->
SetMaxlinemerge
(
MAXLINEMERGE
);
aBooleng
->
SetRoundfactor
(
ROUNDFACTOR
);
aBooleng
->
SetWindingRule
(
TRUE
);
// This is the default kbool value
if
(
aConvertHoles
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment