feat(v4.3): offset_section_view — stepped section with multiple parallel planes
- 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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user