feat(v4.4): complete remaining v4.1-v4.4 features + precision tolerance + Euler ops

v4.1 收尾:
- IncrementalUpdateEngine: dirty flag propagation, cache invalidation
- LargeAssembly: InstanceCache, assembly instancing
- STEP import: robust/graceful parsing with skip tracking

v4.3 分析工具:
- Mass properties (volume, centroid, inertia tensor)
- Clearance analysis, wall thickness analysis
- Enhanced drawing: hidden-line removal, offset sections, BOM
- DXF import (LINE/CIRCLE/ARC/LWPOLYLINE/SPLINE → B-Rep extrusion)

v4.4 地基加固:
- ToleranceChain: RSS cumulative tolerance propagation (7 tests)
- Euler operations: MEV/KEV/MEF/KEF/KEMR/MEKR (20 tests)
- Replace hardcoded tolerances with ToleranceConfig in validate
- Fix incremental_update test API mismatch (15/15 pass on Linux)

Docs:
- v4.1-v4.4 development plans + roadmap updated
- v4.4 marked complete on Linux

30 files, +3424/-210
This commit is contained in:
茂之钳
2026-07-26 16:42:55 +08:00
parent 138d8d24a0
commit fcf25e561d
18 changed files with 2644 additions and 9 deletions
+65
View File
@@ -91,3 +91,68 @@ TEST(ToleranceTest, ToleranceConfig_AllDefaultPositive) {
EXPECT_GT(cfg.boolean, 0);
EXPECT_GT(cfg.angular, 0);
}
// ── ToleranceChain tests ──
TEST(ToleranceChainTest, EmptyChain) {
ToleranceChain chain;
EXPECT_EQ(chain.depth(), 0u);
EXPECT_EQ(chain.cumulative(), 0.0);
EXPECT_EQ(chain.max_step(), 0.0);
}
TEST(ToleranceChainTest, SingleStep) {
ToleranceChain chain;
chain.push("intersect", 1e-6);
EXPECT_EQ(chain.depth(), 1u);
EXPECT_DOUBLE_EQ(chain.cumulative(), 1e-6);
EXPECT_DOUBLE_EQ(chain.max_step(), 1e-6);
}
TEST(ToleranceChainTest, MultiStepRSS) {
ToleranceChain chain;
chain.push("a", 3e-6);
chain.push("b", 4e-6);
// RSS: sqrt(3² + 4²) * 1e-6 = 5e-6
EXPECT_DOUBLE_EQ(chain.cumulative(), 5e-6);
}
TEST(ToleranceChainTest, MaxStep) {
ToleranceChain chain;
chain.push("small", 1e-8);
chain.push("large", 1e-4);
chain.push("med", 1e-6);
EXPECT_DOUBLE_EQ(chain.max_step(), 1e-4);
}
TEST(ToleranceChainTest, ClearResets) {
ToleranceChain chain;
chain.push("x", 1e-6);
chain.clear();
EXPECT_EQ(chain.depth(), 0u);
EXPECT_EQ(chain.cumulative(), 0.0);
}
TEST(ToleranceChainTest, StepsAccess) {
ToleranceChain chain;
chain.push("op1", 1e-9);
chain.push("op2", 2e-9);
auto& steps = chain.steps();
ASSERT_EQ(steps.size(), 2u);
EXPECT_EQ(steps[0].first, "op1");
EXPECT_DOUBLE_EQ(steps[0].second, 1e-9);
EXPECT_EQ(steps[1].first, "op2");
EXPECT_DOUBLE_EQ(steps[1].second, 2e-9);
}
TEST(ToleranceChainTest, BooleanChainSimulation) {
ToleranceChain chain;
chain.push("intersect", 1e-6);
chain.push("split", 1e-6);
chain.push("classify", 1e-7);
chain.push("sew", 1e-5);
// Cumulative should be dominated by the sewer step
double cum = chain.cumulative();
EXPECT_GT(cum, 1e-5);
EXPECT_LT(cum, 1.5e-5);
}