summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testdata/scad/features/hull2-tests.scad30
-rw-r--r--testdata/scad/features/hull3-tests.scad (renamed from testdata/scad/features/hull-tests.scad)22
-rw-r--r--tests/CMakeLists.txt7
-rw-r--r--tests/regression/cgalpngtest/hull2-tests-expected.pngbin0 -> 7531 bytes
-rw-r--r--tests/regression/opencsgtest/hull2-tests-expected.pngbin0 -> 8078 bytes
5 files changed, 34 insertions, 25 deletions
diff --git a/testdata/scad/features/hull2-tests.scad b/testdata/scad/features/hull2-tests.scad
new file mode 100644
index 0000000..3bea3c5
--- /dev/null
+++ b/testdata/scad/features/hull2-tests.scad
@@ -0,0 +1,30 @@
+module convex2dSimple() {
+ hull() {
+ translate([15,10]) circle(10);
+ circle(10);
+ }
+}
+
+module concave2dSimple() {
+ hull() {
+ translate([15,10]) square(2);
+ translate([15,0]) square(2);
+ square(2);
+ }
+}
+
+// Works correctly
+module convex2dHole() {
+ hull() {
+ translate([15,10,0]) circle(10);
+ difference() {
+ circle(10);
+ circle(5);
+ }
+ }
+}
+
+
+convex2dHole();
+translate([40,0,0]) convex2dSimple();
+translate([0,-20,0]) concave2dSimple();
diff --git a/testdata/scad/features/hull-tests.scad b/testdata/scad/features/hull3-tests.scad
index 3114ac5..a3e7d92 100644
--- a/testdata/scad/features/hull-tests.scad
+++ b/testdata/scad/features/hull3-tests.scad
@@ -1,22 +1,3 @@
-// Works correctly
-module convex2dSimple() {
- hull() {
- translate([15,10]) circle(10);
- circle(10);
- }
-}
-
-// Works correctly
-module convex2dHole() {
- hull() {
- translate([15,10,0]) circle(10);
- difference() {
- circle(10);
- circle(5);
- }
- }
-}
-
// 3d not currently implemented
module convex3dSimple() {
hull() {
@@ -36,8 +17,5 @@ module convex3dHole() {
}
}
-
-convex2dHole();
-translate([40,0,0]) convex2dSimple();
translate([0,40,0]) convex3dHole();
translate([40,40,0]) convex3dSimple();
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 41fd0cd..b0aa6ed 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -144,7 +144,7 @@ include_directories(${CGAL_INCLUDE_DIRS})
#
add_executable(cgaltest cgaltest.cc ../src/CGAL_Nef_polyhedron.cc ../src/CSGTermEvaluator.cc
../src/CGALEvaluator.cc ../src/PolySetCGALEvaluator.cc ../src/qhash.cc
- ../src/CGAL_Nef_polyhedron_DxfData.cc ../src/cgaladv_minkowski2.cc
+ ../src/CGAL_Nef_polyhedron_DxfData.cc ../src/cgaladv_minkowski2.cc ../src/cgaladv_convexhull2.cc
${COMMON_SOURCES})
set_target_properties(cgaltest PROPERTIES COMPILE_FLAGS "-DENABLE_CGAL ${CGAL_CXX_FLAGS_INIT}")
target_link_libraries(cgaltest ${CGAL_LIBRARY} ${CGAL_3RD_PARTY_LIBRARIES} ${QT_LIBRARIES} ${OPENGL_LIBRARY})
@@ -156,7 +156,7 @@ add_executable(cgalpngtest cgalpngtest.cc OffscreenView.cc OffscreenContext.mm
../src/CGALRenderer.cc ../src/CGAL_Nef_polyhedron.cc
../src/CSGTermEvaluator.cc ../src/CGALEvaluator.cc
../src/PolySetCGALEvaluator.cc ../src/qhash.cc
- ../src/CGAL_Nef_polyhedron_DxfData.cc ../src/cgaladv_minkowski2.cc
+ ../src/CGAL_Nef_polyhedron_DxfData.cc ../src/cgaladv_minkowski2.cc ../src/cgaladv_convexhull2.cc
${COMMON_SOURCES})
set_target_properties(cgalpngtest PROPERTIES COMPILE_FLAGS "-DENABLE_CGAL ${CGAL_CXX_FLAGS_INIT}")
target_link_libraries(cgalpngtest ${CGAL_LIBRARY} ${CGAL_3RD_PARTY_LIBRARIES} ${QT_LIBRARIES} ${GLEW_LIBRARY} ${COCOA_LIBRARY} ${OPENGL_LIBRARY})
@@ -168,7 +168,7 @@ add_executable(opencsgtest opencsgtest.cc OffscreenView.cc OffscreenContext.mm
../src/OpenCSGRenderer.cc ../src/ThrownTogetherRenderer.cc
../src/CSGTermEvaluator.cc ../src/CGAL_Nef_polyhedron.cc
../src/CGALEvaluator.cc ../src/PolySetCGALEvaluator.cc ../src/qhash.cc
- ../src/CGAL_Nef_polyhedron_DxfData.cc ../src/cgaladv_minkowski2.cc
+ ../src/CGAL_Nef_polyhedron_DxfData.cc ../src/cgaladv_minkowski2.cc ../src/cgaladv_convexhull2.cc
${COMMON_SOURCES})
set_target_properties(opencsgtest PROPERTIES COMPILE_FLAGS "-DENABLE_OPENCSG -DENABLE_CGAL ${CGAL_CXX_FLAGS_INIT}")
target_link_libraries(opencsgtest ${CGAL_LIBRARY} ${CGAL_3RD_PARTY_LIBRARIES} ${QT_LIBRARIES} ${OPENCSG_LIBRARY} ${GLEW_LIBRARY} ${COCOA_LIBRARY} ${OPENGL_LIBRARY})
@@ -219,6 +219,7 @@ LIST(APPEND CGALPNGTEST_FILES
${CMAKE_SOURCE_DIR}/../testdata/scad/features/rotate_extrude-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/features/minkowski2-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/features/minkowski3-tests.scad
+ ${CMAKE_SOURCE_DIR}/../testdata/scad/features/hull2-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/features/surface-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/features/import_dxf-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/features/transform-tests.scad
diff --git a/tests/regression/cgalpngtest/hull2-tests-expected.png b/tests/regression/cgalpngtest/hull2-tests-expected.png
new file mode 100644
index 0000000..256b349
--- /dev/null
+++ b/tests/regression/cgalpngtest/hull2-tests-expected.png
Binary files differ
diff --git a/tests/regression/opencsgtest/hull2-tests-expected.png b/tests/regression/opencsgtest/hull2-tests-expected.png
new file mode 100644
index 0000000..66ee6b2
--- /dev/null
+++ b/tests/regression/opencsgtest/hull2-tests-expected.png
Binary files differ
contact: Jan Huwald // Impressum