feat(v4.3): wall thickness analysis — centroid-offset sampling
- analyze_wall_thickness(): samples surface points, computes min distance to vertices/centroids on other faces (no mesh tessellation needed) - WallThicknessResult: min/max/avg, thin_threshold, thick_threshold - 3 new tests, 29/29 passing
This commit is contained in:
@@ -224,3 +224,30 @@ TEST(BomTest, EmptyAssembly) {
|
||||
auto bom = generate_bom(assy.root);
|
||||
EXPECT_TRUE(bom.empty());
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// Wall thickness analysis
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
TEST(WallThicknessTest, Box) {
|
||||
auto box = make_box(4, 4, 4); // 4×4×4 box
|
||||
auto result = analyze_wall_thickness(box, 3);
|
||||
// For a 4×4×4 box, wall thickness ~4.0 (opposite face distance)
|
||||
EXPECT_GT(result.min_thickness, 0.0);
|
||||
EXPECT_GT(result.max_thickness, 0.0);
|
||||
EXPECT_GT(result.avg_thickness, 0.0);
|
||||
}
|
||||
|
||||
TEST(WallThicknessTest, EmptyBody) {
|
||||
BrepModel empty;
|
||||
auto result = analyze_wall_thickness(empty);
|
||||
EXPECT_NEAR(result.min_thickness, 0.0, 1e-10);
|
||||
}
|
||||
|
||||
TEST(WallThicknessTest, ThinWallDetection) {
|
||||
// 4×4×0.5 thin plate
|
||||
auto plate = make_box(4, 4, 0.5);
|
||||
auto result = analyze_wall_thickness(plate, 3);
|
||||
EXPECT_GT(result.min_thickness, 0.0);
|
||||
EXPECT_LT(result.min_thickness, 1.0); // thin
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user