Skip to content

Instantly share code, notes, and snippets.

@pranavkantgaur
pranavkantgaur / main.cpp
Last active August 29, 2015 14:05 — forked from trtg/main.cpp
NITE mouse control
/*******************************************************************************
* *
* PrimeSense NITE 1.3 - Single Control Sample *
* Copyright (C) 2010 PrimeSense Ltd. *
* *
*******************************************************************************/
// NOTE: It is a bug fixed version of https://gist.github.com/trtg/3922745
@pranavkantgaur
pranavkantgaur / rPly.cpp
Last active August 29, 2015 14:14
C++ port of rPly program from here: http://w3.impa.br/~diego/software/rply/
/* ----------------------------------------------------------------------
* RPly library, read/write PLY files
* Diego Nehab, IMPA
* http://www.impa.br/~diego/software/rply
*
* This library is distributed under the MIT License. See notice
* at the end of this file.
* ---------------------------------------------------------------------- */
#include <stdio.h>
#include <ctype.h>
@pranavkantgaur
pranavkantgaur / rPlyWrite.cpp
Last active August 29, 2015 14:14
Minimal example for testing RPly's ply_write function
#include <iostream>
#include <stdlib.h>
#include "rply/rply.h"
using namespace std;
int main()
{
@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;
@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 / 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 / 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 / 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 / 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 / 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>