Skip to content

Instantly share code, notes, and snippets.

View afabri's full-sized avatar

Andreas Fabri afabri

View GitHub Profile
@afabri
afabri / point_iterator.cpp
Created June 8, 2015 14:07
An Ersatz for Surface_mesh<P>::Point_iterator
#include <vector>
#include <boost/foreach.hpp>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/centroid.h>
typedef CGAL::Simple_cartesian<double> K;
typedef CGAL::Surface_mesh<K::Point_3> Mesh;
@afabri
afabri / sdg.cpp
Created October 13, 2015 13:51
Segment Delaunay Graph
#include <iostream>
#include <fstream>
#include <cassert>
// example that uses the filtered traits,
// the segment Delaunay graph and the spatial sorting
// choose the kernel
#include <CGAL/Simple_cartesian.h>
@afabri
afabri / vertices.cpp
Created January 27, 2016 12:00
Distinguish inner and boundary vertices of a Mesh_complex_3_in_triangulation_3
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Mesh_triangulation_3.h>
#include <CGAL/Mesh_complex_3_in_triangulation_3.h>
#include <CGAL/Mesh_criteria_3.h>
#include <CGAL/Labeled_image_mesh_domain_3.h>
#include <CGAL/make_mesh_3.h>
#include <CGAL/Image_3.h>
@afabri
afabri / CoreBug.cpp
Last active March 4, 2016 15:39
minimal example for SVD bug
#include <iostream>
#include <CGAL/leda_real.h>
#include <CGAL/CORE_Expr.h>
#include <CGAL/Lazy_exact_nt.h>
std::ostream& operator<<(std::ostream& os, std::pair<double,double> p)
{
os << p.first << ", " << p.second;
return os;
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Constrained_Delaunay_triangulation_2.h>
// mesh refinement
#include <CGAL/Delaunay_mesher_2.h>
#include <CGAL/Delaunay_mesh_face_base_2.h>
#include <CGAL/Delaunay_mesh_size_criteria_2.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel meshTriKernel;
@afabri
afabri / mesh_with_my_seeding.cpp
Last active March 17, 2016 16:46
Seeding the mesh generator
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Mesh_triangulation_3.h>
#include <CGAL/Mesh_complex_3_in_triangulation_3.h>
#include <CGAL/Mesh_criteria_3.h>
#include <CGAL/Polyhedral_mesh_domain_3.h>
#include <CGAL/make_mesh_3.h>
#include <CGAL/refine_mesh_3.h>
#include <CGAL/grid_simplify_point_set.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polygon_mesh_processing/remesh.h>
#include <boost/function_output_iterator.hpp>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Polyhedron_items_with_id_3.h>
#include <fstream>
#include <vector>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Polyhedron_3<K, CGAL::Polyhedron_items_with_id_3> Poly;
@afabri
afabri / ray_shooting.cpp
Created April 25, 2016 13:09
ray shooting
#include <iostream>
#include <fstream>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/AABB_tree.h>
#include <CGAL/AABB_traits.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/AABB_face_graph_triangle_primitive.h>
#include <CGAL/Polygon_mesh_processing/compute_normal.h>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h>
#include <iostream>
#include <vector>
typedef CGAL::Simple_cartesian<double> Kernel;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
@afabri
afabri / intel_circular_kernel_variant_bug.cpp
Created October 14, 2016 15:42
Intel compiler ICE with CGAL::Circular_kernel_2 and boost::variant
#include <CGAL/Cartesian.h>
#include <CGAL/Algebraic_kernel_for_circles_2_2.h>
#include <CGAL/Circular_kernel_2.h>
int main()
{
typedef CGAL::Quotient<int> NT1;
typedef CGAL::Cartesian<NT1> Linear_k1;