Calcolatore Passi Filettature Metriche/UNC
` : '';
const resultsHTML = `
📋 Riepilogo Filettatura
Designazione
${threadDesignation}
Passo (mm)
${pitchMM.toFixed(3)}
Tolleranza Vite
${boltTol}
Tolleranza Madrevite
${nutTol}
${conversion}
📐 Diametri Calcolati
Vite - Ø Esterno
${boltMajor.toFixed(3)} mm
Vite - Ø Passo
${boltPitch.toFixed(3)} mm
Vite - Ø Nocciolo
${boltMinor.toFixed(3)} mm
Madrevite - Ø Interno
${nutMinor.toFixed(3)} mm
Madrevite - Ø Passo
${nutPitch.toFixed(3)} mm
Madrevite - Ø Esterno
${nutMajor.toFixed(3)} mm
🔍 Verifica Accoppiamento
${statusIcon} ${status}
Gioco Radiale
${clearance.toFixed(4)} mm
Altezza Filetto
${H.toFixed(3)} mm
${engagement > 0 ? `
Lunghezza Ingaggio
${engagement} mm
Capacità Teorica
${loadCapacity} mm²
` : ''}
${generateDiagram(boltMajor, boltMinor, nutMinor, nutMajor, clearance)}
${generateReferenceTable(type)}
`;
document.getElementById('results').innerHTML = resultsHTML;
document.getElementById('results').style.display = 'block';
}
function getTolerance(bolt, nut) {
const tolerances = {
'6g': 0.05, '6h': 0.03, '4h': 0.02,
'6H': 0.05, '6G': 0.08, '5H': 0.03,
'2A': 0.04, '3A': 0.02,
'2B': 0.04, '3B': 0.02
};
return (tolerances[bolt] || 0.04) + (tolerances[nut] || 0.04);
}
function generateDiagram(boltMajor, boltMinor, nutMinor, nutMajor, clearance) {
const scale = 15;
const centerX = 200;
const centerY = 150;
const boltMajorR = boltMajor / 2 * scale;
const boltMinorR = boltMinor / 2 * scale;
const nutMinorR = nutMinor / 2 * scale;
const nutMajorR = nutMajor / 2 * scale;
const color = clearance < -0.05 ? '#f8d7da' : clearance > 0.2 ? '#fff3cd' : '#d4edda';
return `
📊 Diagramma Sezione Filettatura
`;
}
function generateReferenceTable(type) {
if (type === 'metric') {
return `
📚 Tabella Riferimento Passi Metrici Standard
Diametro (mm) |
Passo Standard (mm) |
Passo Fine (mm) |
M3 | 0.5 | - |
M4 | 0.7 | 0.5 |
M5 | 0.8 | 0.5 |
M6 | 1.0 | 0.75 |
M8 | 1.25 | 1.0 |
M10 | 1.5 | 1.25 |
M12 | 1.75 | 1.25 |
M16 | 2.0 | 1.5 |
M20 | 2.5 | 1.5 |
M24 | 3.0 | 2.0 |
`;
} else {
return `
📚 Tabella Riferimento ${type.toUpperCase()} Standard
Designazione |
Diametro (inch) |
TPI |
Equivalente Metrico |
#4-40 | 0.112 | 40 | ≈ M3 |
#8-32 | 0.164 | 32 | ≈ M4 |
1/4-20 | 0.250 | 20 | ≈ M6 |
5/16-18 | 0.313 | 18 | ≈ M8 |
3/8-16 | 0.375 | 16 | ≈ M10 |
1/2-13 | 0.500 | 13 | ≈ M12 |
5/8-11 | 0.625 | 11 | ≈ M16 |
3/4-10 | 0.750 | 10 | ≈ M20 |
7/8-9 | 0.875 | 9 | ≈ M22 |
1"-8 | 1.000 | 8 | ≈ M24 |
`;
}
}