Skip to content

Instantly share code, notes, and snippets.

View afabri's full-sized avatar

Andreas Fabri afabri

View GitHub Profile
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/boost/graph/IO/polygon_mesh_io.h>
#include <CGAL/AABB_face_graph_triangle_primitive.h>
#include <CGAL/AABB_tree.h>
#include <CGAL/AABB_traits.h>
#include <CGAL/Polygon_mesh_processing/locate.h>
#include <CGAL/Polygon_mesh_processing/compute_normal.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Constrained_Delaunay_triangulation_2.h>
#include <CGAL/Triangulation_face_base_with_info_2.h>
#include <CGAL/Delaunay_mesh_face_base_2.h>
#include <CGAL/Polygon_2.h>
#include <CGAL/IO/write_VTU.h>
#include <iostream>
@afabri
afabri / Kernel_traits_N.cpp
Created March 11, 2022 06:47
Find a kernel that is not the Dummy_kernel
#include <type_traits>
#include <typeinfo>
#include <iostream>
template <typename T>
struct Dummy
{};
@afabri
afabri / Protect_FPU_rounding.cpp
Created January 25, 2022 08:16
Setting the rounding mode influences output of double
// Produces this output
// https://cgal.geometryfactory.com/CGAL/testsuite/CGAL-5.5-Ic-5/Polynomial/TestReport_Christo_MSVC2017-Debug-64bits.gz
// 3
// 3.0000000000000001
#include <CGAL/Interval_nt.h>
int main() {
double d = 3;
@afabri
afabri / operator_with_pod.cpp
Created January 20, 2022 16:03
boost::multiprecision::mpq_rational * int and boost::multiprecision::mpq_rational + double fail
/* This fails with VC++ 2019 and boost 1.78 */
#include <boost/multiprecision/gmp.hpp>
#include <iostream>
typedef boost::multiprecision::mpq_rational Rational;
int main()
{
@afabri
afabri / atomic.cpp
Created January 19, 2022 13:44
VC2017 /permissive- fails on this
#include <atomic>
#include <iostream>
struct Parallel_tag {};
template <typename K, typename C>
struct Base {
typedef int A;
};
cmake_minimum_required(VERSION 3.1...3.22)
project(cdt)
include_directories(BEFORE ../src )
find_package(CGAL REQUIRED)
find_package(Boost REQUIRED)
find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater)
include(CGAL_Eigen3_support)
#include <CGAL/Simple_cartesian.h>
#include <CGAL/linear_least_squares_fitting_3.h>
#include <vector>
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::FT FT;
typedef Kernel::Point_3 Point;
typedef Kernel::Plane_3 Plane;
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/optimal_bounding_box.h>
#include <fstream>
#include <iostream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Point_3 Point;
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Nef_polyhedron_3.h>
#include <CGAL/Timer.h>
#include <fstream>
#include <iostream>
typedef CGAL::Exact_predicates_exact_constructions_kernel K;
typedef CGAL::Surface_mesh<K::Point_3> Polygon_mesh;