An M8 modelled thread in a 6 mm hole, narrower than M8's minor diameter, was refused as "the face is too far from the thread's diameter". It now says what is wrong and what fits, as a hole that is too wide already does (#995): "this 6 mm hole is too narrow for a modelled M8 thread (its teeth would fill the hole); drill 6.75 mm for M8", with the thread that fits this hole when there is one. A shaft too thick for its thread gets "make the shaft 8 mm for M8". Fixes #2688 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: bherbruck <brennen.herbruck@gmail.com>
This commit is contained in:
+15
-1
@@ -382,7 +382,21 @@ fn thread_groove(t: &ThreadInfo, radius: f64, open: (bool, bool)) -> Result<soli
|
||||
(r_root, p / 8.0, r_out, (p / 4.0 + 2.0 * (r_out - r_root) * slope) / 2.0)
|
||||
};
|
||||
if w0.max(w1) * 2.0 >= p * 0.98 {
|
||||
return Err(DocError::Invalid("the face is too far from the thread's diameter".into()));
|
||||
// The groove would be wider than a pitch: the face is far inside the thread (a hole
|
||||
// narrower than its minor diameter, a shaft thicker than its major one, #2688).
|
||||
let (m, dia) = (&t.designation, 2.0 * radius);
|
||||
let alt = thread_for(dia, t.internal).map(|(n, q)| format_thread(n, q)).filter(|a| a != m);
|
||||
let shown = show_mm(dia);
|
||||
return Err(DocError::Invalid(if t.internal {
|
||||
let alt = alt.map(|a| format!(", or thread this hole {a}")).unwrap_or_default();
|
||||
format!(
|
||||
"this {shown} mm hole is too narrow for a modelled {m} thread (its teeth would fill the hole); drill {} mm for {m}{alt}",
|
||||
show_mm(d - p)
|
||||
)
|
||||
} else {
|
||||
let alt = alt.map(|a| format!(", or thread this shaft {a}")).unwrap_or_default();
|
||||
format!("this {shown} mm shaft is too thick for a modelled {m} thread; make the shaft {} mm for {m}{alt}", show_mm(d))
|
||||
}));
|
||||
}
|
||||
let k = t.axis;
|
||||
let u = k.cross(if k.x.abs() < 0.9 { Vec3::new(1.0, 0.0, 0.0) } else { Vec3::new(0.0, 1.0, 0.0) });
|
||||
|
||||
Reference in New Issue
Block a user