Gerbview: replace ARC_HIGH_DEF (defined for Pcbnew) to a suitable value
ARC_HIGH_DEF is set to 5 microns in Pcbnew units, but Gerbview do not use Pcbnew units, so ARC_HIGH_DEF was a too large value, creating rough arcs.
This commit is contained in:
parent
c53ce01b89
commit
efe49ecfd2
|
@ -261,6 +261,9 @@ void AM_PRIMITIVE::ConvertBasicShapeToPolygon( const D_CODE* aDcode,
|
|||
int gap = scaletoIU( m_Params[4].GetValue( tool ), m_GerbMetric );
|
||||
int numCircles = KiROUND( m_Params[5].GetValue( tool ) );
|
||||
|
||||
// Adjust the allowed approx error to convert arcs to segments:
|
||||
int arc_to_seg_error = gerbIUScale.mmToIU( 0.005 ); // Allow 5 microns
|
||||
|
||||
// Draw circles @ position pos.x, pos.y given by the tool:
|
||||
VECTOR2I center( mapPt( m_Params[0].GetValue( tool ), m_Params[1].GetValue( tool ),
|
||||
m_GerbMetric ) );
|
||||
|
@ -278,13 +281,13 @@ void AM_PRIMITIVE::ConvertBasicShapeToPolygon( const D_CODE* aDcode,
|
|||
if( outerDiam <= penThickness )
|
||||
{ // No room to draw a ring (no room for the hole):
|
||||
// draw a circle instead (with no hole), with the right diameter
|
||||
TransformCircleToPolygon( aShapeBuffer, center, outerDiam / 2, ARC_HIGH_DEF,
|
||||
TransformCircleToPolygon( aShapeBuffer, center, outerDiam / 2, arc_to_seg_error,
|
||||
ERROR_INSIDE );
|
||||
}
|
||||
else
|
||||
{
|
||||
TransformRingToPolygon( aShapeBuffer, center, ( outerDiam - penThickness ) / 2,
|
||||
penThickness, ARC_HIGH_DEF, ERROR_INSIDE );
|
||||
penThickness, arc_to_seg_error, ERROR_INSIDE );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -304,9 +304,13 @@ void D_CODE::ConvertShapeToPolygon( const GERBER_DRAW_ITEM* aParent )
|
|||
switch( m_ApertType )
|
||||
{
|
||||
case APT_CIRCLE: // creates only a circle with rectangular hole
|
||||
TransformCircleToPolygon( m_Polygon, initialpos, m_Size.x >> 1, ARC_HIGH_DEF,
|
||||
{
|
||||
// Adjust the allowed approx error to convert arcs to segments:
|
||||
int arc_to_seg_error = gerbIUScale.mmToIU( 0.005 ); // Allow 5 microns
|
||||
TransformCircleToPolygon( m_Polygon, initialpos, m_Size.x >> 1, arc_to_seg_error,
|
||||
ERROR_INSIDE );
|
||||
addHoleToPolygon( &m_Polygon, m_DrillShape, m_Drill, initialpos );
|
||||
}
|
||||
break;
|
||||
|
||||
case APT_RECT:
|
||||
|
@ -423,7 +427,9 @@ static void addHoleToPolygon( SHAPE_POLY_SET* aPolygon, APERTURE_DEF_HOLETYPE aH
|
|||
|
||||
if( aHoleShape == APT_DEF_ROUND_HOLE )
|
||||
{
|
||||
TransformCircleToPolygon( holeBuffer, VECTOR2I( 0, 0 ), aSize.x / 2, ARC_HIGH_DEF,
|
||||
// Adjust the allowed approx error to convert arcs to segments:
|
||||
int arc_to_seg_error = gerbIUScale.mmToIU( 0.005 ); // Allow 5 microns
|
||||
TransformCircleToPolygon( holeBuffer, VECTOR2I( 0, 0 ), aSize.x / 2, arc_to_seg_error,
|
||||
ERROR_INSIDE );
|
||||
}
|
||||
else if( aHoleShape == APT_DEF_RECT_HOLE )
|
||||
|
|
|
@ -335,7 +335,9 @@ void GERBVIEW_PAINTER::draw( /*const*/ GERBER_DRAW_ITEM* aItem, int aLayer )
|
|||
if( arcStart == arcEnd )
|
||||
endAngle = startAngle + ANGLE_360;
|
||||
|
||||
m_gal->DrawArcSegment( center, radius, startAngle, endAngle, width, ARC_HIGH_DEF );
|
||||
// Adjust the allowed approx error to convert arcs to segments:
|
||||
int arc_to_seg_error = gerbIUScale.mmToIU( 0.005 ); // Allow 5 microns
|
||||
m_gal->DrawArcSegment( center, radius, startAngle, endAngle, width, arc_to_seg_error );
|
||||
|
||||
#if 0 // Arc Debugging only
|
||||
m_gal->SetIsFill( false );
|
||||
|
|
Loading…
Reference in New Issue