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
Hide 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
if
(
col
&&
aNeedMTV
)
{
aMTV
=
pushoutForce
(
aA
,
aSeg
.
GetSeg
(),
aClearance
+
aSeg
.
GetWidth
()
/
2
);
aMTV
=
-
pushoutForce
(
aA
,
aSeg
.
GetSeg
(),
aClearance
+
aSeg
.
GetWidth
()
/
2
);
}
return
col
;
}
...
...
@@ -231,16 +231,28 @@ static inline bool Collide( const SHAPE_LINE_CHAIN& aA, const SHAPE_SEGMENT& aB,
}
template
<
class
ShapeAType
,
class
ShapeBType
>
bool
CollCase
(
const
SHAPE
*
aA
,
const
SHAPE
*
aB
,
int
aClearance
,
bool
aNeedMTV
,
VECTOR2I
&
aMTV
)
template
<
class
ShapeAType
,
class
ShapeBType
>
inline
bool
CollCase
(
const
SHAPE
*
aA
,
const
SHAPE
*
aB
,
int
aClearance
,
bool
aNeedMTV
,
VECTOR2I
&
aMTV
)
{
return
Collide
(
*
static_cast
<
const
ShapeAType
*>
(
aA
),
*
static_cast
<
const
ShapeBType
*>
(
aB
),
aClearance
,
aNeedMTV
,
aMTV
);
}
bool
CollideShapes
(
const
SHAPE
*
aA
,
const
SHAPE
*
aB
,
int
aClearance
,
bool
aNeedMTV
,
VECTOR2I
&
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
)
{
switch
(
aA
->
Type
()
)
{
case
SH_RECT
:
...
...
@@ -263,8 +275,8 @@ bool CollideShapes( const SHAPE* aA, const SHAPE* aB, int aClearance, bool aNeed
switch
(
aB
->
Type
()
)
{
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
:
return
CollCase
<
SHAPE_CIRCLE
,
SHAPE_CIRCLE
>
(
aA
,
aB
,
aClearance
,
aNeedMTV
,
aMTV
);
...
...
@@ -272,8 +284,9 @@ bool CollideShapes( const SHAPE* aA, const SHAPE* aB, int aClearance, bool aNeed
return
CollCase
<
SHAPE_CIRCLE
,
SHAPE_LINE_CHAIN
>
(
aA
,
aB
,
aClearance
,
aNeedMTV
,
aMTV
);
case
SH_SEGMENT
:
return
CollCase
<
SHAPE_CIRCLE
,
SHAPE_SEGMENT
>
(
aA
,
aB
,
aClearance
,
aNeedMTV
,
aMTV
);
default
:
return
CollCase
<
SHAPE_CIRCLE
,
SHAPE_SEGMENT
>
(
aA
,
aB
,
aClearance
,
aNeedMTV
,
aMTV
);
default
:
break
;
}
...
...
@@ -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
);
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
:
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*
{
CollideShapes
(
aObstacleVia
->
Shape
(),
aCurrent
->
Shape
(),
clearance
+
PNS_HULL_MARGIN
,
true
,
mtvSolid
);
mtv
=
mtvSolid
;
mtv
=
-
mtvSolid
;
rank
=
aCurrent
->
Rank
()
+
10000
;
}
...
...
@@ -924,7 +924,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::ShoveLines( const PNS_LINE& aCurrentHead )
if
(
m_newHead
&&
st
==
SH_OK
)
{
st
=
SH_HEAD_MODIFIED
;
Router
()
->
DisplayDebugLine
(
m_newHead
->
CLine
(),
3
,
20000
);
//
Router()->DisplayDebugLine( m_newHead->CLine(), 3, 20000 );
}
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