Sfoglia il codice sorgente

Merge branch 'master' of https://github.com/libigl/libigl

Conflicts:
	include/igl/cross_field_missmatch.cpp
	include/igl/edge_topology.cpp
	include/igl/edge_topology.h

Former-commit-id: 717572dba84e3b575678975da3bd93f1d37b97ed
Olga Diamanti 11 anni fa
parent
commit
1c8bb1d656
100 ha cambiato i file con 496 aggiunte e 432 eliminazioni
  1. 1 0
      .gitignore
  2. 63 9
      README.md
  3. 27 39
      build/Makefile
  4. 1 0
      build/Makefile.conf
  5. 8 9
      build/Makefile_bbw
  6. 9 8
      build/Makefile_boost
  7. 8 7
      build/Makefile_cgal
  8. 11 10
      build/Makefile_embree
  9. 8 7
      build/Makefile_matlab
  10. 9 8
      build/Makefile_mosek
  11. 9 8
      build/Makefile_png
  12. 10 9
      build/Makefile_svd3x3
  13. 9 8
      build/Makefile_tetgen
  14. 10 9
      build/Makefile_viewer
  15. 12 11
      build/Makefile_xml
  16. 1 1
      examples/MatlabWorkspace/Makefile
  17. 2 2
      examples/MatlabWorkspace/example.cpp
  18. 1 1
      examples/ReAntTweakBar/Makefile
  19. 2 2
      examples/affine/Makefile
  20. 5 5
      examples/ambient-occlusion-mex/mexFunction.cpp
  21. 1 1
      examples/ambient-occlusion/Makefile
  22. 4 4
      examples/ambient-occlusion/example.cpp
  23. 1 1
      examples/arap/Makefile
  24. 9 9
      examples/arap/example.cpp
  25. 2 2
      examples/basic_topology/Makefile
  26. 15 16
      examples/basic_topology/example1.cpp
  27. 1 1
      examples/bbw/Makefile
  28. 2 2
      examples/beach-balls/Makefile
  29. 1 1
      examples/camera/Makefile
  30. 1 1
      examples/camera/example.cpp
  31. 2 2
      examples/cat/Makefile
  32. 1 1
      examples/colored-mesh/Makefile
  33. 7 7
      examples/colored-mesh/example.cpp
  34. 2 2
      examples/dmat/Makefile
  35. 2 2
      examples/eigen-gotchas/Makefile
  36. 1 1
      examples/embree/Makefile
  37. 8 8
      examples/embree/example.cpp
  38. 2 2
      examples/example_fun/Makefile
  39. 1 1
      examples/example_fun/example.cpp
  40. 2 2
      examples/file_contents_as_string/Makefile
  41. 1 1
      examples/flare-eyes/Makefile
  42. 9 9
      examples/flare-eyes/example.cpp
  43. 2 2
      examples/get_seconds/Makefile
  44. 2 2
      examples/glslversion/Makefile
  45. 2 2
      examples/glut_speed_test/Makefile
  46. 2 2
      examples/harwell_boeing/Makefile
  47. 1 1
      examples/intersections/Makefile
  48. 11 10
      examples/intersections/example.cpp
  49. 2 2
      examples/is_dir/Makefile
  50. 2 2
      examples/marching_cubes/Makefile
  51. 2 2
      examples/meshio/Makefile
  52. 2 2
      examples/mode/Makefile
  53. 1 1
      examples/multi-viewport/Makefile
  54. 7 7
      examples/multi-viewport/example.cpp
  55. 2 2
      examples/patches/Makefile
  56. 14 12
      examples/patches/example.cpp
  57. 3 3
      examples/patches/temp.rbr
  58. 2 2
      examples/path_tests/Makefile
  59. 2 2
      examples/pathinfo/Makefile
  60. 3 4
      examples/principal_curvature/Makefile
  61. 5 5
      examples/principal_curvature/curvature.cpp
  62. 6 6
      examples/quicklook-mesh/src/render_to_buffer.cpp
  63. 1 1
      examples/randomly-sample-mesh/Makefile
  64. 8 8
      examples/randomly-sample-mesh/example.cpp
  65. 1 1
      examples/render_to_png/Makefile
  66. 1 1
      examples/rotate-widget/Makefile
  67. 7 7
      examples/rotate-widget/example.cpp
  68. 1 1
      examples/scene-rotation/Makefile
  69. 13 13
      examples/scene-rotation/example.cpp
  70. 1 1
      examples/scene-rotation/trackball.h
  71. 1 1
      examples/shadow-mapping/Makefile
  72. 35 29
      examples/shadow-mapping/example.cpp
  73. 1 1
      examples/skeleton/Makefile
  74. 9 9
      examples/skeleton/example.cpp
  75. 3 3
      examples/slice/Makefile
  76. 2 2
      examples/sort/Makefile
  77. 2 2
      examples/sortrows/Makefile
  78. 2 2
      examples/stdin_to_temp/Makefile
  79. 2 2
      examples/svd/Makefile
  80. 2 2
      examples/textured-mesh/Makefile
  81. 6 6
      examples/textured-mesh/example.cpp
  82. 2 2
      examples/trackball/Makefile
  83. 1 1
      examples/transparency/Makefile
  84. 2 2
      examples/transparency/example.cpp
  85. 2 2
      examples/transpose_blocks/Makefile
  86. 1 1
      examples/upright/Makefile
  87. 8 8
      examples/upright/example.cpp
  88. 1 1
      include/igl/EPS.cpp
  89. 1 1
      include/igl/EPS.h
  90. 6 5
      include/igl/HalfEdgeIterator.h
  91. 6 6
      include/igl/IO
  92. 1 1
      include/igl/ReAntTweakBar.h
  93. 1 1
      include/igl/WindingNumberTree.h
  94. 2 2
      include/igl/active_set.cpp
  95. 5 2
      include/igl/active_set.h
  96. 1 1
      include/igl/adjacency_list.cpp
  97. 1 1
      include/igl/adjacency_list.h
  98. 1 1
      include/igl/adjacency_matrix.cpp
  99. 1 1
      include/igl/adjacency_matrix.h
  100. 1 1
      include/igl/all_edges.h

+ 1 - 0
.gitignore

@@ -1,4 +1,5 @@
 # use glob syntax.
 # use glob syntax.
+scripts/change_name.sh
 syntax: glob
 syntax: glob
 *.o
 *.o
 *.a
 *.a

+ 63 - 9
README.md

@@ -35,7 +35,7 @@ listed below.
 - TetGen  libigltetgen extra only
 - TetGen  libigltetgen extra only
 - Embree  libiglembree extra only
 - Embree  libiglembree extra only
 - tinyxml2  libiglxml extra only
 - tinyxml2  libiglxml extra only
- 
+
 ## Header only ##
 ## Header only ##
 libigl is designed to work "out-of-the-box" as a headers only library. To
 libigl is designed to work "out-of-the-box" as a headers only library. To
 include libigl in your project. You need only include the libigl/include/
 include libigl in your project. You need only include the libigl/include/
@@ -72,31 +72,34 @@ Then run this example with:
 libigl is developed most often on Mac OS X, though has current users in Linux and Windows.
 libigl is developed most often on Mac OS X, though has current users in Linux and Windows.
 
 
 ### Linux/Mac OS X/Cygwin ###
 ### Linux/Mac OS X/Cygwin ###
-  
+
 libigl may also be compiled to a static library. This is advantageous when
 libigl may also be compiled to a static library. This is advantageous when
 building a project with libigl, since the header only directive can slow down
 building a project with libigl, since the header only directive can slow down
 compile times.
 compile times.
 
 
 To build the entire libigl library producing lib/libigl.a, issue:
 To build the entire libigl library producing lib/libigl.a, issue:
-  
+
+    cd build
     make lib
     make lib
-  
+
 You may need to edit Makefile.conf accordingly. Best to give yourself an
 You may need to edit Makefile.conf accordingly. Best to give yourself an
 `IGL_USERNAME` and add a custom install suite for yourself. Then you can enable
 `IGL_USERNAME` and add a custom install suite for yourself. Then you can enable
 appropriate extras.
 appropriate extras.
-  
+
 #### Extras ####
 #### Extras ####
 Once you've set up an `IGL_USERNAME` and enabled extras within Makefile.conf.
 Once you've set up an `IGL_USERNAME` and enabled extras within Makefile.conf.
 You can build the extra libraries (into lib/ligiglpng.a, lib/libiglmatlab.a,
 You can build the extra libraries (into lib/ligiglpng.a, lib/libiglmatlab.a,
 lib/libigltetgen.a, lib/libiglmosek.a, etc.) by issuing:
 lib/libigltetgen.a, lib/libiglmosek.a, etc.) by issuing:
-  
+
+    cd build
     make extras
     make extras
-  
+
 #### Examples ####
 #### Examples ####
 You can make a slew of examples by issuing:
 You can make a slew of examples by issuing:
-  
+
+    cd build
     make examples
     make examples
-  
+
 #### External ####
 #### External ####
 Finally there are a number of external libraries that we include in
 Finally there are a number of external libraries that we include in
 ./external/ because they are either difficult to obtain or they have been
 ./external/ because they are either difficult to obtain or they have been
@@ -190,6 +193,57 @@ To get started, we advise that you take a look at a few examples:
 
 
     ./examples/ReAntTweakBar/
     ./examples/ReAntTweakBar/
 
 
+## Extras ##
+Libigl compartmentalizes dependences via its organization into a _main_ libigl
+library and "extras." 
+
+
+### bbw ###
+This library extra contains functions for computing Bounded Biharmonic Weights, can
+be used with and without the [mosek](#mosek) extra via the `IGL_NO_MOSEK`
+macro.
+
+### boost ###
+This library extra utilizes the graph functions in the boost library for find
+connected components and performing breadth-first traversals.
+
+### cgal ###
+This library extra utilizes CGAL's efficient and exact intersection and
+proximity queries.
+
+### embree ###
+This library extra utilizes embree's efficient ray tracing queries.
+
+### matlab ###
+This library extra provides support for reading and writing `.mat` workspace
+files, interfacing with Matlab at run time and compiling mex functions.
+
+### mosek ###
+This library extra utilizes mosek's efficient interior-point solver for
+quadratic programs.
+
+### png ###
+This library extra uses `libpng` and `YImage` to read and write `.png` files.
+
+### svd3x3 ###
+This library extra implements "as-rigid-as-possible" (ARAP) deformation
+techniques using the fast singular value decomposition routines
+written specifically for 3x3 matrices to use `SSE` intrinsics. This extra can
+still be compiled without sse support and support should be determined
+automatically at compile time via the `__SSE__` macro.
+
+### tetgen ###
+This library extra provides a simplified wrapper to the tetgen 3d tetrahedral meshing
+library.
+
+### viewer ###
+This library extra utilizes glfw and glew to open an opengl context and launch
+a simple mesh viewer.
+
+### xml ###
+This library extra utilizes tinyxml2 to read and write serialized classes
+containing Eigen matrices and other standard simple data-structures.
+
 ## Development ##
 ## Development ##
 Further documentation for developers is listed in tutorial.html,
 Further documentation for developers is listed in tutorial.html,
 style_guidelines.html
 style_guidelines.html

+ 27 - 39
Makefile → build/Makefile

@@ -16,76 +16,64 @@ CFLAGS += $(OPTFLAGS)
 #CFLAGS += -DIGL_NO_OPENGL -DIGL_NO_ANTTWEAKBAR
 #CFLAGS += -DIGL_NO_OPENGL -DIGL_NO_ANTTWEAKBAR
 # We use well-supported features of c++11
 # We use well-supported features of c++11
 
 
-EXTRA_DIRS=
+EXTRAS=
 ifeq ($(IGL_WITH_BBW),1)
 ifeq ($(IGL_WITH_BBW),1)
-	EXTRA_DIRS+=include/igl/bbw
 	EXTRAS += bbw
 	EXTRAS += bbw
 endif
 endif
 ifeq ($(IGL_WITH_BOOST),1)
 ifeq ($(IGL_WITH_BOOST),1)
-	EXTRA_DIRS+=include/igl/boost
 	EXTRAS += boost
 	EXTRAS += boost
 endif
 endif
 ifeq ($(IGL_WITH_CGAL),1)
 ifeq ($(IGL_WITH_CGAL),1)
-	EXTRA_DIRS+=include/igl/cgal
 	EXTRAS += cgal
 	EXTRAS += cgal
 endif
 endif
 ifeq ($(IGL_WITH_EMBREE),1)
 ifeq ($(IGL_WITH_EMBREE),1)
-	EXTRA_DIRS+=include/igl/embree
 	EXTRAS += embree
 	EXTRAS += embree
 endif
 endif
 ifeq ($(IGL_WITH_MATLAB),1)
 ifeq ($(IGL_WITH_MATLAB),1)
-	EXTRA_DIRS+=include/igl/matlab
 	EXTRAS += matlab
 	EXTRAS += matlab
 endif
 endif
 ifeq ($(IGL_WITH_MOSEK),1)
 ifeq ($(IGL_WITH_MOSEK),1)
-	EXTRA_DIRS+=include/igl/mosek
 	EXTRAS += mosek
 	EXTRAS += mosek
 endif
 endif
 ifeq ($(IGL_WITH_PNG),1)
 ifeq ($(IGL_WITH_PNG),1)
-	EXTRA_DIRS+=include/igl/png
 	EXTRAS += png
 	EXTRAS += png
 endif
 endif
 ifeq ($(IGL_WITH_SVD3X3),1)
 ifeq ($(IGL_WITH_SVD3X3),1)
-	EXTRA_DIRS+=include/igl/svd3x3
 	EXTRAS += svd3x3
 	EXTRAS += svd3x3
 endif
 endif
 ifeq ($(IGL_WITH_TETGEN),1)
 ifeq ($(IGL_WITH_TETGEN),1)
 	# append tetgen extra dir
 	# append tetgen extra dir
-	EXTRA_DIRS+=include/igl/tetgen
 	EXTRAS += tetgen
 	EXTRAS += tetgen
 endif
 endif
 ifeq ($(IGL_WITH_VIEWER),1)
 ifeq ($(IGL_WITH_VIEWER),1)
-	EXTRA_DIRS+=include/igl/viewer
 	EXTRAS += viewer
 	EXTRAS += viewer
 endif
 endif
 ifeq ($(IGL_WITH_XML),1)
 ifeq ($(IGL_WITH_XML),1)
-	EXTRA_DIRS+=include/igl/xml
 	EXTRAS += xml
 	EXTRAS += xml
 endif
 endif
 
 
 .PHONY: examples
 .PHONY: examples
 .PHONY: extras
 .PHONY: extras
 debug: lib extras
 debug: lib extras
-lib: lib/libigl.a
+lib: ../lib/libigl.a
 examples: lib extras
 examples: lib extras
-	make -C examples
+	make -C ../examples
 extras:
 extras:
-	for p in  $(EXTRA_DIRS); \
+	for p in  $(EXTRAS); \
 	do \
 	do \
-	echo "cd $$p" ; \
-	$(MAKE) -C $$p $(DEBUG); \
+	$(MAKE) -f Makefile_$$p $(DEBUG); \
 	done
 	done
 
 
 
 
 #############################################################################
 #############################################################################
 # SOURCE 
 # SOURCE 
 #############################################################################
 #############################################################################
-CPP_FILES=$(wildcard include/igl/*.cpp)
-H_FILES=$(wildcard include/igl/*.h)
+CPP_FILES=$(wildcard ../include/igl/*.cpp)
+H_FILES=$(wildcard ../include/igl/*.h)
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 
 
 # include igl headers
 # include igl headers
-INC+=-Iinclude/
+INC+=-I../include/
 
 
 #############################################################################
 #############################################################################
 # DEPENDENCIES
 # DEPENDENCIES
@@ -100,7 +88,7 @@ INC+=$(EIGEN3_INC)
 
 
 # AntTweakBar dependency
 # AntTweakBar dependency
 #ANTTWEAKBAR_INC=-I$(DEFAULT_PREFIX)/include
 #ANTTWEAKBAR_INC=-I$(DEFAULT_PREFIX)/include
-ANTTWEAKBAR_INC=-Iexternal/AntTweakBar/include
+ANTTWEAKBAR_INC=-I../external/AntTweakBar/include
 INC+=$(ANTTWEAKBAR_INC)
 INC+=$(ANTTWEAKBAR_INC)
 
 
 ## OpenGL dependency
 ## OpenGL dependency
@@ -112,34 +100,34 @@ INC+=$(ANTTWEAKBAR_INC)
 obj: 
 obj: 
 	mkdir -p obj
 	mkdir -p obj
 
 
-lib/libigl.a: obj $(OBJ_FILES)
+../lib/libigl.a: obj $(OBJ_FILES)
 	mkdir -p lib
 	mkdir -p lib
 	rm -f $@
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 	ar cqs $@ $(OBJ_FILES)
 
 
-obj/%.o: include/igl/%.cpp include/igl/%.h
+obj/%.o: ../include/igl/%.cpp ../include/igl/%.h
 	$(GG) $(CFLAGS) $(AFLAGS) -c -o $@ $< $(INC)
 	$(GG) $(CFLAGS) $(AFLAGS) -c -o $@ $< $(INC)
 
 
-lib/igl.framework/:
-	mkdir -p $@
-	cp lib/*.a $@
-	mv $@/libigl.a $@/igl
-	mkdir -p $@/Libraries
-	mv $@/*.a $@/Libraries
-	mkdir -p $@/Headers
-	cp $(H_FILES) $@/Headers
-	for p in $(EXTRAS); \
-	do \
-	mkdir $@/Headers/$$p; \
-	cp include/igl/$$p/*.h $@/Headers/$$p; \
-	done
+#lib/igl.framework/:
+#	mkdir -p $@
+#	cp lib/*.a $@
+#	mv $@/libigl.a $@/igl
+#	mkdir -p $@/Libraries
+#	mv $@/*.a $@/Libraries
+#	mkdir -p $@/Headers
+#	cp $(H_FILES) $@/Headers
+#	for p in $(EXTRAS); \
+#	do \
+#	mkdir $@/Headers/$$p; \
+#	cp include/igl/$$p/*.h $@/Headers/$$p; \
+#	done
 
 
 
 
 clean:
 clean:
-	rm -rf lib/igl.framework/
+	rm -rf ../lib/igl.framework/
 	rm -f obj/*.o
 	rm -f obj/*.o
-	rm -f lib/libigl.a
-	make -C examples clean
+	rm -f ../lib/libigl.a
+	make -C ../examples clean
 	for p in  $(EXTRA_DIRS); \
 	for p in  $(EXTRA_DIRS); \
 	do \
 	do \
 	echo "cd $$p" ; \
 	echo "cd $$p" ; \

+ 1 - 0
Makefile.conf → build/Makefile.conf

@@ -10,6 +10,7 @@ GG=g++
 #GG=g++-mp-4.3       15.5s
 #GG=g++-mp-4.3       15.5s
 #GG=g++-mp-4.7       19.9s
 #GG=g++-mp-4.7       19.9s
 
 
+CFLAGS += -DIGL_STATIC_LIBRARY
 CFLAGS += -Wall
 CFLAGS += -Wall
 CFLAGS += -std=c++11
 CFLAGS += -std=c++11
 
 

+ 8 - 9
include/igl/bbw/Makefile → build/Makefile_bbw

@@ -1,22 +1,21 @@
-include ../../../Makefile.conf
-
 .PHONY: all
 .PHONY: all
 all: libiglbbw
 all: libiglbbw
 debug: libiglbbw
 debug: libiglbbw
 
 
-include ../../../Makefile.conf
+include Makefile.conf
 all: OPTFLAGS += -O3 -DNDEBUG $(OPENMP)
 all: OPTFLAGS += -O3 -DNDEBUG $(OPENMP)
 debug: OPTFLAGS += -g -Wall
 debug: OPTFLAGS += -g -Wall
 CFLAGS += $(OPTFLAGS)
 CFLAGS += $(OPTFLAGS)
 
 
 .PHONY: libiglbbw
 .PHONY: libiglbbw
-libiglbbw: obj ../../../lib/libiglbbw.a
+libiglbbw: obj ../lib/libiglbbw.a
 
 
-CPP_FILES=$(wildcard *.cpp)
+SRC_DIR=../include/igl/bbw/
+CPP_FILES=$(wildcard $(SRC_DIR)*.cpp)
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 
 
 # include igl headers
 # include igl headers
-INC+=-I../../../include/
+INC+=-I../include/
 
 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 
 
@@ -47,13 +46,13 @@ endif
 obj: 
 obj: 
 	mkdir -p obj
 	mkdir -p obj
 
 
-../../../lib/libiglbbw.a: $(OBJ_FILES)
+../lib/libiglbbw.a: $(OBJ_FILES)
 	rm -f $@
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 	ar cqs $@ $(OBJ_FILES)
 
 
-obj/%.o: %.cpp %.h
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
 	$(GG) $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 	$(GG) $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 
 
 clean:
 clean:
 	rm -f obj/*.o
 	rm -f obj/*.o
-	rm -f ../../../lib/libiglbbw.a
+	rm -f ../lib/libiglbbw.a

+ 9 - 8
include/igl/boost/Makefile → build/Makefile_boost

@@ -1,21 +1,22 @@
-include ../../../Makefile.conf
+include Makefile.conf
 
 
 .PHONY: all
 .PHONY: all
 all: libiglboost
 all: libiglboost
 debug: libiglboost
 debug: libiglboost
 
 
-include ../../../Makefile.conf
+include Makefile.conf
 all: CFLAGS += -O3 -DNDEBUG
 all: CFLAGS += -O3 -DNDEBUG
 debug: CFLAGS += -g -Wall 
 debug: CFLAGS += -g -Wall 
 
 
 .PHONY: libiglboost
 .PHONY: libiglboost
-libiglboost: obj ../../../lib/libiglboost.a
+libiglboost: obj ../lib/libiglboost.a
 
 
-CPP_FILES=$(wildcard *.cpp)
+SRC_DIR=../include/igl/boost/
+CPP_FILES=$(wildcard $(SRC_DIR)*.cpp)
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 
 
 # include igl headers
 # include igl headers
-INC+=-I../../../include/
+INC+=-I../include/
 
 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 
 
@@ -31,13 +32,13 @@ INC+=$(BOOST_INC)
 obj: 
 obj: 
 	mkdir -p obj
 	mkdir -p obj
 
 
-../../../lib/libiglboost.a: $(OBJ_FILES)
+../lib/libiglboost.a: $(OBJ_FILES)
 	rm -f $@
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 	ar cqs $@ $(OBJ_FILES)
 
 
-obj/%.o: %.cpp %.h
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
 	g++ $(AFLAGS) $(OPENMP) $(CFLAGS) -c -o $@ $< $(INC)
 	g++ $(AFLAGS) $(OPENMP) $(CFLAGS) -c -o $@ $< $(INC)
 
 
 clean:
 clean:
 	rm -f obj/*.o
 	rm -f obj/*.o
-	rm -f ../../../lib/libiglboost.a
+	rm -f ../lib/libiglboost.a

+ 8 - 7
include/igl/cgal/Makefile → build/Makefile_cgal

@@ -3,18 +3,19 @@
 all: libiglcgal
 all: libiglcgal
 debug: libiglcgal
 debug: libiglcgal
 
 
-include ../../../Makefile.conf
+include Makefile.conf
 all: CFLAGS += -O3 -DNDEBUG 
 all: CFLAGS += -O3 -DNDEBUG 
 debug: CFLAGS += -g -Wall -Werror
 debug: CFLAGS += -g -Wall -Werror
 
 
 .PHONY: libcgal
 .PHONY: libcgal
-libiglcgal: obj ../../../lib/libiglcgal.a
+libiglcgal: obj ../lib/libiglcgal.a
 
 
-CPP_FILES=$(wildcard *.cpp)
+SRC_DIR=../include/igl/cgal/
+CPP_FILES=$(wildcard $(SRC_DIR)*.cpp)
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 
 
 # include igl headers
 # include igl headers
-INC+=-I../../../include/
+INC+=-I../include/
 
 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 
 
@@ -32,13 +33,13 @@ INC+=$(CGAL_INC)
 obj: 
 obj: 
 	mkdir -p obj
 	mkdir -p obj
 
 
-../../../lib/libiglcgal.a: $(OBJ_FILES)
+../lib/libiglcgal.a: $(OBJ_FILES)
 	rm -f $@
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 	ar cqs $@ $(OBJ_FILES)
 
 
-obj/%.o: %.cpp %.h
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
 	g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 	g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 
 
 clean:
 clean:
 	rm -f obj/*.o
 	rm -f obj/*.o
-	rm -f ../../../lib/libiglcgal.a
+	rm -f ../lib/libiglcgal.a

+ 11 - 10
include/igl/embree/Makefile → build/Makefile_embree

@@ -1,21 +1,22 @@
-include ../../../Makefile.conf
+include Makefile.conf
 
 
 .PHONY: all
 .PHONY: all
 all: libiglembree
 all: libiglembree
 debug: libiglembree
 debug: libiglembree
 
 
-include ../../../Makefile.conf
+include Makefile.conf
 all: CFLAGS += -O3 -DNDEBUG -std=c++11
 all: CFLAGS += -O3 -DNDEBUG -std=c++11
 debug: CFLAGS += -g -Wall -std=c++11
 debug: CFLAGS += -g -Wall -std=c++11
 
 
 .PHONY: libiglembree
 .PHONY: libiglembree
-libiglembree: obj ../../../lib/libiglembree.a
+libiglembree: obj ../lib/libiglembree.a
 
 
-CPP_FILES=$(wildcard *.cpp)
+SRC_DIR=../include/igl/embree/
+CPP_FILES=$(wildcard $(SRC_DIR)*.cpp)
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 
 
 # include igl headers
 # include igl headers
-INC+=-I../../../include/
+INC+=-I../include/
 
 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 
 
@@ -24,9 +25,9 @@ EIGEN3_INC=-I$(DEFAULT_PREFIX)/include/eigen3 -I$(DEFAULT_PREFIX)/include/eigen3
 INC+=$(EIGEN3_INC)
 INC+=$(EIGEN3_INC)
 
 
 # embree dependency
 # embree dependency
-#EMBREE=../../../external/embree
+#EMBREE=../external/embree
 #EMBREE_INC=-I$(EMBREE)/common -I$(EMBREE)/rtcore/
 #EMBREE_INC=-I$(EMBREE)/common -I$(EMBREE)/rtcore/
-EMBREE=../../../external/embree/
+EMBREE=../external/embree/
 EMBREE_INC=-I$(EMBREE)/ -I$(EMBREE)/embree
 EMBREE_INC=-I$(EMBREE)/ -I$(EMBREE)/embree
 #EMBREE_LIB=-L$(EMBREE)/bin -lrtcore -lsys
 #EMBREE_LIB=-L$(EMBREE)/bin -lrtcore -lsys
 INC+=$(EMBREE_INC)
 INC+=$(EMBREE_INC)
@@ -34,13 +35,13 @@ INC+=$(EMBREE_INC)
 obj: 
 obj: 
 	mkdir -p obj
 	mkdir -p obj
 
 
-../../../lib/libiglembree.a: $(OBJ_FILES)
+../lib/libiglembree.a: $(OBJ_FILES)
 	rm -f $@
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 	ar cqs $@ $(OBJ_FILES)
 
 
-obj/%.o: %.cpp %.h
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
 	g++ $(AFLAGS) $(OPENMP) $(CFLAGS) -c -o $@ $< $(INC)
 	g++ $(AFLAGS) $(OPENMP) $(CFLAGS) -c -o $@ $< $(INC)
 
 
 clean:
 clean:
 	rm -f obj/*.o
 	rm -f obj/*.o
-	rm -f ../../../lib/libiglembree.a
+	rm -f ../lib/libiglembree.a

+ 8 - 7
include/igl/matlab/Makefile → build/Makefile_matlab

@@ -1,4 +1,4 @@
-include ../../../Makefile.conf
+include Makefile.conf
 all: CFLAGS += -O3 -DNDEBUG
 all: CFLAGS += -O3 -DNDEBUG
 debug: CFLAGS += -g -Wall -Werror
 debug: CFLAGS += -g -Wall -Werror
 
 
@@ -7,13 +7,14 @@ all: libiglmatlab
 debug: libiglmatlab
 debug: libiglmatlab
 
 
 .PHONY: libmatlab
 .PHONY: libmatlab
-libiglmatlab: obj ../../../lib/libiglmatlab.a
+libiglmatlab: obj ../lib/libiglmatlab.a
 
 
-CPP_FILES=$(wildcard *.cpp)
+SRC_DIR=../include/igl/matlab/
+CPP_FILES=$(wildcard $(SRC_DIR)*.cpp)
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 
 
 # include igl headers
 # include igl headers
-INC+=-I../../../include/
+INC+=-I../include/
 
 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 
 
@@ -33,13 +34,13 @@ INC+=$(MATLAB_INC)
 obj: 
 obj: 
 	mkdir -p obj
 	mkdir -p obj
 
 
-../../../lib/libiglmatlab.a: $(OBJ_FILES)
+../lib/libiglmatlab.a: $(OBJ_FILES)
 	rm -f $@
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 	ar cqs $@ $(OBJ_FILES)
 
 
-obj/%.o: %.cpp %.h
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
 	g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 	g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 
 
 clean:
 clean:
 	rm -f obj/*.o
 	rm -f obj/*.o
-	rm -f ../../../lib/libiglmatlab.a
+	rm -f ../lib/libiglmatlab.a

+ 9 - 8
include/igl/mosek/Makefile → build/Makefile_mosek

@@ -1,22 +1,23 @@
-include ../../../Makefile.conf
+include Makefile.conf
 
 
 .PHONY: all
 .PHONY: all
 all: libiglmosek
 all: libiglmosek
 debug: libiglmosek
 debug: libiglmosek
 
 
-include ../../../Makefile.conf
+include Makefile.conf
 all: OPTFLAGS += -O3 -DNDEBUG $(OPENMP)
 all: OPTFLAGS += -O3 -DNDEBUG $(OPENMP)
 debug: OPTFLAGS += -g -Wall
 debug: OPTFLAGS += -g -Wall
 CFLAGS += $(OPTFLAGS)
 CFLAGS += $(OPTFLAGS)
 
 
 .PHONY: libiglmosek
 .PHONY: libiglmosek
-libiglmosek: obj ../../../lib/libiglmosek.a
+libiglmosek: obj ../lib/libiglmosek.a
 
 
-CPP_FILES=$(wildcard *.cpp)
+SRC_DIR=../include/igl/mosek/
+CPP_FILES=$(wildcard $(SRC_DIR)*.cpp)
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 
 
 # include igl headers
 # include igl headers
-INC+=-I../../../include/
+INC+=-I../include/
 
 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 
 
@@ -40,13 +41,13 @@ INC+=$(MOSEK_INC)
 obj: 
 obj: 
 	mkdir -p obj
 	mkdir -p obj
 
 
-../../../lib/libiglmosek.a: $(OBJ_FILES)
+../lib/libiglmosek.a: $(OBJ_FILES)
 	rm -f $@
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 	ar cqs $@ $(OBJ_FILES)
 
 
-obj/%.o: %.cpp %.h
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
 	g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 	g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 
 
 clean:
 clean:
 	rm -f obj/*.o
 	rm -f obj/*.o
-	rm -f ../../../lib/libiglmosek.a
+	rm -f ../lib/libiglmosek.a

+ 9 - 8
include/igl/png/Makefile → build/Makefile_png

@@ -1,4 +1,4 @@
-include ../../../Makefile.conf
+include Makefile.conf
 all: CFLAGS += -O3 -DNDEBUG 
 all: CFLAGS += -O3 -DNDEBUG 
 debug: CFLAGS += -g -Wall -Werror
 debug: CFLAGS += -g -Wall -Werror
 
 
@@ -7,18 +7,19 @@ all: libiglpng
 debug: libiglpng
 debug: libiglpng
 
 
 .PHONY: libpng
 .PHONY: libpng
-libiglpng: obj ../../../lib/libiglpng.a
+libiglpng: obj ../lib/libiglpng.a
 
 
-CPP_FILES=$(wildcard *.cpp)
+SRC_DIR=../include/igl/png/
+CPP_FILES=$(wildcard $(SRC_DIR)*.cpp)
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 
 
 # include igl headers
 # include igl headers
-INC+=-I../../../include/
+INC+=-I../include/
 
 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 
 
 # YIMG dependency
 # YIMG dependency
-YIMG=../../../external/yimg
+YIMG=../external/yimg
 YIMG_INC=-I$(YIMG)
 YIMG_INC=-I$(YIMG)
 INC+=$(YIMG_INC)
 INC+=$(YIMG_INC)
 YIMG_STATIC_LIB=$(YIMG)/libyimg.a
 YIMG_STATIC_LIB=$(YIMG)/libyimg.a
@@ -29,13 +30,13 @@ INC+=-I/opt/local/include/
 obj: 
 obj: 
 	mkdir -p obj
 	mkdir -p obj
 
 
-../../../lib/libiglpng.a: $(OBJ_FILES)
+../lib/libiglpng.a: $(OBJ_FILES)
 	rm -f $@
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 	ar cqs $@ $(OBJ_FILES)
 
 
-obj/%.o: %.cpp %.h
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
 	g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 	g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 
 
 clean:
 clean:
 	rm -f obj/*.o
 	rm -f obj/*.o
-	rm -f ../../../lib/libiglpng.a
+	rm -f ../lib/libiglpng.a

+ 10 - 9
include/igl/svd3x3/Makefile → build/Makefile_svd3x3

@@ -1,28 +1,29 @@
-include ../../../Makefile.conf
+include Makefile.conf
 
 
 .PHONY: all
 .PHONY: all
 all: libiglsvd3x3
 all: libiglsvd3x3
 debug: libiglsvd3x3
 debug: libiglsvd3x3
 
 
-include ../../../Makefile.conf
+include Makefile.conf
 all: OPTFLAGS += -O3 -DNDEBUG $(OPENMP)
 all: OPTFLAGS += -O3 -DNDEBUG $(OPENMP)
 debug: OPTFLAGS += -g -Wall
 debug: OPTFLAGS += -g -Wall
 CFLAGS += $(OPTFLAGS) -std=c++11
 CFLAGS += $(OPTFLAGS) -std=c++11
 
 
 .PHONY: libiglsvd3x3
 .PHONY: libiglsvd3x3
-libiglsvd3x3: obj ../../../lib/libiglsvd3x3.a
+libiglsvd3x3: obj ../lib/libiglsvd3x3.a
 
 
-CPP_FILES=$(wildcard *.cpp)
+SRC_DIR=../include/igl/svd3x3/
+CPP_FILES=$(wildcard $(SRC_DIR)*.cpp)
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 
 
 # include igl headers
 # include igl headers
-INC+=-I../../../include/
+INC+=-I../include/
 
 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 
 
 # SVD 
 # SVD 
 SINGULAR_VALUE_DECOMPOSITION_INC=\
 SINGULAR_VALUE_DECOMPOSITION_INC=\
-	-I../../../external/Singular_Value_Decomposition/
+	-I../external/Singular_Value_Decomposition/
 # Eigen dependency
 # Eigen dependency
 EIGEN3_INC=-I$(DEFAULT_PREFIX)/include/eigen3 -I$(DEFAULT_PREFIX)/include/eigen3/unsupported
 EIGEN3_INC=-I$(DEFAULT_PREFIX)/include/eigen3 -I$(DEFAULT_PREFIX)/include/eigen3/unsupported
 INC+=$(EIGEN3_INC) $(SINGULAR_VALUE_DECOMPOSITION_INC)
 INC+=$(EIGEN3_INC) $(SINGULAR_VALUE_DECOMPOSITION_INC)
@@ -39,13 +40,13 @@ INC+=$(MATLAB_INC)
 obj: 
 obj: 
 	mkdir -p obj
 	mkdir -p obj
 
 
-../../../lib/libiglsvd3x3.a: $(OBJ_FILES)
+../lib/libiglsvd3x3.a: $(OBJ_FILES)
 	rm -f $@
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 	ar cqs $@ $(OBJ_FILES)
 
 
-obj/%.o: %.cpp %.h
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
 	$(GG) $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 	$(GG) $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 
 
 clean:
 clean:
 	rm -f obj/*.o
 	rm -f obj/*.o
-	rm -f ../../../lib/libiglsvd3x3.a
+	rm -f ../lib/libiglsvd3x3.a

+ 9 - 8
include/igl/tetgen/Makefile → build/Makefile_tetgen

@@ -3,18 +3,19 @@
 all: libigltetgen
 all: libigltetgen
 debug: libigltetgen
 debug: libigltetgen
 
 
-include ../../../Makefile.conf
+include Makefile.conf
 all: CFLAGS += -O3 -DNDEBUG 
 all: CFLAGS += -O3 -DNDEBUG 
 debug: CFLAGS += -g -Wall -Werror
 debug: CFLAGS += -g -Wall -Werror
 
 
 .PHONY: libtetgen
 .PHONY: libtetgen
-libigltetgen: obj ../../../lib/libigltetgen.a
+libigltetgen: obj ../lib/libigltetgen.a
 
 
-CPP_FILES=$(wildcard *.cpp)
+SRC_DIR=../include/igl/tetgen/
+CPP_FILES=$(wildcard $(SRC_DIR)*.cpp)
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 
 
 # include igl headers
 # include igl headers
-INC+=-I../../../include/
+INC+=-I../include/
 
 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 
 
@@ -23,7 +24,7 @@ EIGEN3_INC=-I$(DEFAULT_PREFIX)/include/eigen3 -I$(DEFAULT_PREFIX)/include/eigen3
 INC+=$(EIGEN3_INC)
 INC+=$(EIGEN3_INC)
 
 
 # Tetgen dependency
 # Tetgen dependency
-TETGEN=../../../external/tetgen
+TETGEN=../external/tetgen
 TETGEN_INC=-I$(TETGEN)
 TETGEN_INC=-I$(TETGEN)
 INC+=$(TETGEN_INC)
 INC+=$(TETGEN_INC)
 TETGEN_STATIC_LIB=$(TETGEN)/libtet.a
 TETGEN_STATIC_LIB=$(TETGEN)/libtet.a
@@ -31,13 +32,13 @@ TETGEN_STATIC_LIB=$(TETGEN)/libtet.a
 obj: 
 obj: 
 	mkdir -p obj
 	mkdir -p obj
 
 
-../../../lib/libigltetgen.a: $(OBJ_FILES)
+../lib/libigltetgen.a: $(OBJ_FILES)
 	rm -f $@
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 	ar cqs $@ $(OBJ_FILES)
 
 
-obj/%.o: %.cpp %.h
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
 	g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 	g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 
 
 clean:
 clean:
 	rm -f obj/*.o
 	rm -f obj/*.o
-	rm -f ../../../lib/libigltetgen.a
+	rm -f ../lib/libigltetgen.a

+ 10 - 9
include/igl/viewer/Makefile → build/Makefile_viewer

@@ -1,4 +1,4 @@
-include ../../../Makefile.conf
+include Makefile.conf
 all: CFLAGS += -O3 -DNDEBUG -fopenmp
 all: CFLAGS += -O3 -DNDEBUG -fopenmp
 debug: CFLAGS += -g -Wall -Werror -fopenmp
 debug: CFLAGS += -g -Wall -Werror -fopenmp
 
 
@@ -7,13 +7,14 @@ all: libiglviewer
 debug: libiglviewer
 debug: libiglviewer
 
 
 .PHONY: libviewer
 .PHONY: libviewer
-libiglviewer: obj ../../../lib/libiglviewer.a
+libiglviewer: obj ../lib/libiglviewer.a
 
 
-CPP_FILES=$(wildcard *.cpp)
+SRC_DIR=../include/igl/viewer/
+CPP_FILES=$(wildcard $(SRC_DIR)*.cpp)
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 
 
 # include igl headers
 # include igl headers
-INC+=-I../../../include/
+INC+=-I../include/
 
 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 
 
@@ -23,12 +24,12 @@ INC+=$(EIGEN3_INC)
 
 
 # GLFW dependency
 # GLFW dependency
 ifndef GLFW
 ifndef GLFW
-	GLFW=../../../external/glfw/
+	GLFW=../external/glfw/
 endif
 endif
 GLFW_INC=-I$(GLFW)/include
 GLFW_INC=-I$(GLFW)/include
 INC+=$(GLFW_INC)
 INC+=$(GLFW_INC)
 ifndef ANTTWEAKBAR
 ifndef ANTTWEAKBAR
-	ANTTWEAKBAR=../../../external/AntTweakBar/
+	ANTTWEAKBAR=../external/AntTweakBar/
 endif
 endif
 # Viewer also uses source files from AntTweakBar for font rendering
 # Viewer also uses source files from AntTweakBar for font rendering
 ANTTWEAKBAR_INC=-I$(ANTTWEAKBAR)/include -I$(ANTTWEAKBAR)/src
 ANTTWEAKBAR_INC=-I$(ANTTWEAKBAR)/include -I$(ANTTWEAKBAR)/src
@@ -37,13 +38,13 @@ INC+=$(ANTTWEAKBAR_INC)
 obj: 
 obj: 
 	mkdir -p obj
 	mkdir -p obj
 
 
-../../../lib/libiglviewer.a: $(OBJ_FILES)
+../lib/libiglviewer.a: $(OBJ_FILES)
 	rm -f $@
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 	ar cqs $@ $(OBJ_FILES)
 
 
-obj/%.o: %.cpp %.h
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
 	g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 	g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 
 
 clean:
 clean:
 	rm -f obj/*.o
 	rm -f obj/*.o
-	rm -f ../../../lib/libiglmatlab.a
+	rm -f ../lib/libiglmatlab.a

+ 12 - 11
include/igl/xml/Makefile → build/Makefile_xml

@@ -1,4 +1,4 @@
-include ../../../Makefile.conf
+include Makefile.conf
 
 
 .PHONY: all
 .PHONY: all
 all: 
 all: 
@@ -6,18 +6,19 @@ debug:
 #all: libiglxml
 #all: libiglxml
 #debug: libiglxml
 #debug: libiglxml
 
 
-include ../../../Makefile.conf
+include Makefile.conf
 all: CFLAGS += -O3 -DNDEBUG
 all: CFLAGS += -O3 -DNDEBUG
 debug: CFLAGS += -g -Wall
 debug: CFLAGS += -g -Wall
 
 
 .PHONY: libiglxml
 .PHONY: libiglxml
-libiglxml: obj ../../../lib/libiglxml.a
+libiglxml: obj ../lib/libiglxml.a
 
 
-CPP_FILES=$(wildcard *.cpp)
+SRC_DIR=../include/igl/xml/
+CPP_FILES=$(wildcard $(SRC_DIR)*.cpp)
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
 
 
 # include igl headers
 # include igl headers
-INC+=-I../../../include/
+INC+=-I../include/
 
 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 
 
@@ -26,17 +27,17 @@ EIGEN3_INC=-I$(DEFAULT_PREFIX)/include/eigen3 -I$(DEFAULT_PREFIX)/include/eigen3
 INC+=$(EIGEN3_INC)
 INC+=$(EIGEN3_INC)
 
 
 #AntTweakbar dependency
 #AntTweakbar dependency
-ANTTWEAKBAR_INC=-I../../../external/AntTweakBar/include
+ANTTWEAKBAR_INC=-I../external/AntTweakBar/include
 
 
 # xml dependency
 # xml dependency
 # TODO: linux, 32 bit etc
 # TODO: linux, 32 bit etc
-TINYXML2=../../../external/tinyxml2
+TINYXML2=../external/tinyxml2
 TINYXML2_INC=-I$(TINYXML2)
 TINYXML2_INC=-I$(TINYXML2)
 #TINYXML2_LIB=-L$(TINYXML2) -ltinyxml2
 #TINYXML2_LIB=-L$(TINYXML2) -ltinyxml2
 INC+=$(TINYXML2_INC) $(ANTTWEAKBAR_INC)
 INC+=$(TINYXML2_INC) $(ANTTWEAKBAR_INC)
 
 
 # AntTweakBar dependency
 # AntTweakBar dependency
-ANTTWEAKBAR_INC=-I../../../external/AntTweakBar/include
+ANTTWEAKBAR_INC=-I../external/AntTweakBar/include
 INC+=$(ANTTWEAKBAR_INC)
 INC+=$(ANTTWEAKBAR_INC)
 
 
 #CFLAGS+=-std=c++11
 #CFLAGS+=-std=c++11
@@ -44,13 +45,13 @@ INC+=$(ANTTWEAKBAR_INC)
 obj: 
 obj: 
 	mkdir -p obj
 	mkdir -p obj
 
 
-../../../lib/libiglxml.a: $(OBJ_FILES)
+../lib/libiglxml.a: $(OBJ_FILES)
 	rm -f $@
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 	ar cqs $@ $(OBJ_FILES)
 
 
-obj/%.o: %.cpp %.h
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
 	g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 	g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 
 
 clean:
 clean:
 	rm -f obj/*.o
 	rm -f obj/*.o
-	rm -f ../../../lib/libiglxml.a
+	rm -f ../lib/libiglxml.a

+ 1 - 1
examples/MatlabWorkspace/Makefile

@@ -1,7 +1,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 IGL=../../
 IGL=../../
 IGL_LIB=-L$(IGL)/lib -ligl
 IGL_LIB=-L$(IGL)/lib -ligl

+ 2 - 2
examples/MatlabWorkspace/example.cpp

@@ -3,13 +3,13 @@
 #include <igl/readDMAT.h>
 #include <igl/readDMAT.h>
 #include <cstdio>
 #include <cstdio>
 
 
-#ifndef IGL_HEADER_ONLY
+#ifdef IGL_STATIC_LIBRARY
 #  define IGL_HEADER_ONLY
 #  define IGL_HEADER_ONLY
 #  define IGL_HEADER_ONLY_WAS_NOT_DEFINED
 #  define IGL_HEADER_ONLY_WAS_NOT_DEFINED
 #endif
 #endif
 #include <igl/matlab/MatlabWorkspace.h>
 #include <igl/matlab/MatlabWorkspace.h>
 #include <igl/on_boundary.h>
 #include <igl/on_boundary.h>
-#ifdef IGL_HEADER_ONLY_WAS_NOT_DEFINED
+#ifndef IGL_STATIC_LIBRARY_WAS_NOT_DEFINED
 #  undef IGL_HEADER_ONLY
 #  undef IGL_HEADER_ONLY
 #endif
 #endif
 
 

+ 1 - 1
examples/ReAntTweakBar/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 

+ 2 - 2
examples/affine/Makefile

@@ -4,14 +4,14 @@
 all: example
 all: example
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 .PHONY: example
 .PHONY: example
 
 
 igl_lib=../../
 igl_lib=../../
 eigen=$(DEFAULT_PREFIX)/include/eigen3
 eigen=$(DEFAULT_PREFIX)/include/eigen3
 
 
-CFLAGS=-g
+CFLAGS+=-g
 inc=-I$(igl_lib)/include -I$(eigen)
 inc=-I$(igl_lib)/include -I$(eigen)
 lib=-L$(igl_lib)/lib -ligl
 lib=-L$(igl_lib)/lib -ligl
 
 

+ 5 - 5
examples/ambient-occlusion-mex/mexFunction.cpp

@@ -1,9 +1,9 @@
 #include "parse_rhs.h"
 #include "parse_rhs.h"
 
 
-#include <igl/matlab/mexStream.h>
+#include <igl/matlab/MexStream.h>
 #include <igl/embree/ambient_occlusion.h>
 #include <igl/embree/ambient_occlusion.h>
 
 
-#include <igl/read.h>
+#include <igl/read_triangle_mesh.h>
 #include <igl/per_vertex_normals.h>
 #include <igl/per_vertex_normals.h>
 
 
 #include <mex.h>
 #include <mex.h>
@@ -11,12 +11,12 @@
 #include <iostream>
 #include <iostream>
 #include <string>
 #include <string>
 
 
-void mexFunction(int nlhs, mxArray *plhs[], 
+void mexFunction(int nlhs, mxArray *plhs[],
     int nrhs, const mxArray *prhs[])
     int nrhs, const mxArray *prhs[])
 {
 {
   // This is useful for debugging whether Matlab is caching the mex binary
   // This is useful for debugging whether Matlab is caching the mex binary
   //mexPrintf("%s %s\n",__TIME__,__DATE__);
   //mexPrintf("%s %s\n",__TIME__,__DATE__);
-  igl::mexStream mout;
+  igl::MexStream mout;
   std::streambuf *outbuf = std::cout.rdbuf(&mout);
   std::streambuf *outbuf = std::cout.rdbuf(&mout);
 
 
   using namespace std;
   using namespace std;
@@ -31,7 +31,7 @@ void mexFunction(int nlhs, mxArray *plhs[],
   // Prepare left-hand side
   // Prepare left-hand side
   nlhs = 1;
   nlhs = 1;
 
 
-  //read("../shared/cheburashka.off",V,F);
+  //read_triangle_mesh("../shared/cheburashka.off",V,F);
   //P = V;
   //P = V;
   //per_vertex_normals(V,F,N);
   //per_vertex_normals(V,F,N);
   ambient_occlusion(V,F,P,N,num_samples,S);
   ambient_occlusion(V,F,P,N,num_samples,S);

+ 1 - 1
examples/ambient-occlusion/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 

+ 4 - 4
examples/ambient-occlusion/example.cpp

@@ -13,7 +13,7 @@
 #include <igl/readWRL.h>
 #include <igl/readWRL.h>
 #include <igl/trackball.h>
 #include <igl/trackball.h>
 #include <igl/list_to_matrix.h>
 #include <igl/list_to_matrix.h>
-#include <igl/triangulate.h>
+#include <igl/polygon_mesh_to_triangle_mesh.h>
 #include <igl/material_colors.h>
 #include <igl/material_colors.h>
 #include <igl/barycenter.h>
 #include <igl/barycenter.h>
 #include <igl/matlab_format.h>
 #include <igl/matlab_format.h>
@@ -297,7 +297,7 @@ void key(unsigned char key, int mouse_x, int mouse_y)
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
       }
       }
   }
   }
-  
+
 }
 }
 
 
 
 
@@ -357,7 +357,7 @@ int main(int argc, char * argv[])
   //  }
   //  }
   //  //if(F.size() > T.size() || F.size() == 0)
   //  //if(F.size() > T.size() || F.size() == 0)
   //  {
   //  {
-  //    boundary_faces(T,F);
+  //    boundary_facets(T,F);
   //  }
   //  }
   }
   }
   if(vV.size() > 0)
   if(vV.size() > 0)
@@ -366,7 +366,7 @@ int main(int argc, char * argv[])
     {
     {
       return 1;
       return 1;
     }
     }
-    triangulate(vF,F);
+    polygon_mesh_to_triangle_mesh(vF,F);
   }
   }
 
 
   // Compute normals, centroid, colors, bounding box diagonal
   // Compute normals, centroid, colors, bounding box diagonal

+ 1 - 1
examples/arap/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 

+ 9 - 9
examples/arap/example.cpp

@@ -24,7 +24,7 @@
 #include <igl/list_to_matrix.h>
 #include <igl/list_to_matrix.h>
 #include <igl/snap_to_canonical_view_quat.h>
 #include <igl/snap_to_canonical_view_quat.h>
 #include <igl/snap_to_fixed_up.h>
 #include <igl/snap_to_fixed_up.h>
-#include <igl/triangulate.h>
+#include <igl/polygon_mesh_to_triangle_mesh.h>
 #include <igl/material_colors.h>
 #include <igl/material_colors.h>
 #include <igl/barycenter.h>
 #include <igl/barycenter.h>
 #include <igl/matlab_format.h>
 #include <igl/matlab_format.h>
@@ -109,7 +109,7 @@ void TW_CALL set_rotation_type(const void * value, void * clientData)
   using namespace igl;
   using namespace igl;
   const RotationType old_rotation_type = rotation_type;
   const RotationType old_rotation_type = rotation_type;
   rotation_type = *(const RotationType *)(value);
   rotation_type = *(const RotationType *)(value);
-  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP && 
+  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP &&
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
   {
   {
     push_undo();
     push_undo();
@@ -262,7 +262,7 @@ bool update_arap()
             //Quaterniond q(AngleAxisd(PI/1.5,Vector3d(0,1.0,0.1).normalized()));
             //Quaterniond q(AngleAxisd(PI/1.5,Vector3d(0,1.0,0.1).normalized()));
             //const Vector3d a = bc.row(bi);
             //const Vector3d a = bc.row(bi);
             //bc.row(bi) = (q*(a-t) + t) + Vector3d(1.5,0.1,0.9);
             //bc.row(bi) = (q*(a-t) + t) + Vector3d(1.5,0.1,0.9);
-                
+
 
 
             break;
             break;
           }
           }
@@ -432,8 +432,8 @@ void display()
   const double floor_offset =
   const double floor_offset =
     -2./bbd*(V.col(1).maxCoeff()-mid(1));
     -2./bbd*(V.col(1).maxCoeff()-mid(1));
   glTranslated(0,floor_offset,0);
   glTranslated(0,floor_offset,0);
-  const float GREY[4] = {0.5,0.5,0.6,1.0};
-  const float DARK_GREY[4] = {0.2,0.2,0.3,1.0};
+  //const float GREY[4] = {0.5,0.5,0.6,1.0};
+  //const float DARK_GREY[4] = {0.2,0.2,0.3,1.0};
 
 
   //draw_floor(GREY,DARK_GREY);
   //draw_floor(GREY,DARK_GREY);
   draw_floor();
   draw_floor();
@@ -573,7 +573,7 @@ void mouse_drag(int mouse_x, int mouse_y)
       }
       }
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       {
       {
-        // Rotate according to two axis valuator with fixed up vector 
+        // Rotate according to two axis valuator with fixed up vector
         two_axis_valuator_fixed_up(
         two_axis_valuator_fixed_up(
           width, height,
           width, height,
           2.0,
           2.0,
@@ -625,7 +625,7 @@ void key(unsigned char key, int mouse_x, int mouse_y)
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
       }
       }
   }
   }
-  
+
   glutPostRedisplay();
   glutPostRedisplay();
 }
 }
 
 
@@ -681,7 +681,7 @@ int main(int argc, char * argv[])
       cerr<<"Bad V"<<endl;
       cerr<<"Bad V"<<endl;
       return 1;
       return 1;
     }
     }
-    triangulate(vF,F);
+    polygon_mesh_to_triangle_mesh(vF,F);
   }
   }
   per_face_normals(V,F,N);
   per_face_normals(V,F,N);
 
 
@@ -705,7 +705,7 @@ int main(int argc, char * argv[])
   }
   }
   // Create a tweak bar
   // Create a tweak bar
   rebar.TwNewBar("TweakBar");
   rebar.TwNewBar("TweakBar");
-  rebar.TwAddVarRW("camera_rotation", TW_TYPE_QUAT4D, 
+  rebar.TwAddVarRW("camera_rotation", TW_TYPE_QUAT4D,
     s.camera.m_rotation_conj.coeffs().data(), "open readonly=true");
     s.camera.m_rotation_conj.coeffs().data(), "open readonly=true");
   s.camera.push_away(3);
   s.camera.push_away(3);
   s.camera.dolly_zoom(25-s.camera.m_angle);
   s.camera.dolly_zoom(25-s.camera.m_angle);

+ 2 - 2
examples/basic_topology/Makefile

@@ -2,12 +2,12 @@
 all: example1
 all: example1
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 igl_lib=../../
 igl_lib=../../
 eigen_lib=$(DEFAULT_PREFIX)/include/eigen3/
 eigen_lib=$(DEFAULT_PREFIX)/include/eigen3/
 
 
-CFLAGS=-g
+CFLAGS+=-g
 inc=-I$(igl_lib)/include -I$(eigen_lib)
 inc=-I$(igl_lib)/include -I$(eigen_lib)
 lib=-L$(igl_lib)/lib -ligl
 lib=-L$(igl_lib)/lib -ligl
 
 

+ 15 - 16
examples/basic_topology/example1.cpp

@@ -1,17 +1,17 @@
 //
 //
-//  IGL Lib - Simple C++ mesh library 
+//  IGL Lib - Simple C++ mesh library
 //
 //
 //  Copyright 2011, Daniele Panozzo. All rights reserved.
 //  Copyright 2011, Daniele Panozzo. All rights reserved.
 
 
 // IMPORTANT DO NOT REMOVE OR MOVE
 // IMPORTANT DO NOT REMOVE OR MOVE
-#define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET 
+#define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET
 
 
 #include <iostream>
 #include <iostream>
 #include <string>
 #include <string>
-#include <igl/read.h>
-#include <igl/write.h>
-#include <igl/tt.h>
-#include <igl/edgetopology.h>
+#include <igl/read_triangle_mesh.h>
+#include <igl/write_triangle_mesh.h>
+#include <igl/triangle_triangle_adjacency.h>
+#include <igl/edge_topology.h>
 
 
 using namespace std;
 using namespace std;
 
 
@@ -19,7 +19,7 @@ int main (int argc, const char * argv[])
 {
 {
     Eigen::MatrixXd V;
     Eigen::MatrixXd V;
     Eigen::MatrixXi F;
     Eigen::MatrixXi F;
-    igl::read("../shared/TinyTorus.obj",V,F);
+    igl::read_triangle_mesh("../shared/TinyTorus.obj",V,F);
 
 
     std::cout << "Mesh loaded!\n";
     std::cout << "Mesh loaded!\n";
     cout << "Vertex Array:" << endl;
     cout << "Vertex Array:" << endl;
@@ -28,13 +28,13 @@ int main (int argc, const char * argv[])
     cout << "Face Array:" << endl;
     cout << "Face Array:" << endl;
     cout << F << endl;
     cout << F << endl;
     cout << "-------------" << endl;
     cout << "-------------" << endl;
-    
-    igl::write("bunny_out.off",V,F);
-    
+
+    igl::write_triangle_mesh("bunny_out.off",V,F);
+
     // Face Topology
     // Face Topology
     cout << "TT Topology:" << endl;
     cout << "TT Topology:" << endl;
     Eigen::MatrixXi TT;
     Eigen::MatrixXi TT;
-    igl::tt(V,F,TT);
+    igl::triangle_triangle_adjacency(V,F,TT);
     cout << TT << endl;
     cout << TT << endl;
     cout << "-------------" << endl;
     cout << "-------------" << endl;
 
 
@@ -43,12 +43,11 @@ int main (int argc, const char * argv[])
     Eigen::MatrixXi EV;
     Eigen::MatrixXi EV;
     Eigen::MatrixXi FE;
     Eigen::MatrixXi FE;
     Eigen::MatrixXi EF;
     Eigen::MatrixXi EF;
-    
-    igl::edgetopology(V,F,EV,FE, EF);
+
+    igl::edge_topology(V,F,EV,FE, EF);
     cout << EV << endl << FE << endl << EF << endl;
     cout << EV << endl << FE << endl << EF << endl;
     cout << "-------------" << endl;
     cout << "-------------" << endl;
-    
-    
+
+
     return 0;
     return 0;
 }
 }
-

+ 1 - 1
examples/bbw/Makefile

@@ -1,4 +1,4 @@
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 CXX=g++
 CXX=g++
 
 

+ 2 - 2
examples/beach-balls/Makefile

@@ -2,13 +2,13 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: obj example
 all: obj example
 
 
 .PHONY: example
 .PHONY: example
 
 
-CFLAGS=-g -std=c++11
+CFLAGS+=-g -std=c++11
 
 
 LIBIGL=../../
 LIBIGL=../../
 LIBIGL_INC=-I$(LIBIGL)/include
 LIBIGL_INC=-I$(LIBIGL)/include

+ 1 - 1
examples/camera/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: obj example
 all: obj example
 
 

+ 1 - 1
examples/camera/example.cpp

@@ -230,7 +230,7 @@ void draw_scene(const igl::Camera & v_camera,
   glMatrixMode(GL_PROJECTION);
   glMatrixMode(GL_PROJECTION);
   glPushMatrix();
   glPushMatrix();
   glLoadIdentity();
   glLoadIdentity();
-  if(v_camera.m_angle > Camera::MIN_ANGLE)
+  if(v_camera.m_angle > IGL_CAMERA_MIN_ANGLE)
   {
   {
     gluPerspective(v_camera.m_angle,v_camera.m_aspect,v_camera.m_near,v_camera.m_far);
     gluPerspective(v_camera.m_angle,v_camera.m_aspect,v_camera.m_near,v_camera.m_far);
   }else
   }else

+ 2 - 2
examples/cat/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 
@@ -11,7 +11,7 @@ all: example
 igl_lib=../../
 igl_lib=../../
 eigen=$(DEFAULT_PREFIX)/include/eigen3/
 eigen=$(DEFAULT_PREFIX)/include/eigen3/
 
 
-CFLAGS=-g
+CFLAGS+=-g
 inc=-I$(igl_lib)/include -I$(eigen)
 inc=-I$(igl_lib)/include -I$(eigen)
 lib=-L$(igl_lib)/lib -ligl
 lib=-L$(igl_lib)/lib -ligl
 
 

+ 1 - 1
examples/colored-mesh/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 

+ 7 - 7
examples/colored-mesh/example.cpp

@@ -17,7 +17,7 @@
 #include <igl/list_to_matrix.h>
 #include <igl/list_to_matrix.h>
 #include <igl/snap_to_canonical_view_quat.h>
 #include <igl/snap_to_canonical_view_quat.h>
 #include <igl/snap_to_fixed_up.h>
 #include <igl/snap_to_fixed_up.h>
-#include <igl/triangulate.h>
+#include <igl/polygon_mesh_to_triangle_mesh.h>
 #include <igl/material_colors.h>
 #include <igl/material_colors.h>
 #include <igl/barycenter.h>
 #include <igl/barycenter.h>
 #include <igl/matlab_format.h>
 #include <igl/matlab_format.h>
@@ -96,7 +96,7 @@ void TW_CALL set_rotation_type(const void * value, void * clientData)
   using namespace igl;
   using namespace igl;
   const RotationType old_rotation_type = rotation_type;
   const RotationType old_rotation_type = rotation_type;
   rotation_type = *(const RotationType *)(value);
   rotation_type = *(const RotationType *)(value);
-  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP && 
+  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP &&
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
   {
   {
     push_undo();
     push_undo();
@@ -406,7 +406,7 @@ void mouse_drag(int mouse_x, int mouse_y)
       }
       }
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       {
       {
-        // Rotate according to two axis valuator with fixed up vector 
+        // Rotate according to two axis valuator with fixed up vector
         two_axis_valuator_fixed_up(
         two_axis_valuator_fixed_up(
           width, height,
           width, height,
           2.0,
           2.0,
@@ -468,7 +468,7 @@ void key(unsigned char key, int mouse_x, int mouse_y)
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
       }
       }
   }
   }
-  
+
   glutPostRedisplay();
   glutPostRedisplay();
 }
 }
 
 
@@ -530,7 +530,7 @@ int main(int argc, char * argv[])
   //  }
   //  }
   //  //if(F.size() > T.size() || F.size() == 0)
   //  //if(F.size() > T.size() || F.size() == 0)
   //  {
   //  {
-  //    boundary_faces(T,F);
+  //    boundary_facets(T,F);
   //  }
   //  }
   }
   }
   if(vV.size() > 0)
   if(vV.size() > 0)
@@ -539,7 +539,7 @@ int main(int argc, char * argv[])
     {
     {
       return 1;
       return 1;
     }
     }
-    triangulate(vF,F);
+    polygon_mesh_to_triangle_mesh(vF,F);
   }
   }
   if(!readDMAT(cfilename,Z))
   if(!readDMAT(cfilename,Z))
   {
   {
@@ -563,7 +563,7 @@ int main(int argc, char * argv[])
   }
   }
   // Create a tweak bar
   // Create a tweak bar
   rebar.TwNewBar("TweakBar");
   rebar.TwNewBar("TweakBar");
-  rebar.TwAddVarRW("camera_rotation", TW_TYPE_QUAT4D, 
+  rebar.TwAddVarRW("camera_rotation", TW_TYPE_QUAT4D,
     s.camera.m_rotation_conj.coeffs().data(), "open readonly=true");
     s.camera.m_rotation_conj.coeffs().data(), "open readonly=true");
   s.camera.push_away(3);
   s.camera.push_away(3);
   s.camera.dolly_zoom(25-s.camera.m_angle);
   s.camera.dolly_zoom(25-s.camera.m_angle);

+ 2 - 2
examples/dmat/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 
@@ -11,7 +11,7 @@ all: example
 igl_lib=../../
 igl_lib=../../
 eigen=$(DEFAULT_PREFIX)/include/eigen3
 eigen=$(DEFAULT_PREFIX)/include/eigen3
 
 
-CFLAGS=-g
+CFLAGS+=-g
 inc=-I$(igl_lib)/include -I$(eigen)
 inc=-I$(igl_lib)/include -I$(eigen)
 lib=-L$(igl_lib)/lib -ligl
 lib=-L$(igl_lib)/lib -ligl
 
 

+ 2 - 2
examples/eigen-gotchas/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 
@@ -11,7 +11,7 @@ all: example
 igl_lib=../../
 igl_lib=../../
 eigen=-I$(DEFAULT_PREFIX)/include/eigen3 -I$(DEFAULT_PREFIX)/include/eigen3/unsupported
 eigen=-I$(DEFAULT_PREFIX)/include/eigen3 -I$(DEFAULT_PREFIX)/include/eigen3/unsupported
 
 
-CFLAGS=-g
+CFLAGS+=-g
 inc=-I$(igl_lib)/include $(eigen)
 inc=-I$(igl_lib)/include $(eigen)
 lib=-L$(igl_lib)/lib -ligl
 lib=-L$(igl_lib)/lib -ligl
 
 

+ 1 - 1
examples/embree/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 

+ 8 - 8
examples/embree/example.cpp

@@ -1,7 +1,7 @@
 #include <igl/embree/EmbreeIntersector.h>
 #include <igl/embree/EmbreeIntersector.h>
 #include <igl/OpenGL_convenience.h>
 #include <igl/OpenGL_convenience.h>
 #include <igl/per_face_normals.h>
 #include <igl/per_face_normals.h>
-#include <igl/read.h>
+#include <igl/read_triangle_mesh.h>
 #include <igl/normalize_row_lengths.h>
 #include <igl/normalize_row_lengths.h>
 #include <igl/draw_mesh.h>
 #include <igl/draw_mesh.h>
 #include <igl/draw_floor.h>
 #include <igl/draw_floor.h>
@@ -220,9 +220,9 @@ void display()
     const double w0 = (1.0-hit->u-hit->v);
     const double w0 = (1.0-hit->u-hit->v);
     const double w1 = hit->u;
     const double w1 = hit->u;
     const double w2 = hit->v;
     const double w2 = hit->v;
-    VectorXd hitP = 
-      w0 * V.row(F(hit->id,0)) + 
-      w1 * V.row(F(hit->id,1)) + 
+    VectorXd hitP =
+      w0 * V.row(F(hit->id,0)) +
+      w1 * V.row(F(hit->id,1)) +
       w2 * V.row(F(hit->id,2));
       w2 * V.row(F(hit->id,2));
     glVertex3dv(hitP.data());
     glVertex3dv(hitP.data());
   }
   }
@@ -278,7 +278,7 @@ void display()
     glDisable(GL_COLOR_MATERIAL);
     glDisable(GL_COLOR_MATERIAL);
     glDisable(GL_DEPTH_TEST);
     glDisable(GL_DEPTH_TEST);
     glEnable(GL_BLEND);
     glEnable(GL_BLEND);
-    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 
+    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     glColor4f(1.0,0.3,0.3,0.6);
     glColor4f(1.0,0.3,0.3,0.6);
     glMatrixMode(GL_PROJECTION);
     glMatrixMode(GL_PROJECTION);
     glLoadIdentity();
     glLoadIdentity();
@@ -428,7 +428,7 @@ void key(unsigned char key, int mouse_x, int mouse_y)
     default:
     default:
       cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
       cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
   }
   }
-  
+
 }
 }
 
 
 int main(int argc, char * argv[])
 int main(int argc, char * argv[])
@@ -448,7 +448,7 @@ int main(int argc, char * argv[])
     // Read and prepare mesh
     // Read and prepare mesh
     filename = argv[1];
     filename = argv[1];
   }
   }
-  if(!read(filename,V,F))
+  if(!read_triangle_mesh(filename,V,F))
   {
   {
     return 1;
     return 1;
   }
   }
@@ -458,7 +458,7 @@ int main(int argc, char * argv[])
   mean = V.colwise().mean();
   mean = V.colwise().mean();
   C.resize(F.rows(),3);
   C.resize(F.rows(),3);
   init_C();
   init_C();
-  bbd = 
+  bbd =
     (V.colwise().maxCoeff() -
     (V.colwise().maxCoeff() -
     V.colwise().minCoeff()).maxCoeff();
     V.colwise().minCoeff()).maxCoeff();
 
 

+ 2 - 2
examples/example_fun/Makefile

@@ -3,11 +3,11 @@
 all: example_static example_header_only
 all: example_static example_header_only
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 igl_lib=../../
 igl_lib=../../
 
 
-CFLAGS=-g
+CFLAGS+=-g
 inc=-I$(igl_lib)/include
 inc=-I$(igl_lib)/include
 
 
 STATIC_LIB=-ligl -L../../lib
 STATIC_LIB=-ligl -L../../lib

+ 1 - 1
examples/example_fun/example.cpp

@@ -8,7 +8,7 @@ int main(int argc, char * argv[])
   example_fun(d);
   example_fun(d);
   int i = 4;
   int i = 4;
   example_fun(i);
   example_fun(i);
-#ifdef IGL_HEADER_ONLY
+#ifndef IGL_STATIC_LIBRARY
   const char * s = "string";
   const char * s = "string";
   example_fun(s);
   example_fun(s);
 #endif
 #endif

+ 2 - 2
examples/file_contents_as_string/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 
@@ -10,7 +10,7 @@ all: example
 
 
 igl_lib=../../
 igl_lib=../../
 
 
-CFLAGS=-g
+CFLAGS+=-g
 inc=-I$(igl_lib)/include
 inc=-I$(igl_lib)/include
 lib=-L$(igl_lib)/lib -ligl
 lib=-L$(igl_lib)/lib -ligl
 
 

+ 1 - 1
examples/flare-eyes/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: obj example
 all: obj example
 
 

+ 9 - 9
examples/flare-eyes/example.cpp

@@ -3,7 +3,7 @@
 #include <igl/writeOFF.h>
 #include <igl/writeOFF.h>
 #include <igl/readWRL.h>
 #include <igl/readWRL.h>
 #include <igl/report_gl_error.h>
 #include <igl/report_gl_error.h>
-#include <igl/triangulate.h>
+#include <igl/polygon_mesh_to_triangle_mesh.h>
 #include <igl/readOFF.h>
 #include <igl/readOFF.h>
 #include <igl/readMESH.h>
 #include <igl/readMESH.h>
 #include <igl/draw_mesh.h>
 #include <igl/draw_mesh.h>
@@ -103,7 +103,7 @@ void TW_CALL set_rotation_type(const void * value, void * clientData)
   using namespace igl;
   using namespace igl;
   const RotationType old_rotation_type = rotation_type;
   const RotationType old_rotation_type = rotation_type;
   rotation_type = *(const RotationType *)(value);
   rotation_type = *(const RotationType *)(value);
-  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP && 
+  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP &&
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
   {
   {
     push_undo();
     push_undo();
@@ -227,7 +227,7 @@ void draw_eyes()
     LED_METHOD_TEXTURE_FLARE = 2
     LED_METHOD_TEXTURE_FLARE = 2
   } method = LED_METHOD_TEXTURE_FLARE;
   } method = LED_METHOD_TEXTURE_FLARE;
 
 
-  
+
   for(int l = 0;l<NUM_LEDS;l++)
   for(int l = 0;l<NUM_LEDS;l++)
   {
   {
     glPushMatrix();
     glPushMatrix();
@@ -306,7 +306,7 @@ void display()
   push_scene();
   push_scene();
 
 
 
 
-  
+
   if(list_id == 0)
   if(list_id == 0)
   {
   {
     list_id = glGenLists(1);
     list_id = glGenLists(1);
@@ -496,7 +496,7 @@ void mouse_drag(int mouse_x, int mouse_y)
       }
       }
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       {
       {
-        // Rotate according to two axis valuator with fixed up vector 
+        // Rotate according to two axis valuator with fixed up vector
         two_axis_valuator_fixed_up(
         two_axis_valuator_fixed_up(
           width, height,
           width, height,
           2.0,
           2.0,
@@ -598,7 +598,7 @@ void key(unsigned char key, int mouse_x, int mouse_y)
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
       }
       }
   }
   }
-  
+
 }
 }
 
 
 int main(int argc, char * argv[])
 int main(int argc, char * argv[])
@@ -662,7 +662,7 @@ int main(int argc, char * argv[])
   //  }
   //  }
   //  //if(F.size() > T.size() || F.size() == 0)
   //  //if(F.size() > T.size() || F.size() == 0)
   //  {
   //  {
-  //    boundary_faces(T,F);
+  //    boundary_facets(T,F);
   //  }
   //  }
   }
   }
   if(vV.size() > 0)
   if(vV.size() > 0)
@@ -671,7 +671,7 @@ int main(int argc, char * argv[])
     {
     {
       return 1;
       return 1;
     }
     }
-    triangulate(vF,F);
+    polygon_mesh_to_triangle_mesh(vF,F);
   }
   }
 
 
   init_relative();
   init_relative();
@@ -686,7 +686,7 @@ int main(int argc, char * argv[])
   }
   }
   // Create a tweak bar
   // Create a tweak bar
   rebar.TwNewBar("TweakBar");
   rebar.TwNewBar("TweakBar");
-  rebar.TwAddVarRW("camera_rotation", TW_TYPE_QUAT4D, 
+  rebar.TwAddVarRW("camera_rotation", TW_TYPE_QUAT4D,
     s.camera.m_rotation_conj.coeffs().data(),"open readonly=true");
     s.camera.m_rotation_conj.coeffs().data(),"open readonly=true");
   TwType RotationTypeTW = ReTwDefineEnumFromString("RotationType",
   TwType RotationTypeTW = ReTwDefineEnumFromString("RotationType",
     "igl_trackball,two-axis-valuator-fixed-up");
     "igl_trackball,two-axis-valuator-fixed-up");

+ 2 - 2
examples/get_seconds/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 
@@ -10,7 +10,7 @@ all: example
 
 
 igl_lib=../../
 igl_lib=../../
 
 
-CFLAGS=-g -Wall
+CFLAGS+=-g -Wall
 inc=-I$(igl_lib)/include
 inc=-I$(igl_lib)/include
 lib=-L$(igl_lib)/lib -ligl
 lib=-L$(igl_lib)/lib -ligl
 
 

+ 2 - 2
examples/glslversion/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 
@@ -10,7 +10,7 @@ all: example
 
 
 igl_lib=../../
 igl_lib=../../
 
 
-CFLAGS=-g
+CFLAGS+=-g
 inc=-I$(igl_lib)/include
 inc=-I$(igl_lib)/include
 lib=$(OPENGL_LIB) $(GLUT_LIB) -L$(igl_lib)/lib -ligl
 lib=$(OPENGL_LIB) $(GLUT_LIB) -L$(igl_lib)/lib -ligl
 
 

+ 2 - 2
examples/glut_speed_test/Makefile

@@ -4,13 +4,13 @@
 all: example
 all: example
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 .PHONY: example
 .PHONY: example
 
 
 igl_lib=../../
 igl_lib=../../
 
 
-CFLAGS=-g -Wall 
+CFLAGS+=-g -Wall 
 inc=-I$(igl_lib)/include
 inc=-I$(igl_lib)/include
 lib=$(OPENGL_LIB) $(GLUT_LIB) -L$(igl_lib)/lib -ligl
 lib=$(OPENGL_LIB) $(GLUT_LIB) -L$(igl_lib)/lib -ligl
 
 

+ 2 - 2
examples/harwell_boeing/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 
@@ -11,7 +11,7 @@ all: example
 igl_lib=../../
 igl_lib=../../
 eigen=-I$(DEFAULT_PREFIX)/include/eigen3 -I$(DEFAULT_PREFIX)/include/eigen3/unsupported
 eigen=-I$(DEFAULT_PREFIX)/include/eigen3 -I$(DEFAULT_PREFIX)/include/eigen3/unsupported
 
 
-CFLAGS=-g
+CFLAGS+=-g
 inc=-I$(igl_lib)/include $(eigen)
 inc=-I$(igl_lib)/include $(eigen)
 lib=-L$(igl_lib)/lib -ligl
 lib=-L$(igl_lib)/lib -ligl
 
 

+ 1 - 1
examples/intersections/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 

+ 11 - 10
examples/intersections/example.cpp

@@ -16,7 +16,7 @@
 #include <igl/list_to_matrix.h>
 #include <igl/list_to_matrix.h>
 #include <igl/snap_to_canonical_view_quat.h>
 #include <igl/snap_to_canonical_view_quat.h>
 #include <igl/snap_to_fixed_up.h>
 #include <igl/snap_to_fixed_up.h>
-#include <igl/triangulate.h>
+#include <igl/polygon_mesh_to_triangle_mesh.h>
 #include <igl/material_colors.h>
 #include <igl/material_colors.h>
 #include <igl/barycenter.h>
 #include <igl/barycenter.h>
 #include <igl/matlab_format.h>
 #include <igl/matlab_format.h>
@@ -24,7 +24,7 @@
 #include <igl/pathinfo.h>
 #include <igl/pathinfo.h>
 #include <igl/Camera.h>
 #include <igl/Camera.h>
 #include <igl/get_seconds.h>
 #include <igl/get_seconds.h>
-#include <igl/cgal/selfintersect.h>
+#include <igl/cgal/remesh_self_intersections.h>
 #include <igl/cgal/intersect_other.h>
 #include <igl/cgal/intersect_other.h>
 
 
 #ifdef __APPLE__
 #ifdef __APPLE__
@@ -97,7 +97,7 @@ void TW_CALL set_rotation_type(const void * value, void * clientData)
   using namespace igl;
   using namespace igl;
   const RotationType old_rotation_type = rotation_type;
   const RotationType old_rotation_type = rotation_type;
   rotation_type = *(const RotationType *)(value);
   rotation_type = *(const RotationType *)(value);
-  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP && 
+  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP &&
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
   {
   {
     push_undo();
     push_undo();
@@ -446,7 +446,7 @@ void mouse_drag(int mouse_x, int mouse_y)
       }
       }
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       {
       {
-        // Rotate according to two axis valuator with fixed up vector 
+        // Rotate according to two axis valuator with fixed up vector
         two_axis_valuator_fixed_up(
         two_axis_valuator_fixed_up(
           width, height,
           width, height,
           2.0,
           2.0,
@@ -477,9 +477,10 @@ void color_selfintersections(
   using namespace Eigen;
   using namespace Eigen;
   MatrixXd SV;
   MatrixXd SV;
   MatrixXi SF,IF;
   MatrixXi SF,IF;
-  SelfintersectParam params;
+  VectorXi J,IM;
+  RemeshSelfIntersectionsParam params;
   params.detect_only = true;
   params.detect_only = true;
-  selfintersect(V,F,params,SV,SF,IF);
+  remesh_self_intersections(V,F,params,SV,SF,IF,J,IM);
   C.resize(F.rows(),3);
   C.resize(F.rows(),3);
   C.col(0).setConstant(0.4);
   C.col(0).setConstant(0.4);
   C.col(1).setConstant(0.8);
   C.col(1).setConstant(0.8);
@@ -536,7 +537,7 @@ void key(unsigned char key, int mouse_x, int mouse_y)
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
       }
       }
   }
   }
-  
+
   glutPostRedisplay();
   glutPostRedisplay();
 }
 }
 
 
@@ -606,7 +607,7 @@ int main(int argc, char * argv[])
     //  }
     //  }
     //  //if(F.size() > T.size() || F.size() == 0)
     //  //if(F.size() > T.size() || F.size() == 0)
     //  {
     //  {
-    //    boundary_faces(T,F);
+    //    boundary_facets(T,F);
     //  }
     //  }
     }
     }
     if(vV.size() > 0)
     if(vV.size() > 0)
@@ -615,7 +616,7 @@ int main(int argc, char * argv[])
       {
       {
         return false;
         return false;
       }
       }
-      triangulate(vF,F);
+      polygon_mesh_to_triangle_mesh(vF,F);
     }
     }
     // Compute normals, centroid, colors, bounding box diagonal
     // Compute normals, centroid, colors, bounding box diagonal
     per_face_normals(V,F,N);
     per_face_normals(V,F,N);
@@ -656,7 +657,7 @@ int main(int argc, char * argv[])
   }
   }
   // Create a tweak bar
   // Create a tweak bar
   rebar.TwNewBar("TweakBar");
   rebar.TwNewBar("TweakBar");
-  rebar.TwAddVarRW("camera_rotation", TW_TYPE_QUAT4D, 
+  rebar.TwAddVarRW("camera_rotation", TW_TYPE_QUAT4D,
     s.camera.m_rotation_conj.coeffs().data(), "open readonly=true");
     s.camera.m_rotation_conj.coeffs().data(), "open readonly=true");
   s.camera.push_away(3);
   s.camera.push_away(3);
   s.camera.dolly_zoom(25-s.camera.m_angle);
   s.camera.dolly_zoom(25-s.camera.m_angle);

+ 2 - 2
examples/is_dir/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 
@@ -10,7 +10,7 @@ all: example
 
 
 igl_lib=../../
 igl_lib=../../
 
 
-CFLAGS=-g
+CFLAGS+=-g
 inc=-I$(igl_lib)/include
 inc=-I$(igl_lib)/include
 lib=-L$(igl_lib)/lib -ligl
 lib=-L$(igl_lib)/lib -ligl
 
 

+ 2 - 2
examples/marching_cubes/Makefile

@@ -6,12 +6,12 @@ all: example
 .PHONY: example
 .PHONY: example
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 igl_lib=../../
 igl_lib=../../
 eigen=-I$(DEFAULT_PREFIX)/include/eigen3
 eigen=-I$(DEFAULT_PREFIX)/include/eigen3
 
 
-CFLAGS=-g
+CFLAGS+=-g
 inc=-I$(igl_lib)/include $(eigen)
 inc=-I$(igl_lib)/include $(eigen)
 lib=-L$(igl_lib)/lib -ligl
 lib=-L$(igl_lib)/lib -ligl
 
 

+ 2 - 2
examples/meshio/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 
@@ -11,7 +11,7 @@ all: example
 igl_lib=../../
 igl_lib=../../
 eigen=-I$(DEFAULT_PREFIX)/include/eigen3
 eigen=-I$(DEFAULT_PREFIX)/include/eigen3
 
 
-CFLAGS=-g
+CFLAGS+=-g
 inc=-I$(igl_lib)/include $(eigen)
 inc=-I$(igl_lib)/include $(eigen)
 lib=-L$(igl_lib)/lib -ligl
 lib=-L$(igl_lib)/lib -ligl
 
 

+ 2 - 2
examples/mode/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 
@@ -11,7 +11,7 @@ all: example
 igl_lib=../../
 igl_lib=../../
 eigen=$(DEFAULT_PREFIX)/include/eigen3/
 eigen=$(DEFAULT_PREFIX)/include/eigen3/
 
 
-CFLAGS=-g
+CFLAGS+=-g
 inc=-I$(igl_lib)/include -I$(eigen)
 inc=-I$(igl_lib)/include -I$(eigen)
 lib=-L$(igl_lib)/lib -ligl
 lib=-L$(igl_lib)/lib -ligl
 
 

+ 1 - 1
examples/multi-viewport/Makefile

@@ -8,7 +8,7 @@ all: example
 .PHONY:  example
 .PHONY:  example
 
 
 LIBIGL=/usr/local/igl/libigl/
 LIBIGL=/usr/local/igl/libigl/
-include $(LIBIGL)/Makefile.conf
+include $(LIBIGL)/build/Makefile.conf
 LIBIGL_INC=-I$(LIBIGL)/include
 LIBIGL_INC=-I$(LIBIGL)/include
 LIBIGL_LIB=-L$(LIBIGL)/lib -ligl -liglembree
 LIBIGL_LIB=-L$(LIBIGL)/lib -ligl -liglembree
 
 

+ 7 - 7
examples/multi-viewport/example.cpp

@@ -1,6 +1,6 @@
 #include <igl/OpenGL_convenience.h>
 #include <igl/OpenGL_convenience.h>
 #include <igl/per_face_normals.h>
 #include <igl/per_face_normals.h>
-#include <igl/read.h>
+#include <igl/read_triangle_mesh.h>
 #include <igl/normalize_row_lengths.h>
 #include <igl/normalize_row_lengths.h>
 #include <igl/draw_mesh.h>
 #include <igl/draw_mesh.h>
 #include <igl/unproject.h>
 #include <igl/unproject.h>
@@ -338,9 +338,9 @@ int in_viewport(const int x, const int y)
   for(int vp = 0;vp<NUM_VIEWPORTS;vp++)
   for(int vp = 0;vp<NUM_VIEWPORTS;vp++)
   {
   {
     if(
     if(
-      x >= viewports[vp].x && 
-      y >= viewports[vp].y && 
-      x <  viewports[vp].x+viewports[vp].width && 
+      x >= viewports[vp].x &&
+      y >= viewports[vp].y &&
+      x <  viewports[vp].x+viewports[vp].width &&
       y <  viewports[vp].y+viewports[vp].height)
       y <  viewports[vp].y+viewports[vp].height)
     {
     {
       down_vp = vp;
       down_vp = vp;
@@ -503,7 +503,7 @@ void key(unsigned char key, int mouse_x, int mouse_y)
     default:
     default:
       cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
       cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
   }
   }
-  
+
 }
 }
 
 
 int main(int argc, char * argv[])
 int main(int argc, char * argv[])
@@ -519,7 +519,7 @@ int main(int argc, char * argv[])
     filename = argv[1];
     filename = argv[1];
   }
   }
 
 
-  if(!read(filename,V,F))
+  if(!read_triangle_mesh(filename,V,F))
   {
   {
     return 1;
     return 1;
   }
   }
@@ -529,7 +529,7 @@ int main(int argc, char * argv[])
   mean = V.colwise().mean();
   mean = V.colwise().mean();
   C.resize(F.rows(),3);
   C.resize(F.rows(),3);
   init_C();
   init_C();
-  bbd = 
+  bbd =
     (V.colwise().maxCoeff() -
     (V.colwise().maxCoeff() -
     V.colwise().minCoeff()).maxCoeff();
     V.colwise().minCoeff()).maxCoeff();
 
 

+ 2 - 2
examples/patches/Makefile

@@ -2,13 +2,13 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: obj example
 all: obj example
 
 
 .PHONY: example
 .PHONY: example
 
 
-CFLAGS=-g -std=c++11
+CFLAGS+=-g -std=c++11
 
 
 LIBIGL=../../
 LIBIGL=../../
 LIBIGL_INC=-I$(LIBIGL)/include
 LIBIGL_INC=-I$(LIBIGL)/include

+ 14 - 12
examples/patches/example.cpp

@@ -3,7 +3,7 @@
 #include <igl/writeOFF.h>
 #include <igl/writeOFF.h>
 #include <igl/readWRL.h>
 #include <igl/readWRL.h>
 #include <igl/report_gl_error.h>
 #include <igl/report_gl_error.h>
-#include <igl/triangulate.h>
+#include <igl/polygon_mesh_to_triangle_mesh.h>
 #include <igl/readOFF.h>
 #include <igl/readOFF.h>
 #include <igl/readMESH.h>
 #include <igl/readMESH.h>
 #include <igl/draw_mesh.h>
 #include <igl/draw_mesh.h>
@@ -25,10 +25,10 @@
 #include <igl/boost/components.h>
 #include <igl/boost/components.h>
 #include <igl/boost/bfs_orient.h>
 #include <igl/boost/bfs_orient.h>
 #include <igl/orient_outward.h>
 #include <igl/orient_outward.h>
-#include <igl/embree/orient_outward_ao.h>
+#include <igl/embree/reorient_facets_raycast.h>
 #include <igl/unique_simplices.h>
 #include <igl/unique_simplices.h>
 #include <igl/C_STR.h>
 #include <igl/C_STR.h>
-#include <igl/write.h>
+#include <igl/write_triangle_mesh.h>
 #include <igl/two_axis_valuator_fixed_up.h>
 #include <igl/two_axis_valuator_fixed_up.h>
 #include <igl/snap_to_fixed_up.h>
 #include <igl/snap_to_fixed_up.h>
 
 
@@ -149,7 +149,7 @@ void TW_CALL set_rotation_type(const void * value, void * clientData)
   using namespace igl;
   using namespace igl;
   const RotationType old_rotation_type = rotation_type;
   const RotationType old_rotation_type = rotation_type;
   rotation_type = *(const RotationType *)(value);
   rotation_type = *(const RotationType *)(value);
-  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP && 
+  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP &&
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
   {
   {
     push_undo();
     push_undo();
@@ -291,7 +291,7 @@ void display()
     {
     {
       draw_mesh(V,F,s.N,s.C);
       draw_mesh(V,F,s.N,s.C);
     }
     }
-  
+
     // visualize selected patch
     // visualize selected patch
     glLineWidth(10);
     glLineWidth(10);
     glBegin(GL_TRIANGLES);
     glBegin(GL_TRIANGLES);
@@ -390,7 +390,7 @@ void mouse_wheel(int wheel, int direction, int mouse_x, int mouse_y)
       break;
       break;
     default:
     default:
     case CENTER_TYPE_FPS:
     case CENTER_TYPE_FPS:
-      // Move `eye` and `at` 
+      // Move `eye` and `at`
       camera.dolly((wheel==0?Vector3d(0,0,1):Vector3d(-1,0,0))*0.1*direction);
       camera.dolly((wheel==0?Vector3d(0,0,1):Vector3d(-1,0,0))*0.1*direction);
       break;
       break;
   }
   }
@@ -487,7 +487,7 @@ void mouse_drag(int mouse_x, int mouse_y)
       }
       }
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       {
       {
-        // Rotate according to two axis valuator with fixed up vector 
+        // Rotate according to two axis valuator with fixed up vector
         two_axis_valuator_fixed_up(
         two_axis_valuator_fixed_up(
           width, height,
           width, height,
           2.0,
           2.0,
@@ -567,9 +567,11 @@ void init_patches()
   switch(orient_method)
   switch(orient_method)
   {
   {
     case ORIENT_METHOD_AO:
     case ORIENT_METHOD_AO:
+    {
       cout<<"orient_outward_ao()"<<endl;
       cout<<"orient_outward_ao()"<<endl;
-      orient_outward_ao(V,F,CC,100, F.rows() * 100,F,I);
+      reorient_facets_raycast(V,F,F,I);
       break;
       break;
+    }
     case ORIENT_METHOD_OUTWARD:
     case ORIENT_METHOD_OUTWARD:
     default:
     default:
       cout<<"orient_outward()"<<endl;
       cout<<"orient_outward()"<<endl;
@@ -606,7 +608,7 @@ bool save(const std::string & out_filename)
 {
 {
   using namespace std;
   using namespace std;
   using namespace igl;
   using namespace igl;
-  if(write(out_filename,V,F))
+  if(write_triangle_mesh(out_filename,V,F))
   {
   {
     cout<<GREENGIN("Saved mesh to `"<<out_filename<<"` successfully.")<<endl;
     cout<<GREENGIN("Saved mesh to `"<<out_filename<<"` successfully.")<<endl;
     return true;
     return true;
@@ -689,7 +691,7 @@ void key(unsigned char key, int mouse_x, int mouse_y)
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
       }
       }
   }
   }
-  
+
 }
 }
 
 
 int main(int argc, char * argv[])
 int main(int argc, char * argv[])
@@ -757,7 +759,7 @@ int main(int argc, char * argv[])
   //  }
   //  }
   //  //if(F.size() > T.size() || F.size() == 0)
   //  //if(F.size() > T.size() || F.size() == 0)
   //  {
   //  {
-  //    boundary_faces(T,F);
+  //    boundary_facets(T,F);
   //  }
   //  }
   }
   }
   if(vV.size() > 0)
   if(vV.size() > 0)
@@ -766,7 +768,7 @@ int main(int argc, char * argv[])
     {
     {
       return 1;
       return 1;
     }
     }
-    triangulate(vF,F);
+    polygon_mesh_to_triangle_mesh(vF,F);
   }
   }
   MatrixXi F_unique;
   MatrixXi F_unique;
   unique_simplices(F, F_unique);
   unique_simplices(F, F_unique);

+ 3 - 3
examples/patches/temp.rbr

@@ -1,7 +1,7 @@
-camera_rotation: TW_TYPE_QUAT4D 0.221720768269005 -0.655276665457443 -0.211493904735977 0.690451099560792
+camera_rotation: TW_TYPE_QUAT4D 0.152085375459856 -0.590495112202136 -0.114509193857288 0.784266029838584
 center_type: CenterType orbit
 center_type: CenterType orbit
-wireframe_visible: TW_TYPE_BOOLCPP 0
+wireframe_visible: TW_TYPE_BOOLCPP 1
 fill_visible: TW_TYPE_BOOLCPP 1
 fill_visible: TW_TYPE_BOOLCPP 1
-rotation_type: RotationType igl_trackball
+rotation_type: RotationType two-axis-valuator-fixed-up
 orient_method: OrientMethod ambient-occlusion
 orient_method: OrientMethod ambient-occlusion
 
 

+ 2 - 2
examples/path_tests/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 
@@ -10,7 +10,7 @@ all: example
 
 
 igl_lib=../../
 igl_lib=../../
 
 
-CFLAGS=-g -Wall
+CFLAGS+=-g -Wall
 inc=-I$(igl_lib)/include
 inc=-I$(igl_lib)/include
 lib=-L$(igl_lib)/lib -ligl
 lib=-L$(igl_lib)/lib -ligl
 
 

+ 2 - 2
examples/pathinfo/Makefile

@@ -4,13 +4,13 @@
 all: example
 all: example
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 .PHONY: example
 .PHONY: example
 
 
 igl_lib=../../
 igl_lib=../../
 
 
-CFLAGS=-g -Wall 
+CFLAGS+=-g -Wall 
 inc=-I$(igl_lib)/include
 inc=-I$(igl_lib)/include
 lib=-L$(igl_lib)/lib -ligl
 lib=-L$(igl_lib)/lib -ligl
 
 

+ 3 - 4
examples/principal_curvature/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: curvature
 all: curvature
 
 
@@ -11,14 +11,13 @@ all: curvature
 igl_lib=../../
 igl_lib=../../
 eigen=-I$(DEFAULT_PREFIX)/include/eigen3
 eigen=-I$(DEFAULT_PREFIX)/include/eigen3
 
 
-CFLAGS=-g -O3
 inc=-I$(igl_lib)/include $(eigen)
 inc=-I$(igl_lib)/include $(eigen)
 
 
 curvature: curvature.o
 curvature: curvature.o
-	g++ $(CFLAGS) -o curvature curvature.o $(lib)
+	g++ $(CFLAGS) $(OPENMP) -o curvature curvature.o $(lib)
 
 
 curvature.o: curvature.cpp
 curvature.o: curvature.cpp
-	g++ $(CFLAGS) -c curvature.cpp -o curvature.o $(inc)
+	g++ $(CFLAGS) $(OPENMP) -c curvature.cpp -o curvature.o $(inc)
 clean:
 clean:
 	rm -f curvature.o
 	rm -f curvature.o
 	rm -f curvature
 	rm -f curvature

+ 5 - 5
examples/principal_curvature/curvature.cpp

@@ -1,7 +1,7 @@
 
 
-#define IGL_HEADER_ONLY
+#undef IGL_STATIC_LIBRARY
 #include <igl/principal_curvature.h>
 #include <igl/principal_curvature.h>
-#include <igl/read.h>
+#include <igl/read_triangle_mesh.h>
 #include <iostream>
 #include <iostream>
 #include <Eigen/Dense>
 #include <Eigen/Dense>
 #include <Eigen/Sparse>
 #include <Eigen/Sparse>
@@ -44,7 +44,7 @@ void app_init(int argc, char* argv[], CurvatureCalculator& c, Eigen::MatrixXd& V
     }
     }
     char* tmp;
     char* tmp;
     const char* meshName;
     const char* meshName;
-    char * scaleFile;
+    //char * scaleFile;
     for (argc--, argv++; argc--; argv++)
     for (argc--, argv++; argc--; argv++)
     {
     {
         if( (*argv)[0] == '-')
         if( (*argv)[0] == '-')
@@ -68,7 +68,7 @@ void app_init(int argc, char* argv[], CurvatureCalculator& c, Eigen::MatrixXd& V
                 break;
                 break;
             case 'i':
             case 'i':
                 meshName=*++argv;
                 meshName=*++argv;
-                igl::read(meshName,V,F);
+                igl::read_triangle_mesh(meshName,V,F);
                 argc--;
                 argc--;
                 break;
                 break;
             case 'k':
             case 'k':
@@ -152,7 +152,7 @@ int main(int argc, char *argv[])
     string filename;
     string filename;
 
 
     app_init(argc,argv,c,V,F);
     app_init(argc,argv,c,V,F);
-    
+
     c.init(V,F);
     c.init(V,F);
 
 
     c.computeCurvature();
     c.computeCurvature();

+ 6 - 6
examples/quicklook-mesh/src/render_to_buffer.cpp

@@ -15,10 +15,10 @@ extern "C" {
 #include <igl/readOBJ.h>
 #include <igl/readOBJ.h>
 #include <igl/readSTL.h>
 #include <igl/readSTL.h>
 #include <igl/readWRL.h>
 #include <igl/readWRL.h>
-#include <igl/triangulate.h>
+#include <igl/polygon_mesh_to_triangle_mesh.h>
 #include <igl/readOFF.h>
 #include <igl/readOFF.h>
 #include <igl/readMESH.h>
 #include <igl/readMESH.h>
-#include <igl/boundary_faces.h>
+#include <igl/boundary_facets.h>
 #include <igl/barycenter.h>
 #include <igl/barycenter.h>
 #include <igl/doublearea.h>
 #include <igl/doublearea.h>
 #include <igl/EPS.h>
 #include <igl/EPS.h>
@@ -395,7 +395,7 @@ bool render_to_buffer(
     }
     }
     //if(F.size() > T.size() || F.size() == 0)
     //if(F.size() > T.size() || F.size() == 0)
     {
     {
-      boundary_faces(T,F);
+      boundary_facets(T,F);
     }
     }
   }
   }
   if(vV.size() > 0)
   if(vV.size() > 0)
@@ -405,7 +405,7 @@ bool render_to_buffer(
       red(width,height,buffer);
       red(width,height,buffer);
       return false;
       return false;
     }
     }
-    triangulate(vF,F);
+    polygon_mesh_to_triangle_mesh(vF,F);
   }
   }
   cout<<"IO: "<<(get_seconds()-ts)<<"s"<<endl;
   cout<<"IO: "<<(get_seconds()-ts)<<"s"<<endl;
   ts = get_seconds();
   ts = get_seconds();
@@ -455,7 +455,7 @@ bool render_to_buffer(
     red(width,height,buffer);
     red(width,height,buffer);
     return false;
     return false;
   }
   }
-    
+
   // Render
   // Render
   init_viewports();
   init_viewports();
   reshape(width,height);
   reshape(width,height);
@@ -465,6 +465,6 @@ bool render_to_buffer(
 
 
   /* destroy the context */
   /* destroy the context */
   OSMesaDestroyContext( ctx );
   OSMesaDestroyContext( ctx );
-  
+
   return true;
   return true;
 }
 }

+ 1 - 1
examples/randomly-sample-mesh/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: obj example
 all: obj example
 
 

+ 8 - 8
examples/randomly-sample-mesh/example.cpp

@@ -4,7 +4,7 @@
 #include <igl/writeOFF.h>
 #include <igl/writeOFF.h>
 #include <igl/readWRL.h>
 #include <igl/readWRL.h>
 #include <igl/report_gl_error.h>
 #include <igl/report_gl_error.h>
-#include <igl/triangulate.h>
+#include <igl/polygon_mesh_to_triangle_mesh.h>
 #include <igl/readOFF.h>
 #include <igl/readOFF.h>
 #include <igl/readMESH.h>
 #include <igl/readMESH.h>
 #include <igl/draw_mesh.h>
 #include <igl/draw_mesh.h>
@@ -93,7 +93,7 @@ void TW_CALL set_rotation_type(const void * value, void * clientData)
   using namespace igl;
   using namespace igl;
   const RotationType old_rotation_type = rotation_type;
   const RotationType old_rotation_type = rotation_type;
   rotation_type = *(const RotationType *)(value);
   rotation_type = *(const RotationType *)(value);
-  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP && 
+  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP &&
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
   {
   {
     push_undo();
     push_undo();
@@ -223,7 +223,7 @@ void display()
   glMaterialfv(GL_BACK, GL_SPECULAR, SILVER_SPECULAR);
   glMaterialfv(GL_BACK, GL_SPECULAR, SILVER_SPECULAR);
   glMaterialf (GL_BACK, GL_SHININESS, 128);
   glMaterialf (GL_BACK, GL_SHININESS, 128);
 
 
-  
+
   draw_mesh(V,F,N);
   draw_mesh(V,F,N);
 
 
   glPointSize(3.);
   glPointSize(3.);
@@ -381,7 +381,7 @@ void mouse_drag(int mouse_x, int mouse_y)
       }
       }
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       {
       {
-        // Rotate according to two axis valuator with fixed up vector 
+        // Rotate according to two axis valuator with fixed up vector
         two_axis_valuator_fixed_up(
         two_axis_valuator_fixed_up(
           width, height,
           width, height,
           2.0,
           2.0,
@@ -482,7 +482,7 @@ void key(unsigned char key, int mouse_x, int mouse_y)
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
       }
       }
   }
   }
-  
+
 }
 }
 
 
 int main(int argc, char * argv[])
 int main(int argc, char * argv[])
@@ -546,7 +546,7 @@ int main(int argc, char * argv[])
   //  }
   //  }
   //  //if(F.size() > T.size() || F.size() == 0)
   //  //if(F.size() > T.size() || F.size() == 0)
   //  {
   //  {
-  //    boundary_faces(T,F);
+  //    boundary_facets(T,F);
   //  }
   //  }
   }
   }
   if(vV.size() > 0)
   if(vV.size() > 0)
@@ -555,7 +555,7 @@ int main(int argc, char * argv[])
     {
     {
       return 1;
       return 1;
     }
     }
-    triangulate(vF,F);
+    polygon_mesh_to_triangle_mesh(vF,F);
   }
   }
 
 
   init_relative();
   init_relative();
@@ -571,7 +571,7 @@ int main(int argc, char * argv[])
   }
   }
   // Create a tweak bar
   // Create a tweak bar
   rebar.TwNewBar("TweakBar");
   rebar.TwNewBar("TweakBar");
-  rebar.TwAddVarRW("camera_rotation", TW_TYPE_QUAT4D, 
+  rebar.TwAddVarRW("camera_rotation", TW_TYPE_QUAT4D,
     s.camera.m_rotation_conj.coeffs().data(), "open readonly=true");
     s.camera.m_rotation_conj.coeffs().data(), "open readonly=true");
   TwType RotationTypeTW = ReTwDefineEnumFromString("RotationType",
   TwType RotationTypeTW = ReTwDefineEnumFromString("RotationType",
     "igl_trackball,two-a...-fixed-up");
     "igl_trackball,two-a...-fixed-up");

+ 1 - 1
examples/render_to_png/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 # YIMG dependency
 # YIMG dependency
 YIMG=../../external/yimg
 YIMG=../../external/yimg

+ 1 - 1
examples/rotate-widget/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: obj example
 all: obj example
 
 

+ 7 - 7
examples/rotate-widget/example.cpp

@@ -6,7 +6,7 @@
 #include <igl/writeOFF.h>
 #include <igl/writeOFF.h>
 #include <igl/readWRL.h>
 #include <igl/readWRL.h>
 #include <igl/report_gl_error.h>
 #include <igl/report_gl_error.h>
-#include <igl/triangulate.h>
+#include <igl/polygon_mesh_to_triangle_mesh.h>
 #include <igl/readOFF.h>
 #include <igl/readOFF.h>
 #include <igl/readMESH.h>
 #include <igl/readMESH.h>
 #include <igl/draw_mesh.h>
 #include <igl/draw_mesh.h>
@@ -99,7 +99,7 @@ void TW_CALL set_rotation_type(const void * value, void * clientData)
   using namespace igl;
   using namespace igl;
   const RotationType old_rotation_type = rotation_type;
   const RotationType old_rotation_type = rotation_type;
   rotation_type = *(const RotationType *)(value);
   rotation_type = *(const RotationType *)(value);
-  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP && 
+  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP &&
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
   {
   {
     push_undo();
     push_undo();
@@ -417,7 +417,7 @@ void mouse_drag(int mouse_x, int mouse_y)
       }
       }
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       {
       {
-        // Rotate according to two axis valuator with fixed up vector 
+        // Rotate according to two axis valuator with fixed up vector
         two_axis_valuator_fixed_up(
         two_axis_valuator_fixed_up(
           width, height,
           width, height,
           2.0,
           2.0,
@@ -509,7 +509,7 @@ void key(unsigned char key, int mouse_x, int mouse_y)
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
       }
       }
   }
   }
-  
+
   glutPostRedisplay();
   glutPostRedisplay();
 }
 }
 
 
@@ -574,7 +574,7 @@ int main(int argc, char * argv[])
   //  }
   //  }
   //  //if(F.size() > T.size() || F.size() == 0)
   //  //if(F.size() > T.size() || F.size() == 0)
   //  {
   //  {
-  //    boundary_faces(T,F);
+  //    boundary_facets(T,F);
   //  }
   //  }
   }
   }
   if(vV.size() > 0)
   if(vV.size() > 0)
@@ -583,7 +583,7 @@ int main(int argc, char * argv[])
     {
     {
       return 1;
       return 1;
     }
     }
-    triangulate(vF,F);
+    polygon_mesh_to_triangle_mesh(vF,F);
   }
   }
 
 
   init_relative();
   init_relative();
@@ -598,7 +598,7 @@ int main(int argc, char * argv[])
   }
   }
   // Create a tweak bar
   // Create a tweak bar
   rebar.TwNewBar("TweakBar");
   rebar.TwNewBar("TweakBar");
-  rebar.TwAddVarRW("camera_rotation", TW_TYPE_QUAT4D, 
+  rebar.TwAddVarRW("camera_rotation", TW_TYPE_QUAT4D,
     s.camera.m_rotation_conj.coeffs().data(), "open readonly=true");
     s.camera.m_rotation_conj.coeffs().data(), "open readonly=true");
   TwType RotationTypeTW = ReTwDefineEnumFromString("RotationType",
   TwType RotationTypeTW = ReTwDefineEnumFromString("RotationType",
     "igl_trackball,two-a...-fixed-up");
     "igl_trackball,two-a...-fixed-up");

+ 1 - 1
examples/scene-rotation/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: obj example
 all: obj example
 
 

+ 13 - 13
examples/scene-rotation/example.cpp

@@ -1,4 +1,4 @@
-// Small GLUT application to test different scene rotation paradigms 
+// Small GLUT application to test different scene rotation paradigms
 //
 //
 
 
 #include "trackball.h"
 #include "trackball.h"
@@ -9,7 +9,7 @@
 #include <igl/writeOFF.h>
 #include <igl/writeOFF.h>
 #include <igl/readWRL.h>
 #include <igl/readWRL.h>
 #include <igl/report_gl_error.h>
 #include <igl/report_gl_error.h>
-#include <igl/triangulate.h>
+#include <igl/polygon_mesh_to_triangle_mesh.h>
 #include <igl/readOFF.h>
 #include <igl/readOFF.h>
 #include <igl/readMESH.h>
 #include <igl/readMESH.h>
 #include <igl/draw_mesh.h>
 #include <igl/draw_mesh.h>
@@ -107,7 +107,7 @@ void TW_CALL set_rotation_type(const void * value, void * clientData)
   using namespace igl;
   using namespace igl;
   const RotationType old_rotation_type = rotation_type;
   const RotationType old_rotation_type = rotation_type;
   rotation_type = *(const RotationType *)(value);
   rotation_type = *(const RotationType *)(value);
-  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP && 
+  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP &&
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
   {
   {
     push_undo();
     push_undo();
@@ -246,7 +246,7 @@ void display()
   glMaterialfv(GL_BACK, GL_SPECULAR, SILVER_SPECULAR);
   glMaterialfv(GL_BACK, GL_SPECULAR, SILVER_SPECULAR);
   glMaterialf (GL_BACK, GL_SHININESS, 128);
   glMaterialf (GL_BACK, GL_SHININESS, 128);
 
 
-  
+
   draw_mesh(V,F,N);
   draw_mesh(V,F,N);
   pop_object();
   pop_object();
 
 
@@ -306,7 +306,7 @@ void mouse_wheel(int wheel, int direction, int mouse_x, int mouse_y)
       break;
       break;
     default:
     default:
     case CENTER_TYPE_FPS:
     case CENTER_TYPE_FPS:
-      // Move `eye` and `at` 
+      // Move `eye` and `at`
       camera.dolly((wheel==0?Vector3d(0,0,1):Vector3d(-1,0,0))*0.1*direction);
       camera.dolly((wheel==0?Vector3d(0,0,1):Vector3d(-1,0,0))*0.1*direction);
       break;
       break;
   }
   }
@@ -408,13 +408,13 @@ void mouse_drag(int mouse_x, int mouse_y)
           down_camera.m_rotation_conj.coeffs().data()+4,
           down_camera.m_rotation_conj.coeffs().data()+4,
           down_quaternion);
           down_quaternion);
         float new_quaternion[4];
         float new_quaternion[4];
-        
+
         const float center_x = ((float)width)/2.0;
         const float center_x = ((float)width)/2.0;
         const float center_y = ((float)height)/2.0;
         const float center_y = ((float)height)/2.0;
         const double speed = 2.0f;
         const double speed = 2.0f;
         const float half_width =   ((float)width)/speed;
         const float half_width =   ((float)width)/speed;
         const float half_height = ((float)height)/speed;
         const float half_height = ((float)height)/speed;
-        
+
         ::trackball(new_quaternion,
         ::trackball(new_quaternion,
           (float)(center_x-down_x)/half_width,
           (float)(center_x-down_x)/half_width,
           (float)(down_y-center_y)/half_height,
           (float)(down_y-center_y)/half_height,
@@ -435,7 +435,7 @@ void mouse_drag(int mouse_x, int mouse_y)
         const double speed = 2.0;
         const double speed = 2.0;
         if(axis.norm() != 0)
         if(axis.norm() != 0)
         {
         {
-          q = 
+          q =
             Quaterniond(
             Quaterniond(
               AngleAxisd(
               AngleAxisd(
                 M_PI*axis.norm()/(double)width*speed/2.0,
                 M_PI*axis.norm()/(double)width*speed/2.0,
@@ -446,7 +446,7 @@ void mouse_drag(int mouse_x, int mouse_y)
       }
       }
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       {
       {
-        // Rotate according to two axis valuator with fixed up vector 
+        // Rotate according to two axis valuator with fixed up vector
         two_axis_valuator_fixed_up(
         two_axis_valuator_fixed_up(
           width, height,
           width, height,
           2.0,
           2.0,
@@ -565,7 +565,7 @@ void key(unsigned char key, int mouse_x, int mouse_y)
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
       }
       }
   }
   }
-  
+
 }
 }
 
 
 int main(int argc, char * argv[])
 int main(int argc, char * argv[])
@@ -629,7 +629,7 @@ int main(int argc, char * argv[])
   //  }
   //  }
   //  //if(F.size() > T.size() || F.size() == 0)
   //  //if(F.size() > T.size() || F.size() == 0)
   //  {
   //  {
-  //    boundary_faces(T,F);
+  //    boundary_facets(T,F);
   //  }
   //  }
   }
   }
   if(vV.size() > 0)
   if(vV.size() > 0)
@@ -638,7 +638,7 @@ int main(int argc, char * argv[])
     {
     {
       return 1;
       return 1;
     }
     }
-    triangulate(vF,F);
+    polygon_mesh_to_triangle_mesh(vF,F);
   }
   }
 
 
   init_relative();
   init_relative();
@@ -653,7 +653,7 @@ int main(int argc, char * argv[])
   }
   }
   // Create a tweak bar
   // Create a tweak bar
   rebar.TwNewBar("TweakBar");
   rebar.TwNewBar("TweakBar");
-  rebar.TwAddVarRW("camera_rotation", TW_TYPE_QUAT4D, 
+  rebar.TwAddVarRW("camera_rotation", TW_TYPE_QUAT4D,
     s.camera.m_rotation_conj.coeffs().data(), "open readonly=true");
     s.camera.m_rotation_conj.coeffs().data(), "open readonly=true");
   TwType RotationTypeTW = ReTwDefineEnumFromString("RotationType",
   TwType RotationTypeTW = ReTwDefineEnumFromString("RotationType",
     "igl_trackball,bell_trackball,two-axis-valuator,two-a...-fixed-up");
     "igl_trackball,bell_trackball,two-axis-valuator,two-a...-fixed-up");

+ 1 - 1
examples/scene-rotation/trackball.h

@@ -83,4 +83,4 @@ axis_to_quat(float a[3], float phi, float q[4]);
 void quat_to_axis(float q[4], float axis[3], float &phi);
 void quat_to_axis(float q[4], float axis[3], float &phi);
 void add_quats_no_renorm(float q1[4], float q2[4], float dest[4]);
 void add_quats_no_renorm(float q1[4], float q2[4], float dest[4]);
 void quat_rotate_point(float q[4], const float p1[3], float p2[3]);
 void quat_rotate_point(float q[4], const float p1[3], float p2[3]);
-////Olga////
+////Olga////

+ 1 - 1
examples/shadow-mapping/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: obj example
 all: obj example
 
 

+ 35 - 29
examples/shadow-mapping/example.cpp

@@ -6,7 +6,7 @@
 #include <igl/writeOFF.h>
 #include <igl/writeOFF.h>
 #include <igl/readWRL.h>
 #include <igl/readWRL.h>
 #include <igl/report_gl_error.h>
 #include <igl/report_gl_error.h>
-#include <igl/triangulate.h>
+#include <igl/polygon_mesh_to_triangle_mesh.h>
 #include <igl/readOFF.h>
 #include <igl/readOFF.h>
 #include <igl/readMESH.h>
 #include <igl/readMESH.h>
 #include <igl/draw_mesh.h>
 #include <igl/draw_mesh.h>
@@ -19,7 +19,6 @@
 #include <igl/trackball.h>
 #include <igl/trackball.h>
 #include <igl/snap_to_canonical_view_quat.h>
 #include <igl/snap_to_canonical_view_quat.h>
 #include <igl/REDRUM.h>
 #include <igl/REDRUM.h>
-#include <igl/Camera.h>
 #include <igl/ReAntTweakBar.h>
 #include <igl/ReAntTweakBar.h>
 #include <igl/get_seconds.h>
 #include <igl/get_seconds.h>
 #include <igl/jet.h>
 #include <igl/jet.h>
@@ -31,7 +30,7 @@
 //#include <igl/embree/orient_outward_ao.h>
 //#include <igl/embree/orient_outward_ao.h>
 #include <igl/unique_simplices.h>
 #include <igl/unique_simplices.h>
 #include <igl/C_STR.h>
 #include <igl/C_STR.h>
-#include <igl/write.h>
+#include <igl/write_triangle_mesh.h>
 
 
 #include <Eigen/Core>
 #include <Eigen/Core>
 #include <Eigen/Geometry>
 #include <Eigen/Geometry>
@@ -57,6 +56,14 @@
 #include <iostream>
 #include <iostream>
 
 
 
 
+struct Camera
+{
+  Eigen::Vector3d pan;
+  Eigen::Quaterniond rotation;
+  double zoom;
+  double angle;
+  Camera():pan(0,0,0),rotation(1,0,0,0),zoom(1),angle(25){}
+};
 
 
 // Initialize shadow textures. Should be called on reshape()
 // Initialize shadow textures. Should be called on reshape()
 //
 //
@@ -89,9 +96,9 @@ bool initialize_shadows(
   glGenTextures(1, &shadowMapTexture);
   glGenTextures(1, &shadowMapTexture);
   glBindTexture(GL_TEXTURE_2D, shadowMapTexture);
   glBindTexture(GL_TEXTURE_2D, shadowMapTexture);
   glTexImage2D(
   glTexImage2D(
-    GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 
+    GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT,
     factor*windowWidth,
     factor*windowWidth,
-    factor*windowHeight, 
+    factor*windowHeight,
     0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL);
     0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL);
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
@@ -103,16 +110,16 @@ bool initialize_shadows(
   glGenFramebuffersEXT(1, &fbo);
   glGenFramebuffersEXT(1, &fbo);
   glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
   glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
   glFramebufferTexture2DEXT(
   glFramebufferTexture2DEXT(
-    GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, 
+    GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D,
     shadowMapTexture,0);
     shadowMapTexture,0);
   // Attach color render buffer
   // Attach color render buffer
   glGenRenderbuffersEXT(1,&cfbo);
   glGenRenderbuffersEXT(1,&cfbo);
   glBindRenderbufferEXT(GL_RENDERBUFFER_EXT,cfbo);
   glBindRenderbufferEXT(GL_RENDERBUFFER_EXT,cfbo);
-  glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA8, 
+  glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA8,
     factor*windowWidth, factor*windowHeight);
     factor*windowWidth, factor*windowHeight);
   //-------------------------
   //-------------------------
   //Attach color buffer to FBO
   //Attach color buffer to FBO
-  glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, 
+  glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
     GL_RENDERBUFFER_EXT, cfbo);
     GL_RENDERBUFFER_EXT, cfbo);
   //-------------------------
   //-------------------------
   //Does the GPU support current FBO configuration?
   //Does the GPU support current FBO configuration?
@@ -140,7 +147,7 @@ struct Mesh
   Eigen::MatrixXi F;
   Eigen::MatrixXi F;
   Eigen::Affine3d a,da;
   Eigen::Affine3d a,da;
   Mesh():V(),N(),F(),a(Eigen::Affine3d::Identity()),da(Eigen::Affine3d::Identity())
   Mesh():V(),N(),F(),a(Eigen::Affine3d::Identity()),da(Eigen::Affine3d::Identity())
-  { 
+  {
     using namespace Eigen;
     using namespace Eigen;
     Quaterniond r(Eigen::Vector4d::Random());
     Quaterniond r(Eigen::Vector4d::Random());
     Quaterniond i(1,0,0,0);
     Quaterniond i(1,0,0,0);
@@ -154,7 +161,7 @@ std::vector<Mesh> meshes;
 
 
 struct State
 struct State
 {
 {
-  igl::Camera camera;
+  ::Camera camera;
   State():
   State():
     camera()
     camera()
   {
   {
@@ -175,7 +182,7 @@ std::stack<State> redo_stack;
 
 
 bool is_rotating = false;
 bool is_rotating = false;
 int down_x,down_y;
 int down_x,down_y;
-igl::Camera down_camera;
+::Camera down_camera;
 
 
 bool is_animating = false;
 bool is_animating = false;
 double animation_start_time = 0;
 double animation_start_time = 0;
@@ -276,7 +283,7 @@ void push_lightview_camera(const Eigen::Vector4f & light_pos)
     0,1,0);
     0,1,0);
 }
 }
 
 
-void push_camera(const igl::Camera & camera)
+void push_camera(const ::Camera & camera)
 {
 {
   using namespace igl;
   using namespace igl;
   glMatrixMode(GL_MODELVIEW);
   glMatrixMode(GL_MODELVIEW);
@@ -284,7 +291,7 @@ void push_camera(const igl::Camera & camera)
   // scale, pan
   // scale, pan
   glScaled(camera.zoom, camera.zoom, camera.zoom);
   glScaled(camera.zoom, camera.zoom, camera.zoom);
   double mat[4*4];
   double mat[4*4];
-  quat_to_mat(camera.rotation,mat);
+  quat_to_mat(camera.rotation.coeffs().data(),mat);
   glMultMatrixd(mat);
   glMultMatrixd(mat);
 }
 }
 
 
@@ -368,7 +375,7 @@ void draw_objects()
     draw_mesh(mesh.V,mesh.F,mesh.N);
     draw_mesh(mesh.V,mesh.F,mesh.N);
     glPopMatrix();
     glPopMatrix();
   }
   }
-  
+
   // Draw a nice floor
   // Draw a nice floor
   glPushMatrix();
   glPushMatrix();
   {
   {
@@ -451,10 +458,10 @@ void display()
       is_animating = false;
       is_animating = false;
     }
     }
     Quaterniond q;
     Quaterniond q;
-    q.coeffs() = 
+    q.coeffs() =
       animation_to_quat.coeffs()*t + animation_from_quat.coeffs()*(1.-t);
       animation_to_quat.coeffs()*t + animation_from_quat.coeffs()*(1.-t);
     q.normalize();
     q.normalize();
-    copy(q.coeffs().data(),q.coeffs().data()+4,s.camera.rotation);
+    s.camera.rotation = q;
   }
   }
   update_meshes();
   update_meshes();
 
 
@@ -496,7 +503,7 @@ void mouse_wheel(int wheel, int direction, int mouse_x, int mouse_y)
       const double a_diff = 1.0;
       const double a_diff = 1.0;
       s.camera.angle += double(direction)*a_diff;
       s.camera.angle += double(direction)*a_diff;
       const double min_angle = 15.0;
       const double min_angle = 15.0;
-      s.camera.angle = 
+      s.camera.angle =
         min(90.0,max(min_angle,s.camera.angle));
         min(90.0,max(min_angle,s.camera.angle));
     }
     }
   }
   }
@@ -577,7 +584,7 @@ void mouse_drag(int mouse_x, int mouse_y)
       case ROTATION_TYPE_IGL_TRACKBALL:
       case ROTATION_TYPE_IGL_TRACKBALL:
       {
       {
         // Rotate according to trackball
         // Rotate according to trackball
-        igl::trackball<double>(
+        igl::trackball(
           width,
           width,
           height,
           height,
           2.0,
           2.0,
@@ -591,12 +598,11 @@ void mouse_drag(int mouse_x, int mouse_y)
       }
       }
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       {
       {
-        Quaterniond down_q;
-        copy(down_camera.rotation,down_camera.rotation+4,down_q.coeffs().data());
+        Quaterniond down_q = down_camera.rotation;
         Vector3d axis(0,1,0);
         Vector3d axis(0,1,0);
         const double speed = 2.0;
         const double speed = 2.0;
         Quaterniond q;
         Quaterniond q;
-        q = down_q * 
+        q = down_q *
           Quaterniond(
           Quaterniond(
             AngleAxisd(
             AngleAxisd(
               M_PI*((double)(mouse_x-down_x))/(double)width*speed/2.0,
               M_PI*((double)(mouse_x-down_x))/(double)width*speed/2.0,
@@ -607,7 +613,7 @@ void mouse_drag(int mouse_x, int mouse_y)
           const double speed = 2.0;
           const double speed = 2.0;
           if(axis.norm() != 0)
           if(axis.norm() != 0)
           {
           {
-            q = 
+            q =
               Quaterniond(
               Quaterniond(
                 AngleAxisd(
                 AngleAxisd(
                   M_PI*(mouse_y-down_y)/(double)width*speed/2.0,
                   M_PI*(mouse_y-down_y)/(double)width*speed/2.0,
@@ -615,7 +621,7 @@ void mouse_drag(int mouse_x, int mouse_y)
             q.normalize();
             q.normalize();
           }
           }
         }
         }
-        copy(q.coeffs().data(),q.coeffs().data()+4,s.camera.rotation);
+        s.camera.rotation = q;
         break;
         break;
       }
       }
       default:
       default:
@@ -688,7 +694,7 @@ void key(unsigned char key, int mouse_x, int mouse_y)
       }else
       }else
       {
       {
         push_undo();
         push_undo();
-        igl::snap_to_canonical_view_quat<double>(
+        igl::snap_to_canonical_view_quat(
           s.camera.rotation,
           s.camera.rotation,
           1.0,
           1.0,
           s.camera.rotation);
           s.camera.rotation);
@@ -708,11 +714,11 @@ void TW_CALL set_rotation_type(const void * value, void * clientData)
   using namespace igl;
   using namespace igl;
   const RotationType old_rotation_type = rotation_type;
   const RotationType old_rotation_type = rotation_type;
   rotation_type = *(const RotationType *)(value);
   rotation_type = *(const RotationType *)(value);
-  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP && 
+  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP &&
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
   {
   {
     push_undo();
     push_undo();
-    copy(s.camera.rotation,s.camera.rotation+4,animation_from_quat.coeffs().data());
+    animation_from_quat = s.camera.rotation;
     const Vector3d up = animation_from_quat.matrix() * Vector3d(0,1,0);
     const Vector3d up = animation_from_quat.matrix() * Vector3d(0,1,0);
     Vector3d proj_up(0,up(1),up(2));
     Vector3d proj_up(0,up(1),up(2));
     if(proj_up.norm() == 0)
     if(proj_up.norm() == 0)
@@ -808,7 +814,7 @@ int main(int argc, char * argv[])
       {
       {
         return 1;
         return 1;
       }
       }
-      triangulate(vF,mesh.F);
+      polygon_mesh_to_triangle_mesh(vF,mesh.F);
     }
     }
     init_mesh(mesh);
     init_mesh(mesh);
   }
   }
@@ -825,7 +831,7 @@ int main(int argc, char * argv[])
   rebar.TwNewBar("bar");
   rebar.TwNewBar("bar");
   TwDefine("bar label='Shadow Mapping' size='200 550' text=light alpha='200' color='68 68 68'");
   TwDefine("bar label='Shadow Mapping' size='200 550' text=light alpha='200' color='68 68 68'");
   rebar.TwAddVarRW("camera_zoom", TW_TYPE_DOUBLE,&s.camera.zoom,"");
   rebar.TwAddVarRW("camera_zoom", TW_TYPE_DOUBLE,&s.camera.zoom,"");
-  rebar.TwAddVarRW("camera_rotation", TW_TYPE_QUAT4D,s.camera.rotation,"");
+  rebar.TwAddVarRW("camera_rotation", TW_TYPE_QUAT4D,s.camera.rotation.coeffs().data(),"");
   TwType RotationTypeTW = ReTwDefineEnumFromString("RotationType","igl_trackball,two_axis_fixed_up");
   TwType RotationTypeTW = ReTwDefineEnumFromString("RotationType","igl_trackball,two_axis_fixed_up");
   rebar.TwAddVarCB( "rotation_type", RotationTypeTW,
   rebar.TwAddVarCB( "rotation_type", RotationTypeTW,
     set_rotation_type,get_rotation_type,NULL,"keyIncr=] keyDecr=[");
     set_rotation_type,get_rotation_type,NULL,"keyIncr=] keyDecr=[");
@@ -834,7 +840,7 @@ int main(int argc, char * argv[])
   rebar.load(REBAR_NAME);
   rebar.load(REBAR_NAME);
 
 
   animation_from_quat = Quaterniond(1,0,0,0);
   animation_from_quat = Quaterniond(1,0,0,0);
-  copy(s.camera.rotation,s.camera.rotation+4,animation_to_quat.coeffs().data());
+  animation_from_quat = s.camera.rotation;
   animation_start_time = get_seconds();
   animation_start_time = get_seconds();
 
 
   // Init antweakbar
   // Init antweakbar

+ 1 - 1
examples/skeleton/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: obj example
 all: obj example
 
 

+ 9 - 9
examples/skeleton/example.cpp

@@ -7,7 +7,7 @@
 #include <igl/writeOFF.h>
 #include <igl/writeOFF.h>
 #include <igl/readWRL.h>
 #include <igl/readWRL.h>
 #include <igl/report_gl_error.h>
 #include <igl/report_gl_error.h>
-#include <igl/triangulate.h>
+#include <igl/polygon_mesh_to_triangle_mesh.h>
 #include <igl/readOFF.h>
 #include <igl/readOFF.h>
 #include <igl/readMESH.h>
 #include <igl/readMESH.h>
 #include <igl/draw_mesh.h>
 #include <igl/draw_mesh.h>
@@ -112,7 +112,7 @@ void TW_CALL set_rotation_type(const void * value, void * clientData)
   using namespace igl;
   using namespace igl;
   const RotationType old_rotation_type = rotation_type;
   const RotationType old_rotation_type = rotation_type;
   rotation_type = *(const RotationType *)(value);
   rotation_type = *(const RotationType *)(value);
-  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP && 
+  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP &&
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
   {
   {
     push_undo();
     push_undo();
@@ -273,7 +273,7 @@ void display()
     T.block(e*(dim+1),0,dim+1,dim) =
     T.block(e*(dim+1),0,dim+1,dim) =
       a.matrix().transpose().block(0,0,dim+1,dim);
       a.matrix().transpose().block(0,0,dim+1,dim);
   }
   }
-  
+
   if(wireframe)
   if(wireframe)
   {
   {
     glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
     glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
@@ -434,7 +434,7 @@ void mouse_drag(int mouse_x, int mouse_y)
       }
       }
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       {
       {
-        // Rotate according to two axis valuator with fixed up vector 
+        // Rotate according to two axis valuator with fixed up vector
         two_axis_valuator_fixed_up(
         two_axis_valuator_fixed_up(
           width, height,
           width, height,
           2.0,
           2.0,
@@ -524,7 +524,7 @@ void key(unsigned char key, int mouse_x, int mouse_y)
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
       }
       }
   }
   }
-  
+
 }
 }
 
 
 bool init_weights(
 bool init_weights(
@@ -554,7 +554,7 @@ bool init_weights(
     return false;
     return false;
   }
   }
 
 
-  // compute BBW 
+  // compute BBW
   // Default bbw data and flags
   // Default bbw data and flags
   BBWData bbw_data;
   BBWData bbw_data;
   bbw_data.active_set_params.max_iter = 4;
   bbw_data.active_set_params.max_iter = 4;
@@ -632,7 +632,7 @@ int main(int argc, char * argv[])
   //  }
   //  }
   //  //if(F.size() > T.size() || F.size() == 0)
   //  //if(F.size() > T.size() || F.size() == 0)
   //  {
   //  {
-  //    boundary_faces(T,F);
+  //    boundary_facets(T,F);
   //  }
   //  }
   }
   }
   if(vV.size() > 0)
   if(vV.size() > 0)
@@ -641,7 +641,7 @@ int main(int argc, char * argv[])
     {
     {
       return 1;
       return 1;
     }
     }
-    triangulate(vF,F);
+    polygon_mesh_to_triangle_mesh(vF,F);
   }
   }
 
 
   readTGF(skel_filename,C,BE);
   readTGF(skel_filename,C,BE);
@@ -674,7 +674,7 @@ int main(int argc, char * argv[])
   }
   }
   // Create a tweak bar
   // Create a tweak bar
   rebar.TwNewBar("TweakBar");
   rebar.TwNewBar("TweakBar");
-  rebar.TwAddVarRW("camera_rotation", TW_TYPE_QUAT4D, 
+  rebar.TwAddVarRW("camera_rotation", TW_TYPE_QUAT4D,
     s.camera.m_rotation_conj.coeffs().data(), "open readonly=true");
     s.camera.m_rotation_conj.coeffs().data(), "open readonly=true");
   TwType RotationTypeTW = ReTwDefineEnumFromString("RotationType",
   TwType RotationTypeTW = ReTwDefineEnumFromString("RotationType",
     "igl_trackball,two-a...-fixed-up");
     "igl_trackball,two-a...-fixed-up");

+ 3 - 3
examples/slice/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 
@@ -11,8 +11,8 @@ all: example
 igl_lib=../../
 igl_lib=../../
 eigen=-I$(DEFAULT_PREFIX)/include/eigen3 -I$(DEFAULT_PREFIX)/include/eigen3/unsupported
 eigen=-I$(DEFAULT_PREFIX)/include/eigen3 -I$(DEFAULT_PREFIX)/include/eigen3/unsupported
 
 
-#CFLAGS=-g
-CFLAGS=-Os -DNDEBUG
+#CFLAGS+=-g
+CFLAGS+=-Os -DNDEBUG
 inc=-I$(igl_lib)/include $(eigen)
 inc=-I$(igl_lib)/include $(eigen)
 lib=-L$(igl_lib)/lib -ligl
 lib=-L$(igl_lib)/lib -ligl
 
 

+ 2 - 2
examples/sort/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 
@@ -11,7 +11,7 @@ all: example
 igl_lib=../../
 igl_lib=../../
 eigen=$(DEFAULT_PREFIX)/include/eigen3/
 eigen=$(DEFAULT_PREFIX)/include/eigen3/
 
 
-CFLAGS=-g
+CFLAGS+=-g
 inc=-I$(igl_lib)/include -I$(eigen)
 inc=-I$(igl_lib)/include -I$(eigen)
 lib=-L$(igl_lib)/lib -ligl
 lib=-L$(igl_lib)/lib -ligl
 
 

+ 2 - 2
examples/sortrows/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 
@@ -11,7 +11,7 @@ all: example
 igl_lib=../../
 igl_lib=../../
 eigen=$(DEFAULT_PREFIX)/include/eigen3/
 eigen=$(DEFAULT_PREFIX)/include/eigen3/
 
 
-CFLAGS=-g
+CFLAGS+=-g
 inc=-I$(igl_lib)/include -I$(eigen)
 inc=-I$(igl_lib)/include -I$(eigen)
 lib=-L$(igl_lib)/lib -ligl
 lib=-L$(igl_lib)/lib -ligl
 
 

+ 2 - 2
examples/stdin_to_temp/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 
@@ -10,7 +10,7 @@ all: example
 
 
 igl_lib=../../
 igl_lib=../../
 
 
-CFLAGS=-g
+CFLAGS+=-g
 inc=-I$(igl_lib)/include
 inc=-I$(igl_lib)/include
 lib=-L$(igl_lib)/lib -ligl
 lib=-L$(igl_lib)/lib -ligl
 
 

+ 2 - 2
examples/svd/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 
@@ -10,7 +10,7 @@ all: example
 
 
 igl_lib=../../
 igl_lib=../../
 
 
-CFLAGS=-g
+CFLAGS+=-g
 inc=-I$(igl_lib)/include
 inc=-I$(igl_lib)/include
 lib=-L$(igl_lib)/lib -ligl -framework Accelerate
 lib=-L$(igl_lib)/lib -ligl -framework Accelerate
 
 

+ 2 - 2
examples/textured-mesh/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 
@@ -23,7 +23,7 @@ EMBREE_LIB=-L$(EMBREE)/build -lembree -lsys
 
 
 # YIMAGE Library
 # YIMAGE Library
 YIMG=$(LIBIGL)/external/yimg/
 YIMG=$(LIBIGL)/external/yimg/
-YIMG_LIB=-L$(YIMG) -lyimg -lz -L/usr/X11/lib -lpng -bind_at_load
+YIMG_LIB=-L$(YIMG) -lyimg -lz -L/opt/local/lib -lpng -bind_at_load
 YIMG_INC=-I/usr/X11/include -I$(YIMG) 
 YIMG_INC=-I/usr/X11/include -I$(YIMG) 
 
 
 ANTTWEAKBAR_INC=-I$(LIBIGL)/external/AntTweakBar/include
 ANTTWEAKBAR_INC=-I$(LIBIGL)/external/AntTweakBar/include

+ 6 - 6
examples/textured-mesh/example.cpp

@@ -17,7 +17,7 @@
 #include <igl/list_to_matrix.h>
 #include <igl/list_to_matrix.h>
 #include <igl/snap_to_canonical_view_quat.h>
 #include <igl/snap_to_canonical_view_quat.h>
 #include <igl/snap_to_fixed_up.h>
 #include <igl/snap_to_fixed_up.h>
-#include <igl/triangulate.h>
+#include <igl/polygon_mesh_to_triangle_mesh.h>
 #include <igl/material_colors.h>
 #include <igl/material_colors.h>
 #include <igl/barycenter.h>
 #include <igl/barycenter.h>
 #include <igl/matlab_format.h>
 #include <igl/matlab_format.h>
@@ -101,7 +101,7 @@ void TW_CALL set_rotation_type(const void * value, void * clientData)
   using namespace igl;
   using namespace igl;
   const RotationType old_rotation_type = rotation_type;
   const RotationType old_rotation_type = rotation_type;
   rotation_type = *(const RotationType *)(value);
   rotation_type = *(const RotationType *)(value);
-  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP && 
+  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP &&
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
   {
   {
     push_undo();
     push_undo();
@@ -457,7 +457,7 @@ void mouse_drag(int mouse_x, int mouse_y)
       }
       }
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       {
       {
-        // Rotate according to two axis valuator with fixed up vector 
+        // Rotate according to two axis valuator with fixed up vector
         two_axis_valuator_fixed_up(
         two_axis_valuator_fixed_up(
           width, height,
           width, height,
           2.0,
           2.0,
@@ -494,7 +494,7 @@ void key(unsigned char key, int mouse_x, int mouse_y)
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
       }
       }
   }
   }
-  
+
   glutPostRedisplay();
   glutPostRedisplay();
 }
 }
 
 
@@ -532,7 +532,7 @@ int main(int argc, char * argv[])
       cerr<<"Bad V"<<endl;
       cerr<<"Bad V"<<endl;
       return 1;
       return 1;
     }
     }
-    triangulate(vF,F);
+    polygon_mesh_to_triangle_mesh(vF,F);
   }
   }
   if(vTC.size() > 0)
   if(vTC.size() > 0)
   {
   {
@@ -577,7 +577,7 @@ int main(int argc, char * argv[])
   }
   }
   // Create a tweak bar
   // Create a tweak bar
   rebar.TwNewBar("TweakBar");
   rebar.TwNewBar("TweakBar");
-  rebar.TwAddVarRW("camera_rotation", TW_TYPE_QUAT4D, 
+  rebar.TwAddVarRW("camera_rotation", TW_TYPE_QUAT4D,
     s.camera.m_rotation_conj.coeffs().data(), "open readonly=true");
     s.camera.m_rotation_conj.coeffs().data(), "open readonly=true");
   s.camera.push_away(3);
   s.camera.push_away(3);
   s.camera.dolly_zoom(25-s.camera.m_angle);
   s.camera.dolly_zoom(25-s.camera.m_angle);

+ 2 - 2
examples/trackball/Makefile

@@ -4,13 +4,13 @@
 all: example
 all: example
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 .PHONY: example
 .PHONY: example
 
 
 igl_lib=../../
 igl_lib=../../
 
 
-CFLAGS=-g -Wall 
+CFLAGS+=-g -Wall 
 #deps=-MMD -MF depends.txt
 #deps=-MMD -MF depends.txt
 EIGEN3_INC=-I$(DEFAULT_PREFIX)/include/eigen3 -I$(DEFAULT_PREFIX)/include/eigen3/unsupported
 EIGEN3_INC=-I$(DEFAULT_PREFIX)/include/eigen3 -I$(DEFAULT_PREFIX)/include/eigen3/unsupported
 inc=-I$(igl_lib)/include $(EIGEN3_INC)
 inc=-I$(igl_lib)/include $(EIGEN3_INC)

+ 1 - 1
examples/transparency/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 

+ 2 - 2
examples/transparency/example.cpp

@@ -1,6 +1,6 @@
 #include <igl/OpenGL_convenience.h>
 #include <igl/OpenGL_convenience.h>
 #include <igl/per_face_normals.h>
 #include <igl/per_face_normals.h>
-#include <igl/read.h>
+#include <igl/read_triangle_mesh.h>
 #include <igl/normalize_row_lengths.h>
 #include <igl/normalize_row_lengths.h>
 #include <igl/draw_mesh.h>
 #include <igl/draw_mesh.h>
 #include <igl/jet.h>
 #include <igl/jet.h>
@@ -303,7 +303,7 @@ int main(int argc, char * argv[])
   {
   {
     filename = argv[1];
     filename = argv[1];
   }
   }
-  if(!read(filename,V,F))
+  if(!read_triangle_mesh(filename,V,F))
   {
   {
     return 1;
     return 1;
   }
   }

+ 2 - 2
examples/transpose_blocks/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 .PHONY: all
 
 
 # Shared flags etc.
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 
 all: example
 all: example
 
 
@@ -11,7 +11,7 @@ all: example
 igl_lib=../../
 igl_lib=../../
 eigen=$(DEFAULT_PREFIX)/include/eigen3
 eigen=$(DEFAULT_PREFIX)/include/eigen3
 
 
-CFLAGS=-g
+CFLAGS+=-g
 inc=-I$(igl_lib)/include -I$(eigen)
 inc=-I$(igl_lib)/include -I$(eigen)
 lib=-L$(igl_lib)/lib -ligl
 lib=-L$(igl_lib)/lib -ligl
 
 

+ 1 - 1
examples/upright/Makefile

@@ -8,7 +8,7 @@ all: upright
 .PHONY: upright
 .PHONY: upright
 
 
 LIBIGL=/usr/local/igl/libigl/
 LIBIGL=/usr/local/igl/libigl/
-include $(LIBIGL)/Makefile.conf
+include $(LIBIGL)/build/Makefile.conf
 LIBIGL_INC=-I$(LIBIGL)/include
 LIBIGL_INC=-I$(LIBIGL)/include
 LIBIGL_LIB=-L$(LIBIGL)/lib -ligl
 LIBIGL_LIB=-L$(LIBIGL)/lib -ligl
 
 

+ 8 - 8
examples/upright/example.cpp

@@ -4,7 +4,7 @@
 // Demonstrates trackball mouse camera control and undo/redo stack with
 // Demonstrates trackball mouse camera control and undo/redo stack with
 // immutable state object (i.e. not with reverse operations).
 // immutable state object (i.e. not with reverse operations).
 //
 //
-// Reads (V,F) from .obj,.off,.wrl files and saves (V,F) to .obj,.off. Any 
+// Reads (V,F) from .obj,.off,.wrl files and saves (V,F) to .obj,.off. Any
 // normals, texture coordinates, etc. in the input file will be ignored and
 // normals, texture coordinates, etc. in the input file will be ignored and
 // lost in the output file.
 // lost in the output file.
 //
 //
@@ -12,7 +12,7 @@
 #include <igl/writeOBJ.h>
 #include <igl/writeOBJ.h>
 #include <igl/writeOFF.h>
 #include <igl/writeOFF.h>
 #include <igl/readWRL.h>
 #include <igl/readWRL.h>
-#include <igl/triangulate.h>
+#include <igl/polygon_mesh_to_triangle_mesh.h>
 #include <igl/readOFF.h>
 #include <igl/readOFF.h>
 #include <igl/readMESH.h>
 #include <igl/readMESH.h>
 #include <igl/draw_mesh.h>
 #include <igl/draw_mesh.h>
@@ -184,7 +184,7 @@ void display()
   glMaterialfv(GL_BACK, GL_SPECULAR, SILVER_SPECULAR);
   glMaterialfv(GL_BACK, GL_SPECULAR, SILVER_SPECULAR);
   glMaterialf (GL_BACK, GL_SHININESS, 128);
   glMaterialf (GL_BACK, GL_SHININESS, 128);
 
 
-  
+
   draw_mesh(s.V,s.F,s.N);
   draw_mesh(s.V,s.F,s.N);
 
 
   glDisable(GL_LIGHTING);
   glDisable(GL_LIGHTING);
@@ -281,7 +281,7 @@ void bake()
   s.V.col(0).array() -= s.Vmid(0);
   s.V.col(0).array() -= s.Vmid(0);
   s.V.col(1).array() -= s.Vmid(1);
   s.V.col(1).array() -= s.Vmid(1);
   s.V.col(2).array() -= s.Vmid(2);
   s.V.col(2).array() -= s.Vmid(2);
-  s.V *= 2./s.bbd; 
+  s.V *= 2./s.bbd;
   s.V = (s.V * s.rot.matrix().transpose()).eval();
   s.V = (s.V * s.rot.matrix().transpose()).eval();
 }
 }
 
 
@@ -339,7 +339,7 @@ bool save()
   //  }
   //  }
   //  //if(F.size() > T.size() || F.size() == 0)
   //  //if(F.size() > T.size() || F.size() == 0)
   //  {
   //  {
-  //    boundary_faces(T,F);
+  //    boundary_facets(T,F);
   //  }
   //  }
   }
   }
   cout<<GREENGIN("Current baked model written to "+out_filename+".")<<endl;
   cout<<GREENGIN("Current baked model written to "+out_filename+".")<<endl;
@@ -433,7 +433,7 @@ void key(unsigned char key, int mouse_x, int mouse_y)
     default:
     default:
       cout<<"Unknown key command: '"<<key<<"' ("<<int(key)<<")"<<endl;
       cout<<"Unknown key command: '"<<key<<"' ("<<int(key)<<")"<<endl;
   }
   }
-  
+
   glutPostRedisplay();
   glutPostRedisplay();
 }
 }
 
 
@@ -502,7 +502,7 @@ int main(int argc, char * argv[])
   //  }
   //  }
   //  //if(F.size() > T.size() || F.size() == 0)
   //  //if(F.size() > T.size() || F.size() == 0)
   //  {
   //  {
-  //    boundary_faces(T,F);
+  //    boundary_facets(T,F);
   //  }
   //  }
   }
   }
   if(vV.size() > 0)
   if(vV.size() > 0)
@@ -511,7 +511,7 @@ int main(int argc, char * argv[])
     {
     {
       return 1;
       return 1;
     }
     }
-    triangulate(vF,s.F);
+    polygon_mesh_to_triangle_mesh(vF,s.F);
   }
   }
 
 
   init_relative();
   init_relative();

+ 1 - 1
include/igl/EPS.cpp

@@ -25,6 +25,6 @@ template <> IGL_INLINE double igl::EPS_SQ()
   return igl::DOUBLE_EPS_SQ;
   return igl::DOUBLE_EPS_SQ;
 }
 }
 
 
-#ifndef IGL_HEADER_ONLY
+#ifdef IGL_STATIC_LIBRARY
 // Explicit template specialization
 // Explicit template specialization
 #endif
 #endif

+ 1 - 1
include/igl/EPS.h

@@ -25,7 +25,7 @@ namespace igl
   template <> IGL_INLINE double EPS_SQ<double>();
   template <> IGL_INLINE double EPS_SQ<double>();
 }
 }
 
 
-#ifdef IGL_HEADER_ONLY
+#ifndef IGL_STATIC_LIBRARY
 #  include "EPS.cpp"
 #  include "EPS.cpp"
 #endif
 #endif
 
 

+ 6 - 5
include/igl/pos.h → include/igl/HalfEdgeIterator.h

@@ -6,8 +6,8 @@
 // v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 
 
-#ifndef IGL_POS_H
-#define IGL_POS_H
+#ifndef IGL_HALFEDGEITERATOR_H
+#define IGL_HALFEDGEITERATOR_H
 
 
 #include <Eigen/Core>
 #include <Eigen/Core>
 
 
@@ -15,13 +15,14 @@
 
 
 namespace igl
 namespace igl
 {
 {
-  // Pos - Fake halfedge for fast and easy navigation on triangle meshes with VT and TT adjacency
+  // HalfEdgeIterator - Fake halfedge for fast and easy navigation on triangle meshes with vertex_triangle_adjacency and
+  // triangle_triangle adjacency
   template <typename DerivedF>
   template <typename DerivedF>
   class Pos
   class Pos
   {
   {
   public:
   public:
-    // Init the pos by specifying Face,Edge Index and Orientation
-    IGL_INLINE Pos(
+    // Init the HalfEdgeIterator by specifying Face,Edge Index and Orientation
+    IGL_INLINE HalfEdgeIterator(
         const Eigen::PlainObjectBase<DerivedF>* F,
         const Eigen::PlainObjectBase<DerivedF>* F,
         const Eigen::PlainObjectBase<DerivedF>* FF,
         const Eigen::PlainObjectBase<DerivedF>* FF,
         const Eigen::PlainObjectBase<DerivedF>* FFi,
         const Eigen::PlainObjectBase<DerivedF>* FFi,

+ 6 - 6
include/igl/IO

@@ -1,14 +1,14 @@
 // This file is part of libigl, a simple c++ geometry processing library.
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
 // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #ifndef IGL_IO
 #ifndef IGL_IO
 #define IGL_IO
 #define IGL_IO
 // Input and output functions
 // Input and output functions
-#include "read.h"
+#include "read_triangle_mesh.h"
 #include "readDMAT.h"
 #include "readDMAT.h"
 #include "readMESH.h"
 #include "readMESH.h"
 #include "readNODE.h"
 #include "readNODE.h"
@@ -18,7 +18,7 @@
 #include "readWRL.h"
 #include "readWRL.h"
 #include "readCSV.h"
 #include "readCSV.h"
 #include "file_contents_as_string.h"
 #include "file_contents_as_string.h"
-#include "write.h"
+#include "write_triangle_mesh.h"
 #include "writeDMAT.h"
 #include "writeDMAT.h"
 #include "writeMESH.h"
 #include "writeMESH.h"
 #include "writeOBJ.h"
 #include "writeOBJ.h"

+ 1 - 1
include/igl/ReAntTweakBar.h

@@ -275,7 +275,7 @@ namespace igl
 //TW_API int      TW_CALL TwRemoveVar(TwBar *bar, const char *name);
 //TW_API int      TW_CALL TwRemoveVar(TwBar *bar, const char *name);
 //TW_API int      TW_CALL TwRemoveAllVars(TwBar *bar);
 //TW_API int      TW_CALL TwRemoveAllVars(TwBar *bar);
 
 
-#ifdef IGL_HEADER_ONLY
+#ifndef IGL_STATIC_LIBRARY
 #  include "ReAntTweakBar.cpp"
 #  include "ReAntTweakBar.cpp"
 #endif
 #endif
 
 

+ 1 - 1
include/igl/WindingNumberTree.h

@@ -140,7 +140,7 @@ inline igl::WindingNumberTree<Point>::WindingNumberTree(
   V(dummyV),
   V(dummyV),
   SV(),
   SV(),
   F(),
   F(),
-  //boundary(igl::boundary_faces<Eigen::MatrixXi,Eigen::MatrixXi>(F))
+  //boundary(igl::boundary_facets<Eigen::MatrixXi,Eigen::MatrixXi>(F))
   cap(),
   cap(),
   radius(std::numeric_limits<double>::infinity()),
   radius(std::numeric_limits<double>::infinity()),
   center(0,0,0)
   center(0,0,0)

+ 2 - 2
include/igl/active_set.cpp

@@ -297,7 +297,7 @@ IGL_INLINE igl::SolverStatus igl::active_set(
     slice(A,known_i,1,Ak);
     slice(A,known_i,1,Ak);
     Eigen::PlainObjectBase<DerivedB> Bk;
     Eigen::PlainObjectBase<DerivedB> Bk;
     slice(B,known_i,Bk);
     slice(B,known_i,Bk);
-    MatrixXd Lambda_known_i = -(Ak*Z + 0.5*Bk);
+    MatrixXd Lambda_known_i = -(0.5*Ak*Z + 0.5*Bk);
     // reverse the lambda values for lx
     // reverse the lambda values for lx
     Lambda_known_i.block(nk,0,as_lx_count,1) = 
     Lambda_known_i.block(nk,0,as_lx_count,1) = 
       (-1*Lambda_known_i.block(nk,0,as_lx_count,1)).eval();
       (-1*Lambda_known_i.block(nk,0,as_lx_count,1)).eval();
@@ -347,7 +347,7 @@ IGL_INLINE igl::SolverStatus igl::active_set(
 }
 }
 
 
 
 
-#ifndef IGL_HEADER_ONLY
+#ifdef IGL_STATIC_LIBRARY
 // Explicit template specialization
 // Explicit template specialization
 template igl::SolverStatus igl::active_set<double, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, double, Eigen::Matrix<double, -1, 1, 0, -1, 1>, double, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::SparseMatrix<double, 0, int> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::SparseMatrix<double, 0, int> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::SparseMatrix<double, 0, int> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, igl::active_set_params const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
 template igl::SolverStatus igl::active_set<double, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, double, Eigen::Matrix<double, -1, 1, 0, -1, 1>, double, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::SparseMatrix<double, 0, int> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::SparseMatrix<double, 0, int> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::SparseMatrix<double, 0, int> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, igl::active_set_params const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
 #endif
 #endif

+ 5 - 2
include/igl/active_set.h

@@ -20,7 +20,10 @@ namespace igl
   // using QR decomposition otherwise:
   // using QR decomposition otherwise:
   //   http://www.okstate.edu/sas/v8/sashtml/ormp/chap5/sect32.htm
   //   http://www.okstate.edu/sas/v8/sashtml/ormp/chap5/sect32.htm
   //
   //
-  // ACTIVE_SET Minimize quadratic energy Z'*A*Z + Z'*B + C with constraints
+  // ACTIVE_SET Minimize quadratic energy 
+  //
+  // 0.5*Z'*A*Z + Z'*B + C with constraints
+  //
   // that Z(known) = Y, optionally also subject to the constraints Aeq*Z = Beq,
   // that Z(known) = Y, optionally also subject to the constraints Aeq*Z = Beq,
   // and further optionally subject to the linear inequality constraints that
   // and further optionally subject to the linear inequality constraints that
   // Aieq*Z <= Bieq and constant inequality constraints lx <= x <= ux
   // Aieq*Z <= Bieq and constant inequality constraints lx <= x <= ux
@@ -103,7 +106,7 @@ struct igl::active_set_params
     {};
     {};
 };
 };
 
 
-#ifdef IGL_HEADER_ONLY
+#ifndef IGL_STATIC_LIBRARY
 #  include "active_set.cpp"
 #  include "active_set.cpp"
 #endif
 #endif
 
 

+ 1 - 1
include/igl/adjacency_list.cpp

@@ -158,7 +158,7 @@ IGL_INLINE void igl::adjacency_list(
   
   
 }
 }
 
 
-#ifndef IGL_HEADER_ONLY
+#ifdef IGL_STATIC_LIBRARY
 // Explicit template specialization
 // Explicit template specialization
 // generated by autoexplicit.sh
 // generated by autoexplicit.sh
 template void igl::adjacency_list<Eigen::Matrix<int, -1, -1, 0, -1, -1>, int>(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, bool);
 template void igl::adjacency_list<Eigen::Matrix<int, -1, -1, 0, -1, -1>, int>(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, bool);

+ 1 - 1
include/igl/adjacency_list.h

@@ -44,7 +44,7 @@ namespace igl
 
 
 }
 }
 
 
-#ifdef IGL_HEADER_ONLY
+#ifndef IGL_STATIC_LIBRARY
 #  include "adjacency_list.cpp"
 #  include "adjacency_list.cpp"
 #endif
 #endif
 
 

+ 1 - 1
include/igl/adjacency_matrix.cpp

@@ -63,7 +63,7 @@ IGL_INLINE void igl::adjacency_matrix(
   }
   }
 }
 }
 
 
-#ifndef IGL_HEADER_ONLY
+#ifdef IGL_STATIC_LIBRARY
 // Explicit template specialization
 // Explicit template specialization
 template void igl::adjacency_matrix<int>(Eigen::Matrix<int, -1, -1, 0, -1, -1> const&, Eigen::SparseMatrix<int, 0, int>&);
 template void igl::adjacency_matrix<int>(Eigen::Matrix<int, -1, -1, 0, -1, -1> const&, Eigen::SparseMatrix<int, 0, int>&);
 template void igl::adjacency_matrix<double>(Eigen::Matrix<int, -1, -1, 0, -1, -1> const&, Eigen::SparseMatrix<double, 0, int>&);
 template void igl::adjacency_matrix<double>(Eigen::Matrix<int, -1, -1, 0, -1, -1> const&, Eigen::SparseMatrix<double, 0, int>&);

+ 1 - 1
include/igl/adjacency_matrix.h

@@ -44,7 +44,7 @@ namespace igl
     Eigen::SparseMatrix<T>& A);
     Eigen::SparseMatrix<T>& A);
 }
 }
 
 
-#ifdef IGL_HEADER_ONLY
+#ifndef IGL_STATIC_LIBRARY
 #  include "adjacency_matrix.cpp"
 #  include "adjacency_matrix.cpp"
 #endif
 #endif
 
 

+ 1 - 1
include/igl/all_edges.h

@@ -27,7 +27,7 @@ namespace igl
     Eigen::MatrixXi & E);
     Eigen::MatrixXi & E);
 }
 }
 
 
-#ifdef IGL_HEADER_ONLY
+#ifndef IGL_STATIC_LIBRARY
 #  include "all_edges.cpp"
 #  include "all_edges.cpp"
 #endif
 #endif
 
 

Some files were not shown because too many files changed in this diff