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
4e280f06
Commit
4e280f06
authored
Nov 14, 2014
by
Tomasz Wlostowski
Committed by
Maciej Suminski
Nov 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
P&S router: fixed shove force propagation incorrect issues causing improper via dragging.
parent
4e67de5c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
11 deletions
+24
-11
shape_collisions.cpp
common/geometry/shape_collisions.cpp
+22
-9
pns_shove.cpp
pcbnew/router/pns_shove.cpp
+2
-2
No files found.
common/geometry/shape_collisions.cpp
View file @
4e280f06
...
@@ -175,7 +175,7 @@ static inline bool Collide( const SHAPE_CIRCLE& aA, const SHAPE_SEGMENT& aSeg, i
...
@@ -175,7 +175,7 @@ static inline bool Collide( const SHAPE_CIRCLE& aA, const SHAPE_SEGMENT& aSeg, i
if
(
col
&&
aNeedMTV
)
if
(
col
&&
aNeedMTV
)
{
{
aMTV
=
pushoutForce
(
aA
,
aSeg
.
GetSeg
(),
aClearance
+
aSeg
.
GetWidth
()
/
2
);
aMTV
=
-
pushoutForce
(
aA
,
aSeg
.
GetSeg
(),
aClearance
+
aSeg
.
GetWidth
()
/
2
);
}
}
return
col
;
return
col
;
}
}
...
@@ -231,14 +231,26 @@ static inline bool Collide( const SHAPE_LINE_CHAIN& aA, const SHAPE_SEGMENT& aB,
...
@@ -231,14 +231,26 @@ static inline bool Collide( const SHAPE_LINE_CHAIN& aA, const SHAPE_SEGMENT& aB,
}
}
template
<
class
ShapeAType
,
class
ShapeBType
>
bool
template
<
class
ShapeAType
,
class
ShapeBType
>
CollCase
(
const
SHAPE
*
aA
,
const
SHAPE
*
aB
,
int
aClearance
,
bool
aNeedMTV
,
VECTOR2I
&
aMTV
)
inline
bool
CollCase
(
const
SHAPE
*
aA
,
const
SHAPE
*
aB
,
int
aClearance
,
bool
aNeedMTV
,
VECTOR2I
&
aMTV
)
{
{
return
Collide
(
*
static_cast
<
const
ShapeAType
*>
(
aA
),
return
Collide
(
*
static_cast
<
const
ShapeAType
*>
(
aA
),
*
static_cast
<
const
ShapeBType
*>
(
aB
),
*
static_cast
<
const
ShapeBType
*>
(
aB
),
aClearance
,
aNeedMTV
,
aMTV
);
aClearance
,
aNeedMTV
,
aMTV
);
}
}
template
<
class
ShapeAType
,
class
ShapeBType
>
inline
bool
CollCaseReversed
(
const
SHAPE
*
aA
,
const
SHAPE
*
aB
,
int
aClearance
,
bool
aNeedMTV
,
VECTOR2I
&
aMTV
)
{
bool
rv
=
Collide
(
*
static_cast
<
const
ShapeBType
*>
(
aB
),
*
static_cast
<
const
ShapeAType
*>
(
aA
),
aClearance
,
aNeedMTV
,
aMTV
);
if
(
rv
&&
aNeedMTV
)
aMTV
=
-
aMTV
;
return
rv
;
}
bool
CollideShapes
(
const
SHAPE
*
aA
,
const
SHAPE
*
aB
,
int
aClearance
,
bool
aNeedMTV
,
VECTOR2I
&
aMTV
)
bool
CollideShapes
(
const
SHAPE
*
aA
,
const
SHAPE
*
aB
,
int
aClearance
,
bool
aNeedMTV
,
VECTOR2I
&
aMTV
)
{
{
switch
(
aA
->
Type
()
)
switch
(
aA
->
Type
()
)
...
@@ -263,7 +275,7 @@ bool CollideShapes( const SHAPE* aA, const SHAPE* aB, int aClearance, bool aNeed
...
@@ -263,7 +275,7 @@ bool CollideShapes( const SHAPE* aA, const SHAPE* aB, int aClearance, bool aNeed
switch
(
aB
->
Type
()
)
switch
(
aB
->
Type
()
)
{
{
case
SH_RECT
:
case
SH_RECT
:
return
CollCase
<
SHAPE_RECT
,
SHAPE_CIRCLE
>
(
aB
,
aA
,
aClearance
,
aNeedMTV
,
aMTV
);
return
CollCaseReversed
<
SHAPE_CIRCLE
,
SHAPE_RECT
>
(
aA
,
aB
,
aClearance
,
aNeedMTV
,
aMTV
);
case
SH_CIRCLE
:
case
SH_CIRCLE
:
return
CollCase
<
SHAPE_CIRCLE
,
SHAPE_CIRCLE
>
(
aA
,
aB
,
aClearance
,
aNeedMTV
,
aMTV
);
return
CollCase
<
SHAPE_CIRCLE
,
SHAPE_CIRCLE
>
(
aA
,
aB
,
aClearance
,
aNeedMTV
,
aMTV
);
...
@@ -273,6 +285,7 @@ bool CollideShapes( const SHAPE* aA, const SHAPE* aB, int aClearance, bool aNeed
...
@@ -273,6 +285,7 @@ bool CollideShapes( const SHAPE* aA, const SHAPE* aB, int aClearance, bool aNeed
case
SH_SEGMENT
:
case
SH_SEGMENT
:
return
CollCase
<
SHAPE_CIRCLE
,
SHAPE_SEGMENT
>
(
aA
,
aB
,
aClearance
,
aNeedMTV
,
aMTV
);
return
CollCase
<
SHAPE_CIRCLE
,
SHAPE_SEGMENT
>
(
aA
,
aB
,
aClearance
,
aNeedMTV
,
aMTV
);
default
:
default
:
break
;
break
;
}
}
...
@@ -303,7 +316,7 @@ bool CollideShapes( const SHAPE* aA, const SHAPE* aB, int aClearance, bool aNeed
...
@@ -303,7 +316,7 @@ bool CollideShapes( const SHAPE* aA, const SHAPE* aB, int aClearance, bool aNeed
return
CollCase
<
SHAPE_RECT
,
SHAPE_SEGMENT
>
(
aB
,
aA
,
aClearance
,
aNeedMTV
,
aMTV
);
return
CollCase
<
SHAPE_RECT
,
SHAPE_SEGMENT
>
(
aB
,
aA
,
aClearance
,
aNeedMTV
,
aMTV
);
case
SH_CIRCLE
:
case
SH_CIRCLE
:
return
CollCase
<
SHAPE_CIRCLE
,
SHAPE_SEGMENT
>
(
aB
,
aA
,
aClearance
,
aNeedMTV
,
aMTV
);
return
CollCaseReversed
<
SHAPE_SEGMENT
,
SHAPE_CIRCLE
>
(
aA
,
aB
,
aClearance
,
aNeedMTV
,
aMTV
);
case
SH_LINE_CHAIN
:
case
SH_LINE_CHAIN
:
return
CollCase
<
SHAPE_LINE_CHAIN
,
SHAPE_SEGMENT
>
(
aB
,
aA
,
aClearance
,
aNeedMTV
,
aMTV
);
return
CollCase
<
SHAPE_LINE_CHAIN
,
SHAPE_SEGMENT
>
(
aB
,
aA
,
aClearance
,
aNeedMTV
,
aMTV
);
...
...
pcbnew/router/pns_shove.cpp
View file @
4e280f06
...
@@ -597,7 +597,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onCollidingVia (PNS_ITEM* aCurrent, PNS_VIA*
...
@@ -597,7 +597,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onCollidingVia (PNS_ITEM* aCurrent, PNS_VIA*
{
{
CollideShapes
(
aObstacleVia
->
Shape
(),
aCurrent
->
Shape
(),
CollideShapes
(
aObstacleVia
->
Shape
(),
aCurrent
->
Shape
(),
clearance
+
PNS_HULL_MARGIN
,
true
,
mtvSolid
);
clearance
+
PNS_HULL_MARGIN
,
true
,
mtvSolid
);
mtv
=
mtvSolid
;
mtv
=
-
mtvSolid
;
rank
=
aCurrent
->
Rank
()
+
10000
;
rank
=
aCurrent
->
Rank
()
+
10000
;
}
}
...
@@ -924,7 +924,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::ShoveLines( const PNS_LINE& aCurrentHead )
...
@@ -924,7 +924,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::ShoveLines( const PNS_LINE& aCurrentHead )
if
(
m_newHead
&&
st
==
SH_OK
)
if
(
m_newHead
&&
st
==
SH_OK
)
{
{
st
=
SH_HEAD_MODIFIED
;
st
=
SH_HEAD_MODIFIED
;
Router
()
->
DisplayDebugLine
(
m_newHead
->
CLine
(),
3
,
20000
);
//
Router()->DisplayDebugLine( m_newHead->CLine(), 3, 20000 );
}
}
m_currentNode
->
RemoveByMarker
(
MK_HEAD
);
m_currentNode
->
RemoveByMarker
(
MK_HEAD
);
...
...
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