Add test cases.
2059
testdata/amf/cube-with-hole.amf
vendored
Normal file
BIN
testdata/amf/multi-volume-binary.amf
vendored
Normal file
257
testdata/amf/sphere20face.amf
vendored
Normal file
|
|
@ -0,0 +1,257 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--AMF generated by Jonathan Hiller's XmlStream class, originally written for AMF file format (http://amf.wikispaces.com/)-->
|
||||||
|
<amf unit="inch" version="1.1">
|
||||||
|
<metadata type="name">Sphere20</metadata>
|
||||||
|
<object id="3">
|
||||||
|
<mesh>
|
||||||
|
<vertices>
|
||||||
|
<vertex>
|
||||||
|
<coordinates>
|
||||||
|
<x>-2.62866</x>
|
||||||
|
<y>4.25325</y>
|
||||||
|
<z>0</z>
|
||||||
|
</coordinates>
|
||||||
|
<normal>
|
||||||
|
<nx>-0.525731</nx>
|
||||||
|
<ny>0.850651</ny>
|
||||||
|
<nz>0</nz>
|
||||||
|
</normal>
|
||||||
|
</vertex>
|
||||||
|
<vertex>
|
||||||
|
<coordinates>
|
||||||
|
<x>2.62866</x>
|
||||||
|
<y>4.25325</y>
|
||||||
|
<z>0</z>
|
||||||
|
</coordinates>
|
||||||
|
<normal>
|
||||||
|
<nx>0.525731</nx>
|
||||||
|
<ny>0.850651</ny>
|
||||||
|
<nz>0</nz>
|
||||||
|
</normal>
|
||||||
|
</vertex>
|
||||||
|
<vertex>
|
||||||
|
<coordinates>
|
||||||
|
<x>-2.62866</x>
|
||||||
|
<y>-4.25325</y>
|
||||||
|
<z>0</z>
|
||||||
|
</coordinates>
|
||||||
|
<normal>
|
||||||
|
<nx>-0.525731</nx>
|
||||||
|
<ny>-0.850651</ny>
|
||||||
|
<nz>0</nz>
|
||||||
|
</normal>
|
||||||
|
</vertex>
|
||||||
|
<vertex>
|
||||||
|
<coordinates>
|
||||||
|
<x>2.62866</x>
|
||||||
|
<y>-4.25325</y>
|
||||||
|
<z>0</z>
|
||||||
|
</coordinates>
|
||||||
|
<normal>
|
||||||
|
<nx>0.525731</nx>
|
||||||
|
<ny>-0.850651</ny>
|
||||||
|
<nz>0</nz>
|
||||||
|
</normal>
|
||||||
|
</vertex>
|
||||||
|
<vertex>
|
||||||
|
<coordinates>
|
||||||
|
<x>0</x>
|
||||||
|
<y>-2.62866</y>
|
||||||
|
<z>4.25325</z>
|
||||||
|
</coordinates>
|
||||||
|
<normal>
|
||||||
|
<nx>0</nx>
|
||||||
|
<ny>-0.525731</ny>
|
||||||
|
<nz>0.850651</nz>
|
||||||
|
</normal>
|
||||||
|
</vertex>
|
||||||
|
<vertex>
|
||||||
|
<coordinates>
|
||||||
|
<x>0</x>
|
||||||
|
<y>2.62866</y>
|
||||||
|
<z>4.25325</z>
|
||||||
|
</coordinates>
|
||||||
|
<normal>
|
||||||
|
<nx>0</nx>
|
||||||
|
<ny>0.525731</ny>
|
||||||
|
<nz>0.850651</nz>
|
||||||
|
</normal>
|
||||||
|
</vertex>
|
||||||
|
<vertex>
|
||||||
|
<coordinates>
|
||||||
|
<x>0</x>
|
||||||
|
<y>-2.62866</y>
|
||||||
|
<z>-4.25325</z>
|
||||||
|
</coordinates>
|
||||||
|
<normal>
|
||||||
|
<nx>0</nx>
|
||||||
|
<ny>-0.525731</ny>
|
||||||
|
<nz>-0.850651</nz>
|
||||||
|
</normal>
|
||||||
|
</vertex>
|
||||||
|
<vertex>
|
||||||
|
<coordinates>
|
||||||
|
<x>0</x>
|
||||||
|
<y>2.62866</y>
|
||||||
|
<z>-4.25325</z>
|
||||||
|
</coordinates>
|
||||||
|
<normal>
|
||||||
|
<nx>0</nx>
|
||||||
|
<ny>0.525731</ny>
|
||||||
|
<nz>-0.850651</nz>
|
||||||
|
</normal>
|
||||||
|
</vertex>
|
||||||
|
<vertex>
|
||||||
|
<coordinates>
|
||||||
|
<x>4.25325</x>
|
||||||
|
<y>0</y>
|
||||||
|
<z>-2.62866</z>
|
||||||
|
</coordinates>
|
||||||
|
<normal>
|
||||||
|
<nx>0.850651</nx>
|
||||||
|
<ny>0</ny>
|
||||||
|
<nz>-0.525731</nz>
|
||||||
|
</normal>
|
||||||
|
</vertex>
|
||||||
|
<vertex>
|
||||||
|
<coordinates>
|
||||||
|
<x>4.25325</x>
|
||||||
|
<y>0</y>
|
||||||
|
<z>2.62866</z>
|
||||||
|
</coordinates>
|
||||||
|
<normal>
|
||||||
|
<nx>0.850651</nx>
|
||||||
|
<ny>0</ny>
|
||||||
|
<nz>0.525731</nz>
|
||||||
|
</normal>
|
||||||
|
</vertex>
|
||||||
|
<vertex>
|
||||||
|
<coordinates>
|
||||||
|
<x>-4.25325</x>
|
||||||
|
<y>0</y>
|
||||||
|
<z>-2.62866</z>
|
||||||
|
</coordinates>
|
||||||
|
<normal>
|
||||||
|
<nx>-0.850651</nx>
|
||||||
|
<ny>0</ny>
|
||||||
|
<nz>-0.525731</nz>
|
||||||
|
</normal>
|
||||||
|
</vertex>
|
||||||
|
<vertex>
|
||||||
|
<coordinates>
|
||||||
|
<x>-4.25325</x>
|
||||||
|
<y>0</y>
|
||||||
|
<z>2.62866</z>
|
||||||
|
</coordinates>
|
||||||
|
<normal>
|
||||||
|
<nx>-0.850651</nx>
|
||||||
|
<ny>0</ny>
|
||||||
|
<nz>0.525731</nz>
|
||||||
|
</normal>
|
||||||
|
</vertex>
|
||||||
|
</vertices>
|
||||||
|
<volume>
|
||||||
|
<triangle>
|
||||||
|
<v1>0</v1>
|
||||||
|
<v2>11</v2>
|
||||||
|
<v3>5</v3>
|
||||||
|
</triangle>
|
||||||
|
<triangle>
|
||||||
|
<v1>0</v1>
|
||||||
|
<v2>5</v2>
|
||||||
|
<v3>1</v3>
|
||||||
|
</triangle>
|
||||||
|
<triangle>
|
||||||
|
<v1>0</v1>
|
||||||
|
<v2>1</v2>
|
||||||
|
<v3>7</v3>
|
||||||
|
</triangle>
|
||||||
|
<triangle>
|
||||||
|
<v1>0</v1>
|
||||||
|
<v2>7</v2>
|
||||||
|
<v3>10</v3>
|
||||||
|
</triangle>
|
||||||
|
<triangle>
|
||||||
|
<v1>0</v1>
|
||||||
|
<v2>10</v2>
|
||||||
|
<v3>11</v3>
|
||||||
|
</triangle>
|
||||||
|
<triangle>
|
||||||
|
<v1>1</v1>
|
||||||
|
<v2>5</v2>
|
||||||
|
<v3>9</v3>
|
||||||
|
</triangle>
|
||||||
|
<triangle>
|
||||||
|
<v1>5</v1>
|
||||||
|
<v2>11</v2>
|
||||||
|
<v3>4</v3>
|
||||||
|
</triangle>
|
||||||
|
<triangle>
|
||||||
|
<v1>11</v1>
|
||||||
|
<v2>10</v2>
|
||||||
|
<v3>2</v3>
|
||||||
|
</triangle>
|
||||||
|
<triangle>
|
||||||
|
<v1>10</v1>
|
||||||
|
<v2>7</v2>
|
||||||
|
<v3>6</v3>
|
||||||
|
</triangle>
|
||||||
|
<triangle>
|
||||||
|
<v1>7</v1>
|
||||||
|
<v2>1</v2>
|
||||||
|
<v3>8</v3>
|
||||||
|
</triangle>
|
||||||
|
<triangle>
|
||||||
|
<v1>3</v1>
|
||||||
|
<v2>9</v2>
|
||||||
|
<v3>4</v3>
|
||||||
|
</triangle>
|
||||||
|
<triangle>
|
||||||
|
<v1>3</v1>
|
||||||
|
<v2>4</v2>
|
||||||
|
<v3>2</v3>
|
||||||
|
</triangle>
|
||||||
|
<triangle>
|
||||||
|
<v1>3</v1>
|
||||||
|
<v2>2</v2>
|
||||||
|
<v3>6</v3>
|
||||||
|
</triangle>
|
||||||
|
<triangle>
|
||||||
|
<v1>3</v1>
|
||||||
|
<v2>6</v2>
|
||||||
|
<v3>8</v3>
|
||||||
|
</triangle>
|
||||||
|
<triangle>
|
||||||
|
<v1>3</v1>
|
||||||
|
<v2>8</v2>
|
||||||
|
<v3>9</v3>
|
||||||
|
</triangle>
|
||||||
|
<triangle>
|
||||||
|
<v1>4</v1>
|
||||||
|
<v2>9</v2>
|
||||||
|
<v3>5</v3>
|
||||||
|
</triangle>
|
||||||
|
<triangle>
|
||||||
|
<v1>2</v1>
|
||||||
|
<v2>4</v2>
|
||||||
|
<v3>11</v3>
|
||||||
|
</triangle>
|
||||||
|
<triangle>
|
||||||
|
<v1>6</v1>
|
||||||
|
<v2>2</v2>
|
||||||
|
<v3>10</v3>
|
||||||
|
</triangle>
|
||||||
|
<triangle>
|
||||||
|
<v1>8</v1>
|
||||||
|
<v2>6</v2>
|
||||||
|
<v3>7</v3>
|
||||||
|
</triangle>
|
||||||
|
<triangle>
|
||||||
|
<v1>9</v1>
|
||||||
|
<v2>8</v2>
|
||||||
|
<v3>1</v3>
|
||||||
|
</triangle>
|
||||||
|
</volume>
|
||||||
|
</mesh>
|
||||||
|
</object>
|
||||||
|
</amf>
|
||||||
BIN
testdata/amf/split_pyramid.amf
vendored
Normal file
22
testdata/amf/tetra_multicolor.amf
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<amf unit="inch" version="1.1">
|
||||||
|
<metadata type="name">Color Tetrahedron</metadata>
|
||||||
|
<object id="1">
|
||||||
|
<color><r>1</r><g>1</g><b>1</b></color>
|
||||||
|
<mesh>
|
||||||
|
<vertices>
|
||||||
|
<vertex><coordinates><x>0</x><y>0</y><z>0</z></coordinates></vertex>
|
||||||
|
<vertex><coordinates><x>1</x><y>0.25</y><z>0</z></coordinates></vertex>
|
||||||
|
<vertex><coordinates><x>0.25</x><y>1</y><z>0</z></coordinates></vertex>
|
||||||
|
<vertex><coordinates><x>0.4</x><y>0.4</y><z>0.5</z></coordinates></vertex>
|
||||||
|
</vertices>
|
||||||
|
<volume>
|
||||||
|
<metadata type="name">Hard side</metadata>
|
||||||
|
<triangle><v1>2</v1><v2>1</v2><v3>0</v3><color><r>1</r><g>0</g><b>0</b></color></triangle>
|
||||||
|
<triangle><v1>0</v1><v2>1</v2><v3>3</v3><color><r>0</r><g>1</g><b>0</b></color></triangle>
|
||||||
|
<triangle><v1>3</v1><v2>1</v2><v3>2</v3><color><r>0</r><g>0</g><b>1</b></color></triangle>
|
||||||
|
<triangle><v1>0</v1><v2>3</v2><v3>2</v3></triangle>
|
||||||
|
</volume>
|
||||||
|
</mesh>
|
||||||
|
</object>
|
||||||
|
</amf>
|
||||||
3
testdata/scad/amf/cube-with-hole.scad
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
// converted from STL by cura, unzipped
|
||||||
|
import("../../amf/cube-with-hole.amf");
|
||||||
|
|
||||||
3
testdata/scad/amf/multi-volume-binary.scad
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
// converted from STL and split by cura, zipped
|
||||||
|
import("../../amf/multi-volume-binary.amf");
|
||||||
|
|
||||||
3
testdata/scad/amf/sphere20face.scad
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
// example file from http://amf.wikispaces.com/AMF+test+files
|
||||||
|
import("../../amf/sphere20face.amf");
|
||||||
|
|
||||||
3
testdata/scad/amf/split_pyramid.scad
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
// example file from http://amf.wikispaces.com/AMF+test+files
|
||||||
|
import("../../amf/split_pyramid.amf");
|
||||||
|
|
||||||
3
testdata/scad/amf/tetra_multicolor.scad
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
// example file from http://amf.wikispaces.com/AMF+test+files
|
||||||
|
import("../../amf/tetra_multicolor.amf");
|
||||||
|
|
||||||
|
|
@ -757,6 +757,7 @@ set(NOCGAL_SOURCES
|
||||||
../src/builtin.cc
|
../src/builtin.cc
|
||||||
../src/import.cc
|
../src/import.cc
|
||||||
../src/import_stl.cc
|
../src/import_stl.cc
|
||||||
|
../src/import_amf.cc
|
||||||
../src/import_off.cc
|
../src/import_off.cc
|
||||||
../src/import_svg.cc
|
../src/import_svg.cc
|
||||||
../src/export.cc
|
../src/export.cc
|
||||||
|
|
@ -771,7 +772,6 @@ set(NOCGAL_SOURCES
|
||||||
../src/polyset-utils.cc
|
../src/polyset-utils.cc
|
||||||
../src/GeometryUtils.cc)
|
../src/GeometryUtils.cc)
|
||||||
|
|
||||||
|
|
||||||
set(CGAL_SOURCES
|
set(CGAL_SOURCES
|
||||||
${NOCGAL_SOURCES}
|
${NOCGAL_SOURCES}
|
||||||
../src/CSGTreeEvaluator.cc
|
../src/CSGTreeEvaluator.cc
|
||||||
|
|
@ -1032,7 +1032,7 @@ function(add_cmdline_test TESTCMD_BASENAME)
|
||||||
if (${EXPERIMENTAL} EQUAL -1)
|
if (${EXPERIMENTAL} EQUAL -1)
|
||||||
set(EXPERIMENTAL_OPTION "")
|
set(EXPERIMENTAL_OPTION "")
|
||||||
else()
|
else()
|
||||||
set(EXPERIMENTAL_OPTION "--enable=lc-each" "--enable=lc-else" "--enable=lc-for-c")
|
set(EXPERIMENTAL_OPTION "--enable=lc-each" "--enable=lc-else" "--enable=lc-for-c" "--enable=amf-import")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# 2D tests should be viewed from the top, not an angle.
|
# 2D tests should be viewed from the top, not an angle.
|
||||||
|
|
@ -1138,6 +1138,7 @@ file(GLOB FEATURES_2D_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/2D/features/*.s
|
||||||
file(GLOB DEPRECATED_3D_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/3D/deprecated/*.scad)
|
file(GLOB DEPRECATED_3D_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/3D/deprecated/*.scad)
|
||||||
file(GLOB ISSUES_3D_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/3D/issues/*.scad)
|
file(GLOB ISSUES_3D_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/3D/issues/*.scad)
|
||||||
file(GLOB SCAD_DXF_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/dxf/*.scad)
|
file(GLOB SCAD_DXF_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/dxf/*.scad)
|
||||||
|
file(GLOB SCAD_AMF_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/amf/*.scad)
|
||||||
file(GLOB FUNCTION_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/functions/*.scad)
|
file(GLOB FUNCTION_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/functions/*.scad)
|
||||||
file(GLOB_RECURSE EXAMPLE_3D_FILES ${CMAKE_SOURCE_DIR}/../examples/*.scad)
|
file(GLOB_RECURSE EXAMPLE_3D_FILES ${CMAKE_SOURCE_DIR}/../examples/*.scad)
|
||||||
|
|
||||||
|
|
@ -1213,7 +1214,7 @@ list(APPEND DUMPTEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/escape-test
|
||||||
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allmodules.scad)
|
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allmodules.scad)
|
||||||
|
|
||||||
list(APPEND CGALPNGTEST_2D_FILES ${FEATURES_2D_FILES} ${SCAD_DXF_FILES} ${EXAMPLE_2D_FILES})
|
list(APPEND CGALPNGTEST_2D_FILES ${FEATURES_2D_FILES} ${SCAD_DXF_FILES} ${EXAMPLE_2D_FILES})
|
||||||
list(APPEND CGALPNGTEST_3D_FILES ${FEATURES_3D_FILES} ${DEPRECATED_3D_FILES} ${ISSUES_3D_FILES} ${EXAMPLE_3D_FILES})
|
list(APPEND CGALPNGTEST_3D_FILES ${FEATURES_3D_FILES} ${SCAD_AMF_FILES} ${DEPRECATED_3D_FILES} ${ISSUES_3D_FILES} ${EXAMPLE_3D_FILES})
|
||||||
list(APPEND CGALPNGTEST_3D_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/include-tests.scad
|
list(APPEND CGALPNGTEST_3D_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/include-tests.scad
|
||||||
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/use-tests.scad
|
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/use-tests.scad
|
||||||
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/let-module-tests.scad
|
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/let-module-tests.scad
|
||||||
|
|
@ -1350,7 +1351,27 @@ disable_tests(csgpngtest_primitive-inf-tests
|
||||||
cgalpngtest_empty-shape-tests
|
cgalpngtest_empty-shape-tests
|
||||||
csgpngtest_issue1258)
|
csgpngtest_issue1258)
|
||||||
|
|
||||||
experimental_tests(echotest_list-comprehensions-experimental)
|
experimental_tests(echotest_list-comprehensions-experimental
|
||||||
|
cgalpngtest_cube-with-hole
|
||||||
|
cgalpngtest_multi-volume-binary
|
||||||
|
cgalpngtest_sphere20face
|
||||||
|
cgalpngtest_split_pyramid
|
||||||
|
cgalpngtest_tetra_multicolor
|
||||||
|
opencsgtest_cube-with-hole
|
||||||
|
opencsgtest_multi-volume-binary
|
||||||
|
opencsgtest_sphere20face
|
||||||
|
opencsgtest_split_pyramid
|
||||||
|
opencsgtest_tetra_multicolor
|
||||||
|
csgpngtest_cube-with-hole
|
||||||
|
csgpngtest_multi-volume-binary
|
||||||
|
csgpngtest_sphere20face
|
||||||
|
csgpngtest_split_pyramid
|
||||||
|
csgpngtest_tetra_multicolor
|
||||||
|
throwntogethertest_cube-with-hole
|
||||||
|
throwntogethertest_multi-volume-binary
|
||||||
|
throwntogethertest_sphere20face
|
||||||
|
throwntogethertest_split_pyramid
|
||||||
|
throwntogethertest_tetra_multicolor)
|
||||||
|
|
||||||
# Test config handling
|
# Test config handling
|
||||||
|
|
||||||
|
|
@ -1595,7 +1616,6 @@ add_cmdline_test(dxfpngtest EXE ${PYTHON_EXECUTABLE} SCRIPT ${CMAKE_SOURCE_DIR}/
|
||||||
|
|
||||||
add_cmdline_test(svgpngtest EXE ${PYTHON_EXECUTABLE} SCRIPT ${CMAKE_SOURCE_DIR}/export_import_pngtest.py ARGS --openscad=${OPENSCAD_BINPATH} --format=SVG --render=cgal --enable=svg-import EXPECTEDDIR cgalpngtest SUFFIX png FILES ${FILES_2D})
|
add_cmdline_test(svgpngtest EXE ${PYTHON_EXECUTABLE} SCRIPT ${CMAKE_SOURCE_DIR}/export_import_pngtest.py ARGS --openscad=${OPENSCAD_BINPATH} --format=SVG --render=cgal --enable=svg-import EXPECTEDDIR cgalpngtest SUFFIX png FILES ${FILES_2D})
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Failing tests
|
# Failing tests
|
||||||
#
|
#
|
||||||
|
|
|
||||||
BIN
tests/regression/cgalpngtest/cube-with-hole-expected.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
tests/regression/cgalpngtest/multi-volume-binary-expected.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
tests/regression/cgalpngtest/sphere20face-expected.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
tests/regression/cgalpngtest/split_pyramid-expected.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
tests/regression/cgalpngtest/tetra_multicolor-expected.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
tests/regression/opencsgtest/cube-with-hole-expected.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
tests/regression/opencsgtest/multi-volume-binary-expected.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
tests/regression/opencsgtest/sphere20face-expected.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
tests/regression/opencsgtest/split_pyramid-expected.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
tests/regression/opencsgtest/tetra_multicolor-expected.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
tests/regression/throwntogethertest/cube-with-hole-expected.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 12 KiB |
BIN
tests/regression/throwntogethertest/sphere20face-expected.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
tests/regression/throwntogethertest/split_pyramid-expected.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 4.7 KiB |