router: trying to improve the 'guess posture' algorithm to work well with both fix-all and fix-last-segment on click
This commit is contained in:
parent
65def26b4d
commit
761e754294
|
@ -1637,7 +1637,7 @@ bool LINE_PLACER::FixRoute( const VECTOR2I& aP, ITEM* aEndItem, bool aForceFinis
|
||||||
m_mouseTrailTracer.Clear();
|
m_mouseTrailTracer.Clear();
|
||||||
m_mouseTrailTracer.SetTolerance( m_head.Width() );
|
m_mouseTrailTracer.SetTolerance( m_head.Width() );
|
||||||
m_mouseTrailTracer.AddTrailPoint( m_currentStart );
|
m_mouseTrailTracer.AddTrailPoint( m_currentStart );
|
||||||
m_mouseTrailTracer.SetDefaultDirections( m_initial_direction, lastSegDir );
|
m_mouseTrailTracer.SetDefaultDirections( lastSegDir, DIRECTION_45::UNDEFINED );
|
||||||
|
|
||||||
m_placementCorrect = true;
|
m_placementCorrect = true;
|
||||||
}
|
}
|
||||||
|
@ -1985,7 +1985,7 @@ bool LINE_PLACER::buildInitialLine( const VECTOR2I& aP, LINE& aHead, bool aForce
|
||||||
|
|
||||||
aHead.AppendVia( v );
|
aHead.AppendVia( v );
|
||||||
|
|
||||||
PNS_DBG( Dbg(), AddPoint, v.Pos(), GREEN, 1000000, "via-force-coll-2" );
|
PNS_DBG( Dbg(), AddPoint, v.Pos(), GREEN, 1000000, "via-force-coll-2" );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,10 +92,10 @@ DIRECTION_45 MOUSE_TRAIL_TRACER::GetPosture( const VECTOR2I& aP )
|
||||||
const double minAreaCutoffDistanceFactor = 6;
|
const double minAreaCutoffDistanceFactor = 6;
|
||||||
|
|
||||||
// Adjusts how far away from p0 we get before whatever posture we solved is locked in
|
// Adjusts how far away from p0 we get before whatever posture we solved is locked in
|
||||||
const int lockDistanceFactor = 25;
|
const int lockDistanceFactor = 30;
|
||||||
|
|
||||||
// Adjusts how close to p0 we unlock the posture again if one was locked already
|
// Adjusts how close to p0 we unlock the posture again if one was locked already
|
||||||
const int unlockDistanceFactor = 4;
|
const int unlockDistanceFactor = 10;
|
||||||
|
|
||||||
if( m_trail.PointCount() < 2 || m_manuallyForced )
|
if( m_trail.PointCount() < 2 || m_manuallyForced )
|
||||||
{
|
{
|
||||||
|
@ -156,6 +156,8 @@ DIRECTION_45 MOUSE_TRAIL_TRACER::GetPosture( const VECTOR2I& aP )
|
||||||
areaOk = true;
|
areaOk = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PNS_DBG( dbg, Message, wxString::Format( "Posture: rl %.0f thr %d tol %d as %.3f area OK %d forced %d\n", refLength, (int)(unlockDistanceFactor * m_tolerance), m_tolerance, ratio, areaOk?1:0, m_forced?1:0 ) );
|
||||||
|
|
||||||
DIRECTION_45 straightDirection;
|
DIRECTION_45 straightDirection;
|
||||||
DIRECTION_45 diagDirection;
|
DIRECTION_45 diagDirection;
|
||||||
DIRECTION_45 newDirection = m_direction;
|
DIRECTION_45 newDirection = m_direction;
|
||||||
|
|
Loading…
Reference in New Issue