A modelled thread as other CAD systems write it to STEP has cylinder faces trimmed by helices that turn several times around the shaft, and cylinder faces bounded by two circles with no seam edge. The display planner refused any face whose boundary winds around its surface, so the whole body fell back to the reference mesher, which drew those faces with triangles across the solid. The planner now cuts such a face along a parameter line into one period: every loop and its copies a period apart are clipped to the strip, and the parts of the cut line inside the face join the pieces into closed loops, with the seam nodes made once for both sides. The cut face is meshed by Delaunay with sag refinement, and the sag check runs once more after shaping. Bodies with a face trimmed by more than one turn take their reference mesh (picking, measuring, the CPU viewport) from the plan too. Tests: an ISO M10x1.5 and M12x1.75 thread built from helices, as made and after a STEP round trip: the display mesh stays within the tolerance of its surfaces and the thread's volume, and has no degenerate, sliver or flipped triangles. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5c2fa3e9ca
commit
8535d229ff
6 files changed
+712
-16
No files matched your search
@@ -102,7 +102,14 @@ pub(crate) fn triangulate(boundary: &[[f64; 2]], loops: &[std::ops::Range<usize>
|
||||
.exclude_outer_faces(true)
|
||||
.with_angle_limit(AngleLimit::from_deg(MIN_ANGLE_DEG))
|
||||
.with_max_additional_vertices(budget.saturating_sub(added));
|
||||
let before = cdt.num_vertices();
|
||||
cdt.refine(params);
|
||||
let shaped = cdt.num_vertices().saturating_sub(before);
|
||||
// Shaping flips sides and adds points of its own; the triangles it leaves may
|
||||
// sag again (a long strip round a cylinder), so the sag is checked once more.
|
||||
if shaped > 0 {
|
||||
refine_sag(&mut cdt, sag, budget.saturating_sub(added + shaped), &from);
|
||||
}
|
||||
}
|
||||
// A split constraint would put a point on the boundary the neighbour does not have.
|
||||
if cdt.num_constraints() != constraints {
|
||||
|
||||
Reference in new issue
Block a user