diff --git a/testdata/scad/features/intersection-tests.scad b/testdata/scad/features/intersection-tests.scad index 4101b037..f673b353 100644 --- a/testdata/scad/features/intersection-tests.scad +++ b/testdata/scad/features/intersection-tests.scad @@ -1,4 +1,35 @@ intersection() { - sphere(3); - cube([3,3,8], center=true); + sphere(r=5); + translate([0,0,3]) cube([4,4,6], center=true); +} + +translate([0,12,0]) intersection() { + cube([10,10,10], center=true); + cylinder(r=4, h=12, center=true); +} + +translate([12,0,0]) intersection() { + cube([10,10,10], center=true); + cylinder(r=4, h=12, center=true); + rotate([0,90,0]) cylinder(r=4, h=12, center=true); +} + +translate([12,12,0]) intersection() { + cube([10,10,10], center=true); + translate([0,0,7]) cylinder(r=4, h=4, center=true); +} + +translate([24,0,0]) intersection() { + cube([10,10,10], center=true); + translate([0,0,6.99]) cylinder(r=4, h=4, center=true); +} + +translate([-12,0,0]) intersection() { + cube([10,10,10], center=true); + translate([0,-10,-10]) cube([10,10,10], center=true); +} + +translate([-12,12,0]) intersection() { + cube([10,10,10], center=true); + translate([0,-9.99,-9.99]) cube([10,10,10], center=true); } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 26533af0..161eadef 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -208,7 +208,8 @@ LIST(APPEND CGALPNGTEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/features/sphere-tests.scad ${CMAKE_SOURCE_DIR}/../testdata/scad/features/cylinder-tests.scad ${CMAKE_SOURCE_DIR}/../testdata/scad/features/union-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/difference-tests.scad) + ${CMAKE_SOURCE_DIR}/../testdata/scad/features/difference-tests.scad + ${CMAKE_SOURCE_DIR}/../testdata/scad/features/intersection-tests.scad) #LIST(APPEND CGALPNGTEST_FILES ${CMAKE_SOURCE_DIR}/../examples/example001.scad) add_cmdline_test(cgalpngtest png ${CGALPNGTEST_FILES}) diff --git a/tests/regression/cgalpngtest/intersection-tests-expected.png b/tests/regression/cgalpngtest/intersection-tests-expected.png new file mode 100644 index 00000000..6d004b03 Binary files /dev/null and b/tests/regression/cgalpngtest/intersection-tests-expected.png differ