Altium PCB: convert small arcs in line chain to segments to avoid overflow issues.

Can be seen on "mb1932-bdp", for example.

(cherry picked from commit e6ce4eb73e)
This commit is contained in:
Alex Shvartzkop
2024-10-06 13:47:32 +03:00
parent d965aadd16
commit fac5f6aa83
+21 -2
View File
@@ -109,14 +109,33 @@ void HelperShapeLineChainFromAltiumVertices( SHAPE_LINE_CHAIN& aLine,
VECTOR2I arcStart = vertex.center + arcStartOffset;
VECTOR2I arcEnd = vertex.center + arcEndOffset;
bool isShort = arcStart.Distance( arcEnd ) < pcbIUScale.mmToIU( 0.001 )
|| angle.AsDegrees() < 0.2;
if( arcStart.Distance( vertex.position )
< arcEnd.Distance( vertex.position ) )
{
aLine.Append( SHAPE_ARC( vertex.center, arcStart, -angle ) );
if( !isShort )
{
aLine.Append( SHAPE_ARC( vertex.center, arcStart, -angle ) );
}
else
{
aLine.Append( arcStart );
aLine.Append( arcEnd );
}
}
else
{
aLine.Append( SHAPE_ARC( vertex.center, arcEnd, angle ) );
if( !isShort )
{
aLine.Append( SHAPE_ARC( vertex.center, arcEnd, angle ) );
}
else
{
aLine.Append( arcEnd );
aLine.Append( arcStart );
}
}
}
else