diff --git a/.gitattributes b/.gitattributes index 83d6688b44f..ec84ed86507 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2959,6 +2959,7 @@ Nef_3/test/Nef_3/data/octa.off -text svneol=unset#application/octet-stream Nef_3/test/Nef_3/data/star.off -text svneol=unset#application/octet-stream Nef_3/test/Nef_3/data/wrongly_oriented_cube.off -text Nef_3/test/Nef_3/makefile -text +Nef_3/test/Nef_3/nary.cpp -text Nef_S2/demo/Nef_S2/visualization.vcproj eol=crlf Nef_S2/doc_tex/Nef_S2/fig/complex.gif -text svneol=unset#image/gif Nef_S2/doc_tex/Nef_S2/fig/complex.pdf -text svneol=unset#application/pdf diff --git a/Nef_3/test/Nef_3/nary.cpp b/Nef_3/test/Nef_3/nary.cpp new file mode 100644 index 00000000000..b83d1e39402 --- /dev/null +++ b/Nef_3/test/Nef_3/nary.cpp @@ -0,0 +1,42 @@ +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; +typedef CGAL::Nef_polyhedron_3 Nef_polyhedron; +typedef CGAL::Nary_union Union; +typedef CGAL::Nary_intersection Intersection; +typedef Kernel::Vector_3 Vector_3; +typedef Kernel::Aff_transformation_3 Aff_transformation_3; + +int main() +{ + Nef_polyhedron N; + std::ifstream in("data/cube.nef3.SH"); + in >> N; + + Nef_polyhedron C0, C1, C2; + C0.transform(Aff_transformation_3(CGAL::TRANSLATION, Vector_3(1, 0, 0, 100))); + C1.transform(Aff_transformation_3(CGAL::TRANSLATION, Vector_3(0, 1, 0, 100))); + C2.transform(Aff_transformation_3(CGAL::TRANSLATION, Vector_3(0, 0, 1, 100))); + + Union u; + u.add_polyhedron(C0); + u.add_polyhedron(C1); + u.add_polyhedron(C2); + u.get_union(); + u.add_polyhedron(N); + + Intersection i; + i.add_polyhedron(C0); + i.add_polyhedron(C1); + i.add_polyhedron(C2); + i.get_intersection(); + i.add_polyhedron(N); + + return 0; +}