Skip to content

Instantly share code, notes, and snippets.

@pranavkantgaur
pranavkantgaur / tetgen.h
Created April 3, 2016 13:52
Tetgen header file
///////////////////////////////////////////////////////////////////////////////
// //
// TetGen //
// //
// A Quality Tetrahedral Mesh Generator and A 3D Delaunay Triangulator //
// //
// Version 1.5 //
// May 31, 2014 //
// //
// Copyright (C) 2002--2014 //
@pranavkantgaur
pranavkantgaur / lccWithFacetAttributes.cpp
Last active January 12, 2016 11:15
Creates LCC having LCC::Dart_handle type attributes associated with 2-cells.
#include <CGAL/Linear_cell_complex.h>
#include <CGAL/Linear_cell_complex_constructors.h>
using namespace std;
using namespace CGAL;
typedef Exact_predicates_inexact_constructions_kernel K;
typedef Linear_cell_complex_traits<3, K> Traits;
typedef Linear_cell_complex<3, 3, Traits> LCC;
@pranavkantgaur
pranavkantgaur / testFacetGeometry.cpp
Created January 4, 2016 08:58
Testing are_facets_same_geometry function
#include <CGAL/Linear_cell_complex.h>
using namespace std;
using namespace CGAL;
typedef Exact_predicates_inexact_constructions_kernel K;
typedef Linear_cell_complex_traits<3, K> Traits;
typedef Linear_cell_complex<3, 3, Traits> LCC;
typedef Point_3<K> Point;
@pranavkantgaur
pranavkantgaur / cdtGen.h
Last active July 4, 2016 12:20
This code reads input from a PLY file, computes its Delaunay triangulation, imports it into Linear Cell Complex and then writes it back to a PLY file.
#include <iostream>
#include <vector>
#include <math.h>
#include <map>
#include <unordered_set>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Triangulation_vertex_base_with_info_3.h>
#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Linear_cell_complex.h>
@pranavkantgaur
pranavkantgaur / experimentWithBeta.cpp
Last active August 29, 2015 14:18
Experimenting with beta pointers in LCC associated with infinite vertex.
#include <iostream>
#include <map>
#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Linear_cell_complex.h>
#include <CGAL/Linear_cell_complex_constructors.h>
using namespace std;
using namespace CGAL;
typedef Exact_predicates_inexact_constructions_kernel K;
@pranavkantgaur
pranavkantgaur / CubeDTLCCPLY.cpp
Last active August 29, 2015 14:17
This code computes Delaunay triangulation of a cube, imports it into a LCC and writes the LCC to a PLY file.
#include <iostream>
#include <map>
#include "rply.h"
#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Linear_cell_complex.h>
#include <CGAL/Linear_cell_complex_constructors.h>
using namespace std;
using namespace CGAL;
@pranavkantgaur
pranavkantgaur / autoCubeLCC.cpp
Last active August 29, 2015 14:16
Automatic construction of Linear Cell Complex of a cube
#include <iostream>
#include <vector>
#include <unordered_set>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Linear_cell_complex.h>
using namespace std;
using namespace CGAL;
typedef Exact_predicates_inexact_constructions_kernel K;
@pranavkantgaur
pranavkantgaur / plyTolccToply.cpp
Last active August 29, 2015 14:16
This program can be used for writing/reading data to/from PLY to CGAL's Linear cell complex representation
#include "rply.h"
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Linear_cell_complex.h>
#include <CGAL/Linear_cell_complex_constructors.h>
using namespace std;
using namespace CGAL;
struct MyItem
{
@pranavkantgaur
pranavkantgaur / cubeLCC.cpp
Last active August 29, 2015 14:15
Example code for representing cube in Linear cell complex using CGAL's LCC package
#include <iostream>
#include <vector>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Linear_cell_complex.h>
using namespace std;
using namespace CGAL;
typedef Exact_predicates_inexact_constructions_kernel K;
typedef Linear_cell_complex<3, 3> LCC;
@pranavkantgaur
pranavkantgaur / printFaces.cpp
Created February 9, 2015 11:23
Minimal code for printing faces of Delaunay tetrahedralization of cube
#include <vector>
#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Triangulation_vertex_base_with_info_3.h>
using namespace std;
using namespace CGAL;
typedef Exact_predicates_inexact_constructions_kernel K;