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/Projection_traits_xy_3.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/Triangulation_vertex_base_with_info_2.h>
#include <fstream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Projection_traits_xy_3<K> Gt;
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Polygon_mesh_processing/measure.h>
#include <iostream>
namespace PMP = CGAL::Polygon_mesh_processing;
@afabri
afabri / poisson.cpp
Created July 18, 2017 13:10
read xyz, compute normal, orient, and Poisson reconstruction
#include <CGAL/trace.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/Surface_mesh_default_triangulation_3.h>
#include <CGAL/make_surface_mesh.h>
#include <CGAL/Implicit_surface_3.h>
#include <CGAL/IO/output_surface_facets_to_polyhedron.h>
#include <CGAL/Poisson_reconstruction_function.h>
#include <CGAL/Point_with_normal_3.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Periodic_2_Delaunay_triangulation_2.h>
#include <CGAL/Periodic_2_Delaunay_triangulation_traits_2.h>
#include <cassert>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Periodic_2_Delaunay_triangulation_traits_2<K> Gt;
// $ cl.exe -I c:/3rdPartyLibs/boost/boost_1_67_0 /EHsc -permissive- nonpermissive.cpp
// Microsoft (R) C/C++ Optimizing Compiler Version 19.13.26131.1 for x64
// Copyright (C) Microsoft Corporation. All rights reserved.
//
// nonpermissive.cpp
// nonpermissive.cpp(35): error C2760: syntax error: unexpected token 'constant', expected 'declaration'
// nonpermissive.cpp(35): note: This diagnostic occurred in the compiler generated function 'void X<T>::fct(void)'
// nonpermissive.cpp(38): note: see reference to class template instantiation 'X<T>' being compiled
#include <boost/variant/variant.hpp>
@afabri
afabri / coeff.cpp
Created May 15, 2018 07:45
Eigen coefficients and VC2013
#include <Eigen/Sparse>
int main()
{
Eigen::Matrix3d m3d;
int i_int = 0, j_int = 0;
std::size_t i_size_t = 0, j_size_t = 0;
std::ptrdiff_t i_ptrdiff_t = 0, j_ptrdiff_t = 0;
double d;
@afabri
afabri / test_delaunay_3.cpp
Created June 5, 2018 10:35
VS2017 unable to match function definition.
struct Point {};
namespace CGAL {
struct GT {
struct Point_3 {};
@afabri
afabri / eigen.cpp
Created June 8, 2018 14:05
Copying or reinterpret_cast
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <Eigen/Dense>
#include <vector>
#include <algorithm>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Point_3 Point_3;
int main()
{
@afabri
afabri / ellipsoid.cpp
Created July 19, 2018 12:19
meshing an ellipsoid
#include <CGAL/Surface_mesh_default_triangulation_3.h>
#include <CGAL/Complex_2_in_triangulation_3.h>
#include <CGAL/make_surface_mesh.h>
#include <CGAL/Implicit_surface_3.h>
#include <CGAL/IO/output_surface_facets_to_polyhedron.h>
#include <CGAL/IO/facets_in_complex_2_to_triangle_mesh.h>
#include <CGAL/Surface_mesh.h>
// default triangulation for Surface_mesher
#include <utility>
struct Vertex{};
typedef std::pair<int,int> Facet;
struct Simplex {
operator Vertex() { return Vertex();}
operator Facet() { return std::make_pair(1,1);}