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
9131e2a1
Commit
9131e2a1
authored
Jun 02, 2008
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiling problems in kbool
parent
44743723
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
28 deletions
+37
-28
makefile.include
gerbview/makefile.include
+2
-1
makefile.gtk
makefile.gtk
+1
-1
pcbframe.cpp
pcbnew/pcbframe.cpp
+1
-1
PolyLine.cpp
polygon/PolyLine.cpp
+12
-9
PolyLine.h
polygon/PolyLine.h
+19
-14
_dl_itr.cpp
polygon/kbool/include/_dl_itr.cpp
+1
-1
_lnk_itr.cpp
polygon/kbool/include/_lnk_itr.cpp
+1
-1
No files found.
gerbview/makefile.include
View file @
9131e2a1
EXTRALIBS
=
../common/common.a ../bitmaps/libbitmaps.a ../polygon/lib_polygon.a
EXTRALIBS
=
../common/common.a ../bitmaps/libbitmaps.a
\
../polygon/lib_polygon.a ../polygon/kbool/src/libkbool.a
EXTRACPPFLAGS
=
-DGERBVIEW
-DPCBNEW
-fno-strict-aliasing
\
EXTRACPPFLAGS
=
-DGERBVIEW
-DPCBNEW
-fno-strict-aliasing
\
-I
./
-I
../gerbview
-I
../include
\
-I
./
-I
../gerbview
-I
../include
\
...
...
makefile.gtk
View file @
9131e2a1
MAKEGTK
=
$(MAKE)
-f
makefile.gtk
MAKEGTK
=
$(MAKE)
-f
makefile.gtk
KICAD_SUBDIRS
=
common bitmaps 3d-viewer polygon pcbnew eeschema eeschema/plugins cvpcb kicad gerbview
KICAD_SUBDIRS
=
common bitmaps 3d-viewer polygon p
olygon/kbool/src p
cbnew eeschema eeschema/plugins cvpcb kicad gerbview
KICAD_SUBDIRS_BIN
=
eeschema eeschema/plugins pcbnew cvpcb kicad gerbview
KICAD_SUBDIRS_BIN
=
eeschema eeschema/plugins pcbnew cvpcb kicad gerbview
KICAD_SUBDIRS_RES
=
internat modules template library
KICAD_SUBDIRS_RES
=
internat modules template library
KICAD_SUBDIRS_HELP
=
help
KICAD_SUBDIRS_HELP
=
help
...
...
pcbnew/pcbframe.cpp
View file @
9131e2a1
...
@@ -572,7 +572,7 @@ void WinEDA_PcbFrame::GetKicadAbout( wxCommandEvent& event )
...
@@ -572,7 +572,7 @@ void WinEDA_PcbFrame::GetKicadAbout( wxCommandEvent& event )
/**********************************************************/
/**********************************************************/
{
{
wxString
extra_message
=
wxString
extra_message
=
wxT
(
"
\n
Pcbnew uses the kbool library
(boolean operations on sets of 2d polygons)
\n
"
);
wxT
(
"
\n
Pcbnew uses the kbool library
\n
"
);
extra_message
<<
wxT
(
"version "
)
<<
wxT
(
KBOOL_VERSION
)
extra_message
<<
wxT
(
"version "
)
<<
wxT
(
KBOOL_VERSION
)
<<
wxT
(
"
\n
see http://boolean.klaasholwerda.nl/bool.html
\n
"
);
<<
wxT
(
"
\n
see http://boolean.klaasholwerda.nl/bool.html
\n
"
);
...
...
polygon/PolyLine.cpp
View file @
9131e2a1
...
@@ -30,19 +30,22 @@ CPolyLine::CPolyLine()
...
@@ -30,19 +30,22 @@ CPolyLine::CPolyLine()
CPolyLine
::~
CPolyLine
()
CPolyLine
::~
CPolyLine
()
{
{
Undraw
();
Undraw
();
if
(
m_Kbool_Poly_Engine
)
delete
m_Kbool_Poly_Engine
;
}
}
/** Function NormalizeWithKbool
/** Function NormalizeWithKbool
* Use the Kbool Library to clip contours: if outlines are crossing, the self-crossing polygon
* Use the Kbool Library to clip contours: if outlines are crossing, the self-crossing polygon
* is converted to non self-crossing polygon by adding extra points at the crossing locations
* is converted to non self-crossing polygon by adding extra points at the crossing locations
* and reordering corners
* if more than one outside contour are found, extra CPolyLines will be created
* if more than one outside contour are found, extra CPolyLines will be created
* because copper areas have only one outside contour
* because copper areas have only one outside contour
* Therefore, if this results in new CPolyLines, return them as std::vector pa
* Therefore, if this results in new CPolyLines, return them as std::vector pa
* @param
pa
: pointer on a std::vector<CPolyLine*> to store extra CPolyLines
* @param
aExtraPolys
: pointer on a std::vector<CPolyLine*> to store extra CPolyLines
* @param bRetainArcs == TRUE, try to retain arcs in polys
* @param bRetainArcs == TRUE, try to retain arcs in polys
* @return number of external contours, or -1 if error
* @return number of external contours, or -1 if error
*/
*/
int
CPolyLine
::
NormalizeWithKbool
(
std
::
vector
<
CPolyLine
*>
*
pa
,
bool
bRetainArcs
)
int
CPolyLine
::
NormalizeWithKbool
(
std
::
vector
<
CPolyLine
*>
*
aExtraPolyList
,
bool
bRetainArcs
)
{
{
std
::
vector
<
CArc
>
arc_array
;
std
::
vector
<
CArc
>
arc_array
;
std
::
vector
<
void
*>
hole_array
;
// list of holes
std
::
vector
<
void
*>
hole_array
;
// list of holes
...
@@ -111,10 +114,10 @@ int CPolyLine::NormalizeWithKbool( std::vector<CPolyLine*> * pa, bool bRetainArc
...
@@ -111,10 +114,10 @@ int CPolyLine::NormalizeWithKbool( std::vector<CPolyLine*> * pa, bool bRetainArc
Close
();
Close
();
n_ext_cont
++
;
n_ext_cont
++
;
}
}
else
if
(
pa
)
// a new outside contour is found: create a new CPolyLine
else
if
(
aExtraPolyList
)
// a new outside contour is found: create a new CPolyLine
{
{
polyline
=
new
CPolyLine
;
// create new poly
polyline
=
new
CPolyLine
;
// create new poly
pa
->
push_back
(
polyline
);
// put it in array
aExtraPolyList
->
push_back
(
polyline
);
// put it in array
bool
first
=
true
;
bool
first
=
true
;
while
(
m_Kbool_Poly_Engine
->
PolygonHasMorePoints
()
)
// read next external contour
while
(
m_Kbool_Poly_Engine
->
PolygonHasMorePoints
()
)
// read next external contour
{
{
...
@@ -153,13 +156,13 @@ int CPolyLine::NormalizeWithKbool( std::vector<CPolyLine*> * pa, bool bRetainArc
...
@@ -153,13 +156,13 @@ int CPolyLine::NormalizeWithKbool( std::vector<CPolyLine*> * pa, bool bRetainArc
int
y
=
(
*
hole
)[
1
];
int
y
=
(
*
hole
)[
1
];
if
(
TestPointInside
(
x
,
y
)
)
if
(
TestPointInside
(
x
,
y
)
)
polyline
=
this
;
polyline
=
this
;
else
if
(
pa
)
else
if
(
aExtraPolyList
)
{
{
for
(
int
ext_ic
=
0
;
ext_ic
<
n_ext_cont
-
1
;
ext_ic
++
)
for
(
int
ext_ic
=
0
;
ext_ic
<
n_ext_cont
-
1
;
ext_ic
++
)
{
{
if
(
(
*
pa
)[
ext_ic
]
->
TestPointInside
(
x
,
y
)
)
if
(
(
*
aExtraPolyList
)[
ext_ic
]
->
TestPointInside
(
x
,
y
)
)
{
{
polyline
=
(
*
pa
)[
ext_ic
];
polyline
=
(
*
aExtraPolyList
)[
ext_ic
];
break
;
break
;
}
}
}
}
...
@@ -182,7 +185,7 @@ int CPolyLine::NormalizeWithKbool( std::vector<CPolyLine*> * pa, bool bRetainArc
...
@@ -182,7 +185,7 @@ int CPolyLine::NormalizeWithKbool( std::vector<CPolyLine*> * pa, bool bRetainArc
}
}
if
(
bRetainArcs
)
if
(
bRetainArcs
)
RestoreArcs
(
&
arc_array
,
pa
);
RestoreArcs
(
&
arc_array
,
aExtraPolyList
);
delete
m_Kbool_Poly_Engine
;
delete
m_Kbool_Poly_Engine
;
m_Kbool_Poly_Engine
=
NULL
;
m_Kbool_Poly_Engine
=
NULL
;
...
@@ -1142,7 +1145,7 @@ void CPolyLine::Hatch()
...
@@ -1142,7 +1145,7 @@ void CPolyLine::Hatch()
return
;
return
;
}
}
int
layer
=
m_layer
;
int
layer
=
GetLayer
()
;
if
(
GetClosed
()
)
// If not closed, the poly is beeing created and not finalised. Not not hatch
if
(
GetClosed
()
)
// If not closed, the poly is beeing created and not finalised. Not not hatch
{
{
...
...
polygon/PolyLine.h
View file @
9131e2a1
...
@@ -30,13 +30,13 @@
...
@@ -30,13 +30,13 @@
* false: holes are not linked: in this mode contours are added clockwise
* false: holes are not linked: in this mode contours are added clockwise
* and polygons added counter clockwise are holes
* and polygons added counter clockwise are holes
*/
*/
void
ArmBoolEng
(
Bool_Engine
*
aBooleng
,
bool
aConvertHoles
=
false
);
void
ArmBoolEng
(
Bool_Engine
*
aBooleng
,
bool
aConvertHoles
=
false
);
#define PCBU_PER_MIL 10
#define PCBU_PER_MIL 10
#define NM_PER_MIL 10 // 25400
#define NM_PER_MIL 10 // 25400
#define to_int( x )
(int) round( (x) )
#define to_int( x ) (int) round( (x) )
#ifndef min
#ifndef min
#define min( x1, x2 ) ( (x1) > (x2) ) ? (x2) : (x1)
#define min( x1, x2 ) ( (x1) > (x2) ) ? (x2) : (x1)
#endif
#endif
...
@@ -173,8 +173,8 @@ public:
...
@@ -173,8 +173,8 @@ public:
bool
bThermal
=
FALSE
,
bool
bThermal
=
FALSE
,
int
spoke_w
=
0
);
int
spoke_w
=
0
);
int
NormalizeAreaOutlines
(
std
::
vector
<
CPolyLine
*>
*
pa
=
NULL
,
int
NormalizeAreaOutlines
(
std
::
vector
<
CPolyLine
*>
*
pa
=
NULL
,
bool
bRetainArcs
=
FALSE
);
bool
bRetainArcs
=
FALSE
);
// KBOOL functions
// KBOOL functions
...
@@ -201,29 +201,34 @@ public:
...
@@ -201,29 +201,34 @@ public:
* @param arc_array : return data on arcs in arc_array
* @param arc_array : return data on arcs in arc_array
* @return error: 0 if Ok, 1 if error
* @return error: 0 if Ok, 1 if error
*/
*/
int
MakeKboolPoly
(
int
aStart_contour
=
-
1
,
int
aEnd_contour
=
-
1
,
std
::
vector
<
CArc
>
*
arc_array
=
NULL
);
int
MakeKboolPoly
(
int
aStart_contour
=
-
1
,
int
aEnd_contour
=
-
1
,
std
::
vector
<
CArc
>
*
arc_array
=
NULL
);
/** Function NormalizeWithKbool
/** Function NormalizeWithKbool
* Use the Kbool Library to clip contours: if outlines are crossing, the self-crossing polygon
* Use the Kbool Library to clip contours: if outlines are crossing, the self-crossing polygon
* is converted in 2 or more non self-crossing polygons
* is converted to non self-crossing polygon by adding extra points at the crossing locations
* If this results in new polygons, return them as std::vector pa
* and reordering corners
* @param pa: pointer on a std::vector<CPolyLine*> to store extra polylines
* if more than one outside contour are found, extra CPolyLines will be created
* because copper areas have only one outside contour
* Therefore, if this results in new CPolyLines, return them as std::vector pa
* @param aExtraPolys: pointer on a std::vector<CPolyLine*> to store extra CPolyLines
* @param bRetainArcs == TRUE, try to retain arcs in polys
* @param bRetainArcs == TRUE, try to retain arcs in polys
* @return number of external contours, or -1 if error
* @return number of external contours, or -1 if error
*/
*/
int
NormalizeWithKbool
(
std
::
vector
<
CPolyLine
*>
*
pa
,
bool
bRetainArcs
);
int
NormalizeWithKbool
(
std
::
vector
<
CPolyLine
*>
*
aExtraPolyList
,
bool
bRetainArcs
);
private
:
private
:
int
m_layer
;
// layer to draw on
int
m_layer
;
// layer to draw on
int
m_Width
;
// lines width when drawing. Provided but not really used
int
m_Width
;
// lines width when drawing. Provided but not really used
int
utility
;
int
utility
;
public
:
public
:
std
::
vector
<
CPolyPt
>
corner
;
// array of points for corners
std
::
vector
<
CPolyPt
>
corner
;
// array of points for corners
std
::
vector
<
int
>
side_style
;
// array of styles for sides
std
::
vector
<
int
>
side_style
;
// array of styles for sides
int
m_HatchStyle
;
// hatch style, see enum above
int
m_HatchStyle
;
// hatch style, see enum above
std
::
vector
<
CSegment
>
m_HatchLines
;
// hatch lines
std
::
vector
<
CSegment
>
m_HatchLines
;
// hatch lines
private
:
private
:
Bool_Engine
*
m_Kbool_Poly_Engine
;
// polygons set in kbool engine data
Bool_Engine
*
m_Kbool_Poly_Engine
;
// polygons set in kbool engine data
bool
bDrawn
;
bool
bDrawn
;
};
};
...
...
polygon/kbool/include/_dl_itr.cpp
View file @
9131e2a1
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
#endif
#endif
#ifdef __UNIX__
#ifdef __UNIX__
#include "
kbool
/include/_dl_itr.h"
#include "
..
/include/_dl_itr.h"
#endif
#endif
//=======================================================================
//=======================================================================
...
...
polygon/kbool/include/_lnk_itr.cpp
View file @
9131e2a1
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
#endif
#endif
#ifdef __UNIX__
#ifdef __UNIX__
#include "
kbool
/include/_lnk_itr.h"
#include "
..
/include/_lnk_itr.h"
#endif
#endif
//=======================================================================
//=======================================================================
...
...
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