feat(v4.3): offset_section_view — stepped section with multiple parallel planes
CI / Build & Test (push) Failing after 32s
CI / Release Build (push) Failing after 16m59s
Build & Test / build-and-test (push) Has been cancelled
Build & Test / python-bindings (push) Has been cancelled

- offset_section_view(body, normal, offsets): combines section profiles at each offset
- Step lines connect boundaries between adjacent planes
- 4 new tests
This commit is contained in:
茂之钳
2026-07-25 07:18:49 +00:00
parent 1e196473bc
commit 93852075dd
3 changed files with 115 additions and 0 deletions
+29
View File
@@ -242,3 +242,32 @@ TEST(BrepDrawingTest, ProjectionView_TotalSegments) {
v.hidden_lines = {{0,1,0,0, true}};
EXPECT_EQ(v.total_segments(), 3u);
}
// ═══════════════════════════════════════════════════════════
// Offset (stepped) section views
// ═══════════════════════════════════════════════════════════
TEST(OffsetSectionTest, SingleOffset) {
auto box = make_box(4, 4, 4);
auto view = offset_section_view(box, Vector3D(0, 0, 1), {0.0});
EXPECT_FALSE(view.segments.empty());
EXPECT_EQ(view.name, "offset_section");
}
TEST(OffsetSectionTest, MultipleOffsets) {
auto box = make_box(4, 4, 4);
auto view = offset_section_view(box, Vector3D(0, 0, 1), {-1.0, 0.0, 1.0});
EXPECT_GE(view.segments.size(), 3u); // section + step lines
}
TEST(OffsetSectionTest, EmptyOffsets) {
auto box = make_box(4, 4, 4);
auto view = offset_section_view(box, Vector3D(0, 0, 1), {});
EXPECT_TRUE(view.segments.empty());
}
TEST(OffsetSectionTest, CylinderSection) {
auto cyl = make_cylinder(2, 6, 32);
auto view = offset_section_view(cyl, Vector3D(0, 0, 1), {-2.0, 0.0, 2.0});
EXPECT_GE(view.total_segments(), 3u);
}