forked from 1b-agent/opencadstudio-upstream
fix(solids): a 3D drawing with bad pcurves opens instead of hanging
Two causes behind the load stalling at the scene-cache step: - Solids were fitted to the ACIS header's first tolerance-line value, which is the millimetres-per-unit scale (25.4 in this inch drawing, 1 in most), not a tolerance. It is now resabs, the second value. - The kernel (37b6902) drops pcurves that miss their edge and caps the pcurve walk, so a solid carrying a bad pcurve no longer refines an edge hundreds of thousands of times. Graph b741bd6. The attached drawing now meshes all 76 solids in 3.4 s (release) and opens in 19 s in a debug build. Fixes #1538 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
1952b4b0cb
commit
47f3e2e8ef
3 files changed
+14
-10
No files matched your search
@@ -103,10 +103,14 @@ pub fn tessellate_sat(
|
||||
// parameters leaves a hole, the same as one that never lifted — so both
|
||||
// are counted before calling the mesh whole.
|
||||
let mut undrawn = 0usize;
|
||||
let source_fit = if document.header.spatial_resolution.is_finite()
|
||||
&& document.header.spatial_resolution > 0.0
|
||||
{
|
||||
document.header.spatial_resolution
|
||||
// The header's tolerance line is `<mm per unit> <resabs> <resnor>`: the
|
||||
// codec's `spatial_resolution` is the unit scale (1, or 25.4 for inches)
|
||||
// and its `normal_tolerance` is resabs, the file's absolute tolerance.
|
||||
// Fitting to the unit scale let every edge wander a whole unit, and on a
|
||||
// bad pcurve that meant minutes of refinement (#1538).
|
||||
let resabs = document.header.normal_tolerance;
|
||||
let source_fit = if resabs.is_finite() && resabs > 0.0 && resabs < 1e-2 {
|
||||
resabs
|
||||
} else {
|
||||
DEFAULT_FIT_TOLERANCE
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user