Use ISO 128-2 values for dashed line defaults.

This commit is contained in:
Jeff Young 2021-12-25 14:00:57 +00:00
parent 03a5bd5319
commit 933b82495d
5 changed files with 17 additions and 13 deletions

View File

@ -50,24 +50,28 @@ RENDER_SETTINGS::~RENDER_SETTINGS()
}
constexpr double visualCorrection = 0.8;
#if 0
constexpr double correction = 0.8; // Looks best visually
#else
constexpr double correction = 1.0; // Matches ISO 128-2
#endif
double RENDER_SETTINGS::GetDashLength( int aLineWidth ) const
{
return std::max( m_dashLengthRatio - visualCorrection, 1.0 ) * aLineWidth;
return std::max( m_dashLengthRatio - correction, 1.0 ) * aLineWidth;
}
double RENDER_SETTINGS::GetDotLength( int aLineWidth ) const
{
return ( 1.0 - visualCorrection ) * aLineWidth;
return ( 1.0 - correction ) * aLineWidth;
}
double RENDER_SETTINGS::GetGapLength( int aLineWidth ) const
{
return std::max( m_gapLengthRatio + visualCorrection, 1.0 ) * aLineWidth;
return std::max( m_gapLengthRatio + correction, 1.0 ) * aLineWidth;
}

View File

@ -86,8 +86,8 @@ SCH_RENDER_SETTINGS::SCH_RENDER_SETTINGS() :
m_JunctionSize( DEFAULT_JUNCTION_DIAM * IU_PER_MILS )
{
SetDefaultPenWidth( DEFAULT_LINE_WIDTH_MILS * IU_PER_MILS );
SetDashLengthRatio( 5 );
SetGapLengthRatio( 3 );
SetDashLengthRatio( 12 ); // From ISO 128-2
SetGapLengthRatio( 3 ); // From ISO 128-2
m_minPenWidth = ADVANCED_CFG::GetCfg().m_MinPlotPenWidth * IU_PER_MM;
}

View File

@ -50,7 +50,7 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin
m_IntersheetRefsFormatShort( false ),
m_IntersheetRefsPrefix( DEFAULT_IREF_PREFIX ),
m_IntersheetRefsSuffix( DEFAULT_IREF_SUFFIX ),
m_DashedLineDashRatio( 5.0 ),
m_DashedLineDashRatio( 12.0 ),
m_DashedLineGapRatio( 3.0 ),
m_SpiceAdjustPassiveValues( false ),
m_NgspiceSimulatorSettings( nullptr )
@ -92,10 +92,10 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin
&m_IntersheetRefsSuffix, defaultIntersheetsRefSuffix ) );
m_params.emplace_back( new PARAM<double>( "drawing.dashed_lines_dash_length_ratio",
&m_DashedLineDashRatio, 5.0 ) );
&m_DashedLineDashRatio, 12.0 ) ); // Default from ISO 128-2
m_params.emplace_back( new PARAM<double>( "drawing.dashed_lines_gap_length_ratio",
&m_DashedLineGapRatio, 3.0 ) );
&m_DashedLineGapRatio, 3.0 ) ); // Default from ISO 128-2
m_params.emplace_back( new PARAM_SCALED<int>( "drawing.default_line_thickness",
&m_DefaultLineWidth, Mils2iu( defaultLineThickness ), Mils2iu( 5 ), Mils2iu( 1000 ),

View File

@ -82,8 +82,8 @@ PCB_RENDER_SETTINGS::PCB_RENDER_SETTINGS()
for( unsigned int i = 0; i < arrayDim( m_sketchMode ); ++i )
m_sketchMode[i] = false;
SetDashLengthRatio( 5 );
SetGapLengthRatio( 3 );
SetDashLengthRatio( 12 ); // From ISO 128-2
SetGapLengthRatio( 3 ); // From ISO 128-2
update();
}

View File

@ -96,8 +96,8 @@ PCB_PLOT_PARAMS::PCB_PLOT_PARAMS()
m_includeGerberNetlistInfo = true;
m_createGerberJobFile = true;
m_gerberPrecision = gbrDefaultPrecision;
m_dashedLineDashRatio = 5.0;
m_dashedLineGapRatio = 3.0;
m_dashedLineDashRatio = 12.0; // From ISO 128-2
m_dashedLineGapRatio = 3.0; // From ISO 128-2
// we used 0.1mils for SVG step before, but nm precision is more accurate, so we use nm
m_svgPrecision = SVG_PRECISION_DEFAULT;