[PD] more hole fixes
- there is the ISO 273 describing clearance holes, so we need to take these values. Only if we have a size not defined in the norm, we calculate - add the coarse (wide) type for clearance holes from ISO 273 - add all screw thread sizes defined in DIN 13/ISO 261 - rearrange thread dialog to make it more compact - change name "fit" to "clearance" as discussed - add tooltips to the dialog - fix issue with TaperedAngle dialog field - change a size name because the norms define "M1" not "M1.0"
This commit is contained in:
@@ -71,7 +71,7 @@ namespace PartDesign {
|
||||
|
||||
const char* Hole::DepthTypeEnums[] = { "Dimension", "ThroughAll", /*, "UpToFirst", */ NULL };
|
||||
const char* Hole::ThreadTypeEnums[] = { "None", "ISOMetricProfile", "ISOMetricFineProfile", "UNC", "UNF", "UNEF", NULL};
|
||||
const char* Hole::ThreadFitEnums[] = { "Standard", "Close", NULL};
|
||||
const char* Hole::ThreadFitEnums[] = { "Standard", "Close", "Wide", NULL};
|
||||
const char* Hole::DrillPointEnums[] = { "Flat", "Angled", NULL};
|
||||
|
||||
/* "None" profile */
|
||||
@@ -95,34 +95,49 @@ const Hole::ThreadDescription Hole::threadDescription[][171] =
|
||||
|
||||
/* ISO metric regular */
|
||||
{
|
||||
{ "M1.6", 1.60, 0.35 },
|
||||
{ "M2", 2.00, 0.40 },
|
||||
{ "M2.5", 2.50, 0.45 },
|
||||
{ "M3", 3.00, 0.50 },
|
||||
{ "M3.5", 3.50, 0.60 },
|
||||
{ "M4", 4.00, 0.70 },
|
||||
{ "M5", 5.00, 0.80 },
|
||||
{ "M6", 6.00, 1.00 },
|
||||
{ "M8", 8.00, 1.25 },
|
||||
{ "M10", 10.00, 1.50 },
|
||||
{ "M12", 12.00, 1.75 },
|
||||
{ "M14", 14.00, 2.00 },
|
||||
{ "M16", 16.00, 2.00 },
|
||||
{ "M20", 20.00, 2.50 },
|
||||
{ "M22", 22.00, 2.50 },
|
||||
{ "M24", 24.00, 3.00 },
|
||||
{ "M27", 27.00, 3.00 },
|
||||
{ "M30", 30.00, 3.50 },
|
||||
{ "M36", 36.00, 4.00 },
|
||||
{ "M42", 42.00, 4.50 },
|
||||
{ "M48", 48.00, 5.00 },
|
||||
{ "M56", 56.00, 5.50 },
|
||||
{ "M64", 64.00, 6.00 },
|
||||
{ "M68", 68.00, 6.00 },
|
||||
{ "M1", 1.0, 0.25 },
|
||||
{ "M1.1", 1.1, 0.25 },
|
||||
{ "M1.2", 1.2, 0.25 },
|
||||
{ "M1.4", 1.4, 0.30 },
|
||||
{ "M1.6", 1.6, 0.35 },
|
||||
{ "M1.8", 1.8, 0.35 },
|
||||
{ "M2", 2.0, 0.40 },
|
||||
{ "M2.2", 2.2, 0.45 },
|
||||
{ "M2.5", 2.5, 0.45 },
|
||||
{ "M3", 3.0, 0.50 },
|
||||
{ "M3.5", 3.5, 0.60 },
|
||||
{ "M4", 4.0, 0.70 },
|
||||
{ "M4.5", 4.5, 0.75 },
|
||||
{ "M5", 5.0, 0.80 },
|
||||
{ "M6", 6.0, 1.00 },
|
||||
{ "M7", 7.0, 1.00 },
|
||||
{ "M8", 8.0, 1.25 },
|
||||
{ "M9", 9.0, 1.25 },
|
||||
{ "M10", 10.0, 1.50 },
|
||||
{ "M11", 11.0, 1.50 },
|
||||
{ "M12", 12.0, 1.75 },
|
||||
{ "M14", 14.0, 2.00 },
|
||||
{ "M16", 16.0, 2.00 },
|
||||
{ "M18", 18.0, 2.50 },
|
||||
{ "M20", 20.0, 2.50 },
|
||||
{ "M22", 22.0, 2.50 },
|
||||
{ "M24", 24.0, 3.00 },
|
||||
{ "M27", 27.0, 3.00 },
|
||||
{ "M30", 30.0, 3.50 },
|
||||
{ "M36", 36.0, 4.00 },
|
||||
{ "M39", 39.0, 4.00 },
|
||||
{ "M42", 42.0, 4.50 },
|
||||
{ "M45", 45.0, 4.50 },
|
||||
{ "M48", 48.0, 5.00 },
|
||||
{ "M52", 52.0, 5.00 },
|
||||
{ "M56", 56.0, 5.50 },
|
||||
{ "M60", 60.0, 5.50 },
|
||||
{ "M64", 64.0, 6.00 },
|
||||
{ "M68", 68.0, 6.00 },
|
||||
},
|
||||
/* ISO metric fine */
|
||||
{
|
||||
{ "M1.0x0.2", 1.0, 0.20 },
|
||||
{ "M1x0.2", 1.0, 0.20 },
|
||||
{ "M1.1x0.2", 1.1, 0.20 },
|
||||
{ "M1.2x0.2", 1.2, 0.20 },
|
||||
{ "M1.4x0.2", 1.4, 0.20 },
|
||||
@@ -356,19 +371,62 @@ const Hole::ThreadDescription Hole::threadDescription[][171] =
|
||||
|
||||
};
|
||||
|
||||
const double Hole::metricHoleDiameters[35][4] =
|
||||
{
|
||||
/* ISO metric according to ISO 273 */
|
||||
// {screw diameter, close, standard, coarse}
|
||||
{ 1.0, 1.1, 1.2, 1.3},
|
||||
{ 1.2, 1.3, 1.4, 1.5},
|
||||
{ 1.4, 1.5, 1.6, 1.8},
|
||||
{ 1.6, 1.7, 1.8, 2.0},
|
||||
{ 1.8, 2.0, 2.1, 2.2},
|
||||
{ 2.0, 2.2, 2.4, 2.6},
|
||||
{ 2.5, 2.7, 2.9, 3.1},
|
||||
{ 3.0, 3.2, 3.4, 3.6},
|
||||
{ 3.5, 3.7, 3.9, 4.2},
|
||||
{ 4.0, 4.3, 4.5, 4.8},
|
||||
{ 4.5, 4.8, 5.0, 5.3},
|
||||
{ 5.0, 5.3, 5.5, 5.8},
|
||||
{ 6.0, 6.4, 6.6, 7.0},
|
||||
{ 7.0, 7.4, 7.6, 8.0},
|
||||
{ 8.0, 8.4, 9.0, 10.0},
|
||||
{ 10.0, 10.5, 11.0, 12.0},
|
||||
{ 12.0, 13.0, 13.5, 14.5},
|
||||
{ 14.0, 15.0, 15.5, 16.5},
|
||||
{ 16.0, 17.0, 17.5, 18.5},
|
||||
{ 18.0, 19.0, 20.0, 21.0},
|
||||
{ 20.0, 21.0, 22.0, 24.0},
|
||||
{ 22.0, 23.0, 24.0, 26.0},
|
||||
{ 24.0, 25.0, 26.0, 28.0},
|
||||
{ 27.0, 28.0, 30.0, 32.0},
|
||||
{ 30.0, 31.0, 33.0, 35.0},
|
||||
{ 36.0, 37.0, 39.0, 42.0},
|
||||
{ 39.0, 40.0, 42.0, 45.0},
|
||||
{ 42.0, 43.0, 45.0, 48.0},
|
||||
{ 45.0, 46.0, 48.0, 52.0},
|
||||
{ 48.0, 50.0, 52.0, 56.0},
|
||||
{ 52.0, 54.0, 56.0, 62.0},
|
||||
{ 56.0, 58.0, 62.0, 66.0},
|
||||
{ 60.0, 62.0, 66.0, 70.0},
|
||||
{ 64.0, 66.0, 70.0, 74.0},
|
||||
{ 68.0, 70.0, 77.0, 78.0}
|
||||
};
|
||||
|
||||
/* ISO coarse metric enums */
|
||||
std::vector<std::string> Hole::HoleCutType_ISOmetric_Enums = { "None", "Counterbore", "Countersink", "Cheesehead (deprecated)", "Countersink socket screw (deprecated)", "Cap screw (deprecated)" };
|
||||
const char* Hole::ThreadSize_ISOmetric_Enums[] = { "M1.6", "M2", "M2.5", "M3",
|
||||
"M3.5", "M4", "M5", "M6",
|
||||
"M8", "M10", "M12", "M14",
|
||||
"M16", "M20", "M22", "M24",
|
||||
"M27", "M30", "M36", "M42",
|
||||
"M48", "M56", "M64", "M68", NULL };
|
||||
const char* Hole::ThreadSize_ISOmetric_Enums[] = { "M1", "M1.1", "M1.2", "M1.4", "M1.6",
|
||||
"M1.8", "M2", "M2.2", "M2.5", "M3",
|
||||
"M3.5", "M4", "M4.5", "M5", "M6",
|
||||
"M7", "M8", "M9", "M10", "M11",
|
||||
"M12", "M14", "M16", "M18", "M20",
|
||||
"M22", "M24", "M27", "M30", "M33",
|
||||
"M36", "M39", "M42", "M45", "M48",
|
||||
"M52", "M56", "M60", "M64", "M68", NULL };
|
||||
const char* Hole::ThreadClass_ISOmetric_Enums[] = { "4G", "4H", "5G", "5H", "6G", "6H", "7G", "7H","8G", "8H", NULL };
|
||||
|
||||
std::vector<std::string> Hole::HoleCutType_ISOmetricfine_Enums = { "None", "Counterbore", "Countersink", "Cheesehead (deprecated)", "Countersink socket screw (deprecated)", "Cap screw (deprecated)" };
|
||||
const char* Hole::ThreadSize_ISOmetricfine_Enums[] = {
|
||||
"M1.0x0.2", "M1.1x0.2", "M1.2x0.2", "M1.4x0.2",
|
||||
"M1x0.2", "M1.1x0.2", "M1.2x0.2", "M1.4x0.2",
|
||||
"M1.6x0.2", "M1.8x0.2", "M2x0.25", "M2.2x0.25",
|
||||
"M2.5x0.35", "M3x0.35", "M3.5x0.35",
|
||||
"M4x0.5", "M4.5x0.5", "M5x0.5", "M5.5x0.5",
|
||||
@@ -679,12 +737,50 @@ void Hole::updateDiameterParam()
|
||||
diameter = diameter - pitch;
|
||||
}
|
||||
else {
|
||||
bool found = false;
|
||||
int MatrixRowSize = sizeof(metricHoleDiameters) / sizeof(metricHoleDiameters[0]);
|
||||
switch ( ThreadFit.getValue() ) {
|
||||
case 0: /* standard */
|
||||
diameter = ( 5 * ( (int)( ( diameter * 110 ) / 5 ) ) ) / 100.0;
|
||||
case 0: /* standard fit */
|
||||
// read diameter out of matrix
|
||||
for (int i = 0; i < MatrixRowSize; i++) {
|
||||
if (metricHoleDiameters[i][0] == diameter) {
|
||||
diameter = metricHoleDiameters[i][2];
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// if nothing was found, we must calculate
|
||||
if (!found) {
|
||||
diameter = (5 * ((int)((diameter * 110) / 5))) / 100.0;
|
||||
}
|
||||
break;
|
||||
case 1: /* close */
|
||||
diameter = ( 5 * ( (int)( ( diameter * 105 ) / 5 ) ) ) / 100.0;
|
||||
case 1: /* close fit */
|
||||
// read diameter out of matrix
|
||||
for (int i = 0; i < MatrixRowSize; i++) {
|
||||
if (metricHoleDiameters[i][0] == diameter) {
|
||||
diameter = metricHoleDiameters[i][1];
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// if nothing was found, we must calculate
|
||||
if (!found) {
|
||||
diameter = (5 * ((int)((diameter * 105) / 5))) / 100.0;
|
||||
}
|
||||
break;
|
||||
case 2: /* wide fit */
|
||||
// read diameter out of matrix
|
||||
for (int i = 0; i < MatrixRowSize; i++) {
|
||||
if (metricHoleDiameters[i][0] == diameter) {
|
||||
diameter = metricHoleDiameters[i][3];
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// if nothing was found, we must calculate
|
||||
if (!found) {
|
||||
diameter = (5 * ((int)((diameter * 115) / 5))) / 100.0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert( 0 );
|
||||
|
||||
@@ -84,9 +84,10 @@ public:
|
||||
double diameter;
|
||||
double pitch;
|
||||
} ThreadDescription;
|
||||
|
||||
static const ThreadDescription threadDescription[][171];
|
||||
|
||||
static const double metricHoleDiameters[35][4];
|
||||
|
||||
virtual void Restore(Base::XMLReader & reader);
|
||||
|
||||
virtual void updateProps();
|
||||
|
||||
@@ -167,7 +167,9 @@ TaskHoleParameters::TaskHoleParameters(ViewProviderHole *HoleView, QWidget *pare
|
||||
else
|
||||
ui->drillPointAngled->setChecked(true);
|
||||
ui->DrillPointAngle->setValue(pcHole->DrillPointAngle.getValue());
|
||||
ui->Tapered->setChecked(pcHole->ModelActualThread.getValue());
|
||||
ui->Tapered->setChecked(pcHole->Tapered.getValue());
|
||||
// Angle is only enabled (sensible) if tapered
|
||||
ui->TaperedAngle->setEnabled(pcHole->Tapered.getValue());
|
||||
ui->TaperedAngle->setValue(pcHole->TaperedAngle.getValue());
|
||||
ui->Reversed->setChecked(pcHole->Reversed.getValue());
|
||||
|
||||
@@ -793,7 +795,7 @@ long TaskHoleParameters::getThreadClass() const
|
||||
|
||||
long TaskHoleParameters::getThreadFit() const
|
||||
{
|
||||
// the fit is independent if the hole is threaded or not
|
||||
// the fit (clearance) is independent if the hole is threaded or not
|
||||
// since an unthreaded hole for a screw can also have a close fit
|
||||
return ui->ThreadFit->currentIndex();
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user