Browse Source

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 years ago
parent
commit
1c8bb1d656
100 changed files with 496 additions and 432 deletions
  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.
+scripts/change_name.sh
 syntax: glob
 *.o
 *.a

+ 63 - 9
README.md

@@ -35,7 +35,7 @@ listed below.
 - TetGen  libigltetgen extra only
 - Embree  libiglembree extra only
 - tinyxml2  libiglxml extra only
- 
+
 ## Header only ##
 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/
@@ -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.
 
 ### Linux/Mac OS X/Cygwin ###
-  
+
 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
 compile times.
 
 To build the entire libigl library producing lib/libigl.a, issue:
-  
+
+    cd build
     make lib
-  
+
 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
 appropriate extras.
-  
+
 #### Extras ####
 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,
 lib/libigltetgen.a, lib/libiglmosek.a, etc.) by issuing:
-  
+
+    cd build
     make extras
-  
+
 #### Examples ####
 You can make a slew of examples by issuing:
-  
+
+    cd build
     make examples
-  
+
 #### External ####
 Finally there are a number of external libraries that we include in
 ./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/
 
+## 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 ##
 Further documentation for developers is listed in tutorial.html,
 style_guidelines.html

+ 27 - 39
Makefile → build/Makefile

@@ -16,76 +16,64 @@ CFLAGS += $(OPTFLAGS)
 #CFLAGS += -DIGL_NO_OPENGL -DIGL_NO_ANTTWEAKBAR
 # We use well-supported features of c++11
 
-EXTRA_DIRS=
+EXTRAS=
 ifeq ($(IGL_WITH_BBW),1)
-	EXTRA_DIRS+=include/igl/bbw
 	EXTRAS += bbw
 endif
 ifeq ($(IGL_WITH_BOOST),1)
-	EXTRA_DIRS+=include/igl/boost
 	EXTRAS += boost
 endif
 ifeq ($(IGL_WITH_CGAL),1)
-	EXTRA_DIRS+=include/igl/cgal
 	EXTRAS += cgal
 endif
 ifeq ($(IGL_WITH_EMBREE),1)
-	EXTRA_DIRS+=include/igl/embree
 	EXTRAS += embree
 endif
 ifeq ($(IGL_WITH_MATLAB),1)
-	EXTRA_DIRS+=include/igl/matlab
 	EXTRAS += matlab
 endif
 ifeq ($(IGL_WITH_MOSEK),1)
-	EXTRA_DIRS+=include/igl/mosek
 	EXTRAS += mosek
 endif
 ifeq ($(IGL_WITH_PNG),1)
-	EXTRA_DIRS+=include/igl/png
 	EXTRAS += png
 endif
 ifeq ($(IGL_WITH_SVD3X3),1)
-	EXTRA_DIRS+=include/igl/svd3x3
 	EXTRAS += svd3x3
 endif
 ifeq ($(IGL_WITH_TETGEN),1)
 	# append tetgen extra dir
-	EXTRA_DIRS+=include/igl/tetgen
 	EXTRAS += tetgen
 endif
 ifeq ($(IGL_WITH_VIEWER),1)
-	EXTRA_DIRS+=include/igl/viewer
 	EXTRAS += viewer
 endif
 ifeq ($(IGL_WITH_XML),1)
-	EXTRA_DIRS+=include/igl/xml
 	EXTRAS += xml
 endif
 
 .PHONY: examples
 .PHONY: extras
 debug: lib extras
-lib: lib/libigl.a
+lib: ../lib/libigl.a
 examples: lib extras
-	make -C examples
+	make -C ../examples
 extras:
-	for p in  $(EXTRA_DIRS); \
+	for p in  $(EXTRAS); \
 	do \
-	echo "cd $$p" ; \
-	$(MAKE) -C $$p $(DEBUG); \
+	$(MAKE) -f Makefile_$$p $(DEBUG); \
 	done
 
 
 #############################################################################
 # 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)))
 
 # include igl headers
-INC+=-Iinclude/
+INC+=-I../include/
 
 #############################################################################
 # DEPENDENCIES
@@ -100,7 +88,7 @@ INC+=$(EIGEN3_INC)
 
 # AntTweakBar dependency
 #ANTTWEAKBAR_INC=-I$(DEFAULT_PREFIX)/include
-ANTTWEAKBAR_INC=-Iexternal/AntTweakBar/include
+ANTTWEAKBAR_INC=-I../external/AntTweakBar/include
 INC+=$(ANTTWEAKBAR_INC)
 
 ## OpenGL dependency
@@ -112,34 +100,34 @@ INC+=$(ANTTWEAKBAR_INC)
 obj: 
 	mkdir -p obj
 
-lib/libigl.a: obj $(OBJ_FILES)
+../lib/libigl.a: obj $(OBJ_FILES)
 	mkdir -p lib
 	rm -f $@
 	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)
 
-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:
-	rm -rf lib/igl.framework/
+	rm -rf ../lib/igl.framework/
 	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); \
 	do \
 	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.7       19.9s
 
+CFLAGS += -DIGL_STATIC_LIBRARY
 CFLAGS += -Wall
 CFLAGS += -std=c++11
 

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

@@ -1,22 +1,21 @@
-include ../../../Makefile.conf
-
 .PHONY: all
 all: libiglbbw
 debug: libiglbbw
 
-include ../../../Makefile.conf
+include Makefile.conf
 all: OPTFLAGS += -O3 -DNDEBUG $(OPENMP)
 debug: OPTFLAGS += -g -Wall
 CFLAGS += $(OPTFLAGS)
 
 .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)))
 
 # include igl headers
-INC+=-I../../../include/
+INC+=-I../include/
 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 
@@ -47,13 +46,13 @@ endif
 obj: 
 	mkdir -p obj
 
-../../../lib/libiglbbw.a: $(OBJ_FILES)
+../lib/libiglbbw.a: $(OBJ_FILES)
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 
-obj/%.o: %.cpp %.h
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
 	$(GG) $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 
 clean:
 	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
 all: libiglboost
 debug: libiglboost
 
-include ../../../Makefile.conf
+include Makefile.conf
 all: CFLAGS += -O3 -DNDEBUG
 debug: CFLAGS += -g -Wall 
 
 .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)))
 
 # include igl headers
-INC+=-I../../../include/
+INC+=-I../include/
 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 
@@ -31,13 +32,13 @@ INC+=$(BOOST_INC)
 obj: 
 	mkdir -p obj
 
-../../../lib/libiglboost.a: $(OBJ_FILES)
+../lib/libiglboost.a: $(OBJ_FILES)
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 
-obj/%.o: %.cpp %.h
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
 	g++ $(AFLAGS) $(OPENMP) $(CFLAGS) -c -o $@ $< $(INC)
 
 clean:
 	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
 debug: libiglcgal
 
-include ../../../Makefile.conf
+include Makefile.conf
 all: CFLAGS += -O3 -DNDEBUG 
 debug: CFLAGS += -g -Wall -Werror
 
 .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)))
 
 # include igl headers
-INC+=-I../../../include/
+INC+=-I../include/
 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 
@@ -32,13 +33,13 @@ INC+=$(CGAL_INC)
 obj: 
 	mkdir -p obj
 
-../../../lib/libiglcgal.a: $(OBJ_FILES)
+../lib/libiglcgal.a: $(OBJ_FILES)
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 
-obj/%.o: %.cpp %.h
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
 	g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 
 clean:
 	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
 all: libiglembree
 debug: libiglembree
 
-include ../../../Makefile.conf
+include Makefile.conf
 all: CFLAGS += -O3 -DNDEBUG -std=c++11
 debug: CFLAGS += -g -Wall -std=c++11
 
 .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)))
 
 # include igl headers
-INC+=-I../../../include/
+INC+=-I../include/
 
 # 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)
 
 # embree dependency
-#EMBREE=../../../external/embree
+#EMBREE=../external/embree
 #EMBREE_INC=-I$(EMBREE)/common -I$(EMBREE)/rtcore/
-EMBREE=../../../external/embree/
+EMBREE=../external/embree/
 EMBREE_INC=-I$(EMBREE)/ -I$(EMBREE)/embree
 #EMBREE_LIB=-L$(EMBREE)/bin -lrtcore -lsys
 INC+=$(EMBREE_INC)
@@ -34,13 +35,13 @@ INC+=$(EMBREE_INC)
 obj: 
 	mkdir -p obj
 
-../../../lib/libiglembree.a: $(OBJ_FILES)
+../lib/libiglembree.a: $(OBJ_FILES)
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 
-obj/%.o: %.cpp %.h
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
 	g++ $(AFLAGS) $(OPENMP) $(CFLAGS) -c -o $@ $< $(INC)
 
 clean:
 	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
 debug: CFLAGS += -g -Wall -Werror
 
@@ -7,13 +7,14 @@ all: libiglmatlab
 debug: libiglmatlab
 
 .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)))
 
 # include igl headers
-INC+=-I../../../include/
+INC+=-I../include/
 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 
@@ -33,13 +34,13 @@ INC+=$(MATLAB_INC)
 obj: 
 	mkdir -p obj
 
-../../../lib/libiglmatlab.a: $(OBJ_FILES)
+../lib/libiglmatlab.a: $(OBJ_FILES)
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 
-obj/%.o: %.cpp %.h
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
 	g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 
 clean:
 	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
 all: libiglmosek
 debug: libiglmosek
 
-include ../../../Makefile.conf
+include Makefile.conf
 all: OPTFLAGS += -O3 -DNDEBUG $(OPENMP)
 debug: OPTFLAGS += -g -Wall
 CFLAGS += $(OPTFLAGS)
 
 .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)))
 
 # include igl headers
-INC+=-I../../../include/
+INC+=-I../include/
 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 
@@ -40,13 +41,13 @@ INC+=$(MOSEK_INC)
 obj: 
 	mkdir -p obj
 
-../../../lib/libiglmosek.a: $(OBJ_FILES)
+../lib/libiglmosek.a: $(OBJ_FILES)
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 
-obj/%.o: %.cpp %.h
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
 	g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 
 clean:
 	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 
 debug: CFLAGS += -g -Wall -Werror
 
@@ -7,18 +7,19 @@ all: libiglpng
 debug: libiglpng
 
 .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)))
 
 # include igl headers
-INC+=-I../../../include/
+INC+=-I../include/
 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 
 # YIMG dependency
-YIMG=../../../external/yimg
+YIMG=../external/yimg
 YIMG_INC=-I$(YIMG)
 INC+=$(YIMG_INC)
 YIMG_STATIC_LIB=$(YIMG)/libyimg.a
@@ -29,13 +30,13 @@ INC+=-I/opt/local/include/
 obj: 
 	mkdir -p obj
 
-../../../lib/libiglpng.a: $(OBJ_FILES)
+../lib/libiglpng.a: $(OBJ_FILES)
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 
-obj/%.o: %.cpp %.h
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
 	g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 
 clean:
 	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
 all: libiglsvd3x3
 debug: libiglsvd3x3
 
-include ../../../Makefile.conf
+include Makefile.conf
 all: OPTFLAGS += -O3 -DNDEBUG $(OPENMP)
 debug: OPTFLAGS += -g -Wall
 CFLAGS += $(OPTFLAGS) -std=c++11
 
 .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)))
 
 # include igl headers
-INC+=-I../../../include/
+INC+=-I../include/
 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 
 # SVD 
 SINGULAR_VALUE_DECOMPOSITION_INC=\
-	-I../../../external/Singular_Value_Decomposition/
+	-I../external/Singular_Value_Decomposition/
 # Eigen dependency
 EIGEN3_INC=-I$(DEFAULT_PREFIX)/include/eigen3 -I$(DEFAULT_PREFIX)/include/eigen3/unsupported
 INC+=$(EIGEN3_INC) $(SINGULAR_VALUE_DECOMPOSITION_INC)
@@ -39,13 +40,13 @@ INC+=$(MATLAB_INC)
 obj: 
 	mkdir -p obj
 
-../../../lib/libiglsvd3x3.a: $(OBJ_FILES)
+../lib/libiglsvd3x3.a: $(OBJ_FILES)
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 
-obj/%.o: %.cpp %.h
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
 	$(GG) $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 
 clean:
 	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
 debug: libigltetgen
 
-include ../../../Makefile.conf
+include Makefile.conf
 all: CFLAGS += -O3 -DNDEBUG 
 debug: CFLAGS += -g -Wall -Werror
 
 .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)))
 
 # include igl headers
-INC+=-I../../../include/
+INC+=-I../include/
 
 # 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)
 
 # Tetgen dependency
-TETGEN=../../../external/tetgen
+TETGEN=../external/tetgen
 TETGEN_INC=-I$(TETGEN)
 INC+=$(TETGEN_INC)
 TETGEN_STATIC_LIB=$(TETGEN)/libtet.a
@@ -31,13 +32,13 @@ TETGEN_STATIC_LIB=$(TETGEN)/libtet.a
 obj: 
 	mkdir -p obj
 
-../../../lib/libigltetgen.a: $(OBJ_FILES)
+../lib/libigltetgen.a: $(OBJ_FILES)
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 
-obj/%.o: %.cpp %.h
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
 	g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 
 clean:
 	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
 debug: CFLAGS += -g -Wall -Werror -fopenmp
 
@@ -7,13 +7,14 @@ all: libiglviewer
 debug: libiglviewer
 
 .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)))
 
 # include igl headers
-INC+=-I../../../include/
+INC+=-I../include/
 
 # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY 
 
@@ -23,12 +24,12 @@ INC+=$(EIGEN3_INC)
 
 # GLFW dependency
 ifndef GLFW
-	GLFW=../../../external/glfw/
+	GLFW=../external/glfw/
 endif
 GLFW_INC=-I$(GLFW)/include
 INC+=$(GLFW_INC)
 ifndef ANTTWEAKBAR
-	ANTTWEAKBAR=../../../external/AntTweakBar/
+	ANTTWEAKBAR=../external/AntTweakBar/
 endif
 # Viewer also uses source files from AntTweakBar for font rendering
 ANTTWEAKBAR_INC=-I$(ANTTWEAKBAR)/include -I$(ANTTWEAKBAR)/src
@@ -37,13 +38,13 @@ INC+=$(ANTTWEAKBAR_INC)
 obj: 
 	mkdir -p obj
 
-../../../lib/libiglviewer.a: $(OBJ_FILES)
+../lib/libiglviewer.a: $(OBJ_FILES)
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 
-obj/%.o: %.cpp %.h
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
 	g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 
 clean:
 	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
 all: 
@@ -6,18 +6,19 @@ debug:
 #all: libiglxml
 #debug: libiglxml
 
-include ../../../Makefile.conf
+include Makefile.conf
 all: CFLAGS += -O3 -DNDEBUG
 debug: CFLAGS += -g -Wall
 
 .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)))
 
 # include igl headers
-INC+=-I../../../include/
+INC+=-I../include/
 
 # 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)
 
 #AntTweakbar dependency
-ANTTWEAKBAR_INC=-I../../../external/AntTweakBar/include
+ANTTWEAKBAR_INC=-I../external/AntTweakBar/include
 
 # xml dependency
 # TODO: linux, 32 bit etc
-TINYXML2=../../../external/tinyxml2
+TINYXML2=../external/tinyxml2
 TINYXML2_INC=-I$(TINYXML2)
 #TINYXML2_LIB=-L$(TINYXML2) -ltinyxml2
 INC+=$(TINYXML2_INC) $(ANTTWEAKBAR_INC)
 
 # AntTweakBar dependency
-ANTTWEAKBAR_INC=-I../../../external/AntTweakBar/include
+ANTTWEAKBAR_INC=-I../external/AntTweakBar/include
 INC+=$(ANTTWEAKBAR_INC)
 
 #CFLAGS+=-std=c++11
@@ -44,13 +45,13 @@ INC+=$(ANTTWEAKBAR_INC)
 obj: 
 	mkdir -p obj
 
-../../../lib/libiglxml.a: $(OBJ_FILES)
+../lib/libiglxml.a: $(OBJ_FILES)
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)
 
-obj/%.o: %.cpp %.h
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
 	g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
 
 clean:
 	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
 
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 IGL=../../
 IGL_LIB=-L$(IGL)/lib -ligl

+ 2 - 2
examples/MatlabWorkspace/example.cpp

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

+ 1 - 1
examples/ReAntTweakBar/Makefile

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

+ 2 - 2
examples/affine/Makefile

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

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

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

+ 1 - 1
examples/ambient-occlusion/Makefile

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

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

@@ -13,7 +13,7 @@
 #include <igl/readWRL.h>
 #include <igl/trackball.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/barycenter.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;
       }
   }
-  
+
 }
 
 
@@ -357,7 +357,7 @@ int main(int argc, char * argv[])
   //  }
   //  //if(F.size() > T.size() || F.size() == 0)
   //  {
-  //    boundary_faces(T,F);
+  //    boundary_facets(T,F);
   //  }
   }
   if(vV.size() > 0)
@@ -366,7 +366,7 @@ int main(int argc, char * argv[])
     {
       return 1;
     }
-    triangulate(vF,F);
+    polygon_mesh_to_triangle_mesh(vF,F);
   }
 
   // Compute normals, centroid, colors, bounding box diagonal

+ 1 - 1
examples/arap/Makefile

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

+ 9 - 9
examples/arap/example.cpp

@@ -24,7 +24,7 @@
 #include <igl/list_to_matrix.h>
 #include <igl/snap_to_canonical_view_quat.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/barycenter.h>
 #include <igl/matlab_format.h>
@@ -109,7 +109,7 @@ void TW_CALL set_rotation_type(const void * value, void * clientData)
   using namespace igl;
   const RotationType old_rotation_type = rotation_type;
   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)
   {
     push_undo();
@@ -262,7 +262,7 @@ bool update_arap()
             //Quaterniond q(AngleAxisd(PI/1.5,Vector3d(0,1.0,0.1).normalized()));
             //const Vector3d a = bc.row(bi);
             //bc.row(bi) = (q*(a-t) + t) + Vector3d(1.5,0.1,0.9);
-                
+
 
             break;
           }
@@ -432,8 +432,8 @@ void display()
   const double floor_offset =
     -2./bbd*(V.col(1).maxCoeff()-mid(1));
   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();
@@ -573,7 +573,7 @@ void mouse_drag(int mouse_x, int mouse_y)
       }
       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(
           width, height,
           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;
       }
   }
-  
+
   glutPostRedisplay();
 }
 
@@ -681,7 +681,7 @@ int main(int argc, char * argv[])
       cerr<<"Bad V"<<endl;
       return 1;
     }
-    triangulate(vF,F);
+    polygon_mesh_to_triangle_mesh(vF,F);
   }
   per_face_normals(V,F,N);
 
@@ -705,7 +705,7 @@ int main(int argc, char * argv[])
   }
   // Create a tweak bar
   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.push_away(3);
   s.camera.dolly_zoom(25-s.camera.m_angle);

+ 2 - 2
examples/basic_topology/Makefile

@@ -2,12 +2,12 @@
 all: example1
 
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 igl_lib=../../
 eigen_lib=$(DEFAULT_PREFIX)/include/eigen3/
 
-CFLAGS=-g
+CFLAGS+=-g
 inc=-I$(igl_lib)/include -I$(eigen_lib)
 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.
 
 // 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 <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;
 
@@ -19,7 +19,7 @@ int main (int argc, const char * argv[])
 {
     Eigen::MatrixXd V;
     Eigen::MatrixXi F;
-    igl::read("../shared/TinyTorus.obj",V,F);
+    igl::read_triangle_mesh("../shared/TinyTorus.obj",V,F);
 
     std::cout << "Mesh loaded!\n";
     cout << "Vertex Array:" << endl;
@@ -28,13 +28,13 @@ int main (int argc, const char * argv[])
     cout << "Face Array:" << endl;
     cout << F << endl;
     cout << "-------------" << endl;
-    
-    igl::write("bunny_out.off",V,F);
-    
+
+    igl::write_triangle_mesh("bunny_out.off",V,F);
+
     // Face Topology
     cout << "TT Topology:" << endl;
     Eigen::MatrixXi TT;
-    igl::tt(V,F,TT);
+    igl::triangle_triangle_adjacency(V,F,TT);
     cout << TT << endl;
     cout << "-------------" << endl;
 
@@ -43,12 +43,11 @@ int main (int argc, const char * argv[])
     Eigen::MatrixXi EV;
     Eigen::MatrixXi FE;
     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 << "-------------" << endl;
-    
-    
+
+
     return 0;
 }
-

+ 1 - 1
examples/bbw/Makefile

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

+ 2 - 2
examples/beach-balls/Makefile

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

+ 1 - 1
examples/camera/Makefile

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

+ 1 - 1
examples/camera/example.cpp

@@ -230,7 +230,7 @@ void draw_scene(const igl::Camera & v_camera,
   glMatrixMode(GL_PROJECTION);
   glPushMatrix();
   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);
   }else

+ 2 - 2
examples/cat/Makefile

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

+ 1 - 1
examples/colored-mesh/Makefile

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

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

@@ -17,7 +17,7 @@
 #include <igl/list_to_matrix.h>
 #include <igl/snap_to_canonical_view_quat.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/barycenter.h>
 #include <igl/matlab_format.h>
@@ -96,7 +96,7 @@ void TW_CALL set_rotation_type(const void * value, void * clientData)
   using namespace igl;
   const RotationType old_rotation_type = rotation_type;
   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)
   {
     push_undo();
@@ -406,7 +406,7 @@ void mouse_drag(int mouse_x, int mouse_y)
       }
       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(
           width, height,
           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;
       }
   }
-  
+
   glutPostRedisplay();
 }
 
@@ -530,7 +530,7 @@ int main(int argc, char * argv[])
   //  }
   //  //if(F.size() > T.size() || F.size() == 0)
   //  {
-  //    boundary_faces(T,F);
+  //    boundary_facets(T,F);
   //  }
   }
   if(vV.size() > 0)
@@ -539,7 +539,7 @@ int main(int argc, char * argv[])
     {
       return 1;
     }
-    triangulate(vF,F);
+    polygon_mesh_to_triangle_mesh(vF,F);
   }
   if(!readDMAT(cfilename,Z))
   {
@@ -563,7 +563,7 @@ int main(int argc, char * argv[])
   }
   // Create a tweak bar
   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.push_away(3);
   s.camera.dolly_zoom(25-s.camera.m_angle);

+ 2 - 2
examples/dmat/Makefile

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

+ 2 - 2
examples/eigen-gotchas/Makefile

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

+ 1 - 1
examples/embree/Makefile

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

+ 8 - 8
examples/embree/example.cpp

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

+ 2 - 2
examples/example_fun/Makefile

@@ -3,11 +3,11 @@
 all: example_static example_header_only
 
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 igl_lib=../../
 
-CFLAGS=-g
+CFLAGS+=-g
 inc=-I$(igl_lib)/include
 
 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);
   int i = 4;
   example_fun(i);
-#ifdef IGL_HEADER_ONLY
+#ifndef IGL_STATIC_LIBRARY
   const char * s = "string";
   example_fun(s);
 #endif

+ 2 - 2
examples/file_contents_as_string/Makefile

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

+ 1 - 1
examples/flare-eyes/Makefile

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

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

@@ -3,7 +3,7 @@
 #include <igl/writeOFF.h>
 #include <igl/readWRL.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/readMESH.h>
 #include <igl/draw_mesh.h>
@@ -103,7 +103,7 @@ void TW_CALL set_rotation_type(const void * value, void * clientData)
   using namespace igl;
   const RotationType old_rotation_type = rotation_type;
   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)
   {
     push_undo();
@@ -227,7 +227,7 @@ void draw_eyes()
     LED_METHOD_TEXTURE_FLARE = 2
   } method = LED_METHOD_TEXTURE_FLARE;
 
-  
+
   for(int l = 0;l<NUM_LEDS;l++)
   {
     glPushMatrix();
@@ -306,7 +306,7 @@ void display()
   push_scene();
 
 
-  
+
   if(list_id == 0)
   {
     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:
       {
-        // 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(
           width, height,
           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;
       }
   }
-  
+
 }
 
 int main(int argc, char * argv[])
@@ -662,7 +662,7 @@ int main(int argc, char * argv[])
   //  }
   //  //if(F.size() > T.size() || F.size() == 0)
   //  {
-  //    boundary_faces(T,F);
+  //    boundary_facets(T,F);
   //  }
   }
   if(vV.size() > 0)
@@ -671,7 +671,7 @@ int main(int argc, char * argv[])
     {
       return 1;
     }
-    triangulate(vF,F);
+    polygon_mesh_to_triangle_mesh(vF,F);
   }
 
   init_relative();
@@ -686,7 +686,7 @@ int main(int argc, char * argv[])
   }
   // Create a tweak bar
   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");
   TwType RotationTypeTW = ReTwDefineEnumFromString("RotationType",
     "igl_trackball,two-axis-valuator-fixed-up");

+ 2 - 2
examples/get_seconds/Makefile

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

+ 2 - 2
examples/glslversion/Makefile

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

+ 2 - 2
examples/glut_speed_test/Makefile

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

+ 2 - 2
examples/harwell_boeing/Makefile

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

+ 1 - 1
examples/intersections/Makefile

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

+ 11 - 10
examples/intersections/example.cpp

@@ -16,7 +16,7 @@
 #include <igl/list_to_matrix.h>
 #include <igl/snap_to_canonical_view_quat.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/barycenter.h>
 #include <igl/matlab_format.h>
@@ -24,7 +24,7 @@
 #include <igl/pathinfo.h>
 #include <igl/Camera.h>
 #include <igl/get_seconds.h>
-#include <igl/cgal/selfintersect.h>
+#include <igl/cgal/remesh_self_intersections.h>
 #include <igl/cgal/intersect_other.h>
 
 #ifdef __APPLE__
@@ -97,7 +97,7 @@ void TW_CALL set_rotation_type(const void * value, void * clientData)
   using namespace igl;
   const RotationType old_rotation_type = rotation_type;
   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)
   {
     push_undo();
@@ -446,7 +446,7 @@ void mouse_drag(int mouse_x, int mouse_y)
       }
       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(
           width, height,
           2.0,
@@ -477,9 +477,10 @@ void color_selfintersections(
   using namespace Eigen;
   MatrixXd SV;
   MatrixXi SF,IF;
-  SelfintersectParam params;
+  VectorXi J,IM;
+  RemeshSelfIntersectionsParam params;
   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.col(0).setConstant(0.4);
   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;
       }
   }
-  
+
   glutPostRedisplay();
 }
 
@@ -606,7 +607,7 @@ int main(int argc, char * argv[])
     //  }
     //  //if(F.size() > T.size() || F.size() == 0)
     //  {
-    //    boundary_faces(T,F);
+    //    boundary_facets(T,F);
     //  }
     }
     if(vV.size() > 0)
@@ -615,7 +616,7 @@ int main(int argc, char * argv[])
       {
         return false;
       }
-      triangulate(vF,F);
+      polygon_mesh_to_triangle_mesh(vF,F);
     }
     // Compute normals, centroid, colors, bounding box diagonal
     per_face_normals(V,F,N);
@@ -656,7 +657,7 @@ int main(int argc, char * argv[])
   }
   // Create a tweak bar
   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.push_away(3);
   s.camera.dolly_zoom(25-s.camera.m_angle);

+ 2 - 2
examples/is_dir/Makefile

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

+ 2 - 2
examples/marching_cubes/Makefile

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

+ 2 - 2
examples/meshio/Makefile

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

+ 2 - 2
examples/mode/Makefile

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

+ 1 - 1
examples/multi-viewport/Makefile

@@ -8,7 +8,7 @@ all: example
 .PHONY:  example
 
 LIBIGL=/usr/local/igl/libigl/
-include $(LIBIGL)/Makefile.conf
+include $(LIBIGL)/build/Makefile.conf
 LIBIGL_INC=-I$(LIBIGL)/include
 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/per_face_normals.h>
-#include <igl/read.h>
+#include <igl/read_triangle_mesh.h>
 #include <igl/normalize_row_lengths.h>
 #include <igl/draw_mesh.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++)
   {
     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)
     {
       down_vp = vp;
@@ -503,7 +503,7 @@ void key(unsigned char key, int mouse_x, int mouse_y)
     default:
       cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
   }
-  
+
 }
 
 int main(int argc, char * argv[])
@@ -519,7 +519,7 @@ int main(int argc, char * argv[])
     filename = argv[1];
   }
 
-  if(!read(filename,V,F))
+  if(!read_triangle_mesh(filename,V,F))
   {
     return 1;
   }
@@ -529,7 +529,7 @@ int main(int argc, char * argv[])
   mean = V.colwise().mean();
   C.resize(F.rows(),3);
   init_C();
-  bbd = 
+  bbd =
     (V.colwise().maxCoeff() -
     V.colwise().minCoeff()).maxCoeff();
 

+ 2 - 2
examples/patches/Makefile

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

+ 14 - 12
examples/patches/example.cpp

@@ -3,7 +3,7 @@
 #include <igl/writeOFF.h>
 #include <igl/readWRL.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/readMESH.h>
 #include <igl/draw_mesh.h>
@@ -25,10 +25,10 @@
 #include <igl/boost/components.h>
 #include <igl/boost/bfs_orient.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/C_STR.h>
-#include <igl/write.h>
+#include <igl/write_triangle_mesh.h>
 #include <igl/two_axis_valuator_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;
   const RotationType old_rotation_type = rotation_type;
   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)
   {
     push_undo();
@@ -291,7 +291,7 @@ void display()
     {
       draw_mesh(V,F,s.N,s.C);
     }
-  
+
     // visualize selected patch
     glLineWidth(10);
     glBegin(GL_TRIANGLES);
@@ -390,7 +390,7 @@ void mouse_wheel(int wheel, int direction, int mouse_x, int mouse_y)
       break;
     default:
     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);
       break;
   }
@@ -487,7 +487,7 @@ void mouse_drag(int mouse_x, int mouse_y)
       }
       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(
           width, height,
           2.0,
@@ -567,9 +567,11 @@ void init_patches()
   switch(orient_method)
   {
     case ORIENT_METHOD_AO:
+    {
       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;
+    }
     case ORIENT_METHOD_OUTWARD:
     default:
       cout<<"orient_outward()"<<endl;
@@ -606,7 +608,7 @@ bool save(const std::string & out_filename)
 {
   using namespace std;
   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;
     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;
       }
   }
-  
+
 }
 
 int main(int argc, char * argv[])
@@ -757,7 +759,7 @@ int main(int argc, char * argv[])
   //  }
   //  //if(F.size() > T.size() || F.size() == 0)
   //  {
-  //    boundary_faces(T,F);
+  //    boundary_facets(T,F);
   //  }
   }
   if(vV.size() > 0)
@@ -766,7 +768,7 @@ int main(int argc, char * argv[])
     {
       return 1;
     }
-    triangulate(vF,F);
+    polygon_mesh_to_triangle_mesh(vF,F);
   }
   MatrixXi 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
-wireframe_visible: TW_TYPE_BOOLCPP 0
+wireframe_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
 

+ 2 - 2
examples/path_tests/Makefile

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

+ 2 - 2
examples/pathinfo/Makefile

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

+ 3 - 4
examples/principal_curvature/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 all: curvature
 
@@ -11,14 +11,13 @@ all: curvature
 igl_lib=../../
 eigen=-I$(DEFAULT_PREFIX)/include/eigen3
 
-CFLAGS=-g -O3
 inc=-I$(igl_lib)/include $(eigen)
 
 curvature: curvature.o
-	g++ $(CFLAGS) -o curvature curvature.o $(lib)
+	g++ $(CFLAGS) $(OPENMP) -o curvature curvature.o $(lib)
 
 curvature.o: curvature.cpp
-	g++ $(CFLAGS) -c curvature.cpp -o curvature.o $(inc)
+	g++ $(CFLAGS) $(OPENMP) -c curvature.cpp -o curvature.o $(inc)
 clean:
 	rm -f curvature.o
 	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/read.h>
+#include <igl/read_triangle_mesh.h>
 #include <iostream>
 #include <Eigen/Dense>
 #include <Eigen/Sparse>
@@ -44,7 +44,7 @@ void app_init(int argc, char* argv[], CurvatureCalculator& c, Eigen::MatrixXd& V
     }
     char* tmp;
     const char* meshName;
-    char * scaleFile;
+    //char * scaleFile;
     for (argc--, argv++; argc--; argv++)
     {
         if( (*argv)[0] == '-')
@@ -68,7 +68,7 @@ void app_init(int argc, char* argv[], CurvatureCalculator& c, Eigen::MatrixXd& V
                 break;
             case 'i':
                 meshName=*++argv;
-                igl::read(meshName,V,F);
+                igl::read_triangle_mesh(meshName,V,F);
                 argc--;
                 break;
             case 'k':
@@ -152,7 +152,7 @@ int main(int argc, char *argv[])
     string filename;
 
     app_init(argc,argv,c,V,F);
-    
+
     c.init(V,F);
 
     c.computeCurvature();

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

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

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

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

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

@@ -4,7 +4,7 @@
 #include <igl/writeOFF.h>
 #include <igl/readWRL.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/readMESH.h>
 #include <igl/draw_mesh.h>
@@ -93,7 +93,7 @@ void TW_CALL set_rotation_type(const void * value, void * clientData)
   using namespace igl;
   const RotationType old_rotation_type = rotation_type;
   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)
   {
     push_undo();
@@ -223,7 +223,7 @@ void display()
   glMaterialfv(GL_BACK, GL_SPECULAR, SILVER_SPECULAR);
   glMaterialf (GL_BACK, GL_SHININESS, 128);
 
-  
+
   draw_mesh(V,F,N);
 
   glPointSize(3.);
@@ -381,7 +381,7 @@ void mouse_drag(int mouse_x, int mouse_y)
       }
       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(
           width, height,
           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;
       }
   }
-  
+
 }
 
 int main(int argc, char * argv[])
@@ -546,7 +546,7 @@ int main(int argc, char * argv[])
   //  }
   //  //if(F.size() > T.size() || F.size() == 0)
   //  {
-  //    boundary_faces(T,F);
+  //    boundary_facets(T,F);
   //  }
   }
   if(vV.size() > 0)
@@ -555,7 +555,7 @@ int main(int argc, char * argv[])
     {
       return 1;
     }
-    triangulate(vF,F);
+    polygon_mesh_to_triangle_mesh(vF,F);
   }
 
   init_relative();
@@ -571,7 +571,7 @@ int main(int argc, char * argv[])
   }
   // Create a tweak bar
   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");
   TwType RotationTypeTW = ReTwDefineEnumFromString("RotationType",
     "igl_trackball,two-a...-fixed-up");

+ 1 - 1
examples/render_to_png/Makefile

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

+ 1 - 1
examples/rotate-widget/Makefile

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

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

@@ -6,7 +6,7 @@
 #include <igl/writeOFF.h>
 #include <igl/readWRL.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/readMESH.h>
 #include <igl/draw_mesh.h>
@@ -99,7 +99,7 @@ void TW_CALL set_rotation_type(const void * value, void * clientData)
   using namespace igl;
   const RotationType old_rotation_type = rotation_type;
   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)
   {
     push_undo();
@@ -417,7 +417,7 @@ void mouse_drag(int mouse_x, int mouse_y)
       }
       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(
           width, height,
           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;
       }
   }
-  
+
   glutPostRedisplay();
 }
 
@@ -574,7 +574,7 @@ int main(int argc, char * argv[])
   //  }
   //  //if(F.size() > T.size() || F.size() == 0)
   //  {
-  //    boundary_faces(T,F);
+  //    boundary_facets(T,F);
   //  }
   }
   if(vV.size() > 0)
@@ -583,7 +583,7 @@ int main(int argc, char * argv[])
     {
       return 1;
     }
-    triangulate(vF,F);
+    polygon_mesh_to_triangle_mesh(vF,F);
   }
 
   init_relative();
@@ -598,7 +598,7 @@ int main(int argc, char * argv[])
   }
   // Create a tweak bar
   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");
   TwType RotationTypeTW = ReTwDefineEnumFromString("RotationType",
     "igl_trackball,two-a...-fixed-up");

+ 1 - 1
examples/scene-rotation/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 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"
@@ -9,7 +9,7 @@
 #include <igl/writeOFF.h>
 #include <igl/readWRL.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/readMESH.h>
 #include <igl/draw_mesh.h>
@@ -107,7 +107,7 @@ void TW_CALL set_rotation_type(const void * value, void * clientData)
   using namespace igl;
   const RotationType old_rotation_type = rotation_type;
   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)
   {
     push_undo();
@@ -246,7 +246,7 @@ void display()
   glMaterialfv(GL_BACK, GL_SPECULAR, SILVER_SPECULAR);
   glMaterialf (GL_BACK, GL_SHININESS, 128);
 
-  
+
   draw_mesh(V,F,N);
   pop_object();
 
@@ -306,7 +306,7 @@ void mouse_wheel(int wheel, int direction, int mouse_x, int mouse_y)
       break;
     default:
     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);
       break;
   }
@@ -408,13 +408,13 @@ void mouse_drag(int mouse_x, int mouse_y)
           down_camera.m_rotation_conj.coeffs().data()+4,
           down_quaternion);
         float new_quaternion[4];
-        
+
         const float center_x = ((float)width)/2.0;
         const float center_y = ((float)height)/2.0;
         const double speed = 2.0f;
         const float half_width =   ((float)width)/speed;
         const float half_height = ((float)height)/speed;
-        
+
         ::trackball(new_quaternion,
           (float)(center_x-down_x)/half_width,
           (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;
         if(axis.norm() != 0)
         {
-          q = 
+          q =
             Quaterniond(
               AngleAxisd(
                 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:
       {
-        // 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(
           width, height,
           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;
       }
   }
-  
+
 }
 
 int main(int argc, char * argv[])
@@ -629,7 +629,7 @@ int main(int argc, char * argv[])
   //  }
   //  //if(F.size() > T.size() || F.size() == 0)
   //  {
-  //    boundary_faces(T,F);
+  //    boundary_facets(T,F);
   //  }
   }
   if(vV.size() > 0)
@@ -638,7 +638,7 @@ int main(int argc, char * argv[])
     {
       return 1;
     }
-    triangulate(vF,F);
+    polygon_mesh_to_triangle_mesh(vF,F);
   }
 
   init_relative();
@@ -653,7 +653,7 @@ int main(int argc, char * argv[])
   }
   // Create a tweak bar
   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");
   TwType RotationTypeTW = ReTwDefineEnumFromString("RotationType",
     "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 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]);
-////Olga////
+////Olga////

+ 1 - 1
examples/shadow-mapping/Makefile

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

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

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

+ 1 - 1
examples/skeleton/Makefile

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

+ 9 - 9
examples/skeleton/example.cpp

@@ -7,7 +7,7 @@
 #include <igl/writeOFF.h>
 #include <igl/readWRL.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/readMESH.h>
 #include <igl/draw_mesh.h>
@@ -112,7 +112,7 @@ void TW_CALL set_rotation_type(const void * value, void * clientData)
   using namespace igl;
   const RotationType old_rotation_type = rotation_type;
   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)
   {
     push_undo();
@@ -273,7 +273,7 @@ void display()
     T.block(e*(dim+1),0,dim+1,dim) =
       a.matrix().transpose().block(0,0,dim+1,dim);
   }
-  
+
   if(wireframe)
   {
     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:
       {
-        // 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(
           width, height,
           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;
       }
   }
-  
+
 }
 
 bool init_weights(
@@ -554,7 +554,7 @@ bool init_weights(
     return false;
   }
 
-  // compute BBW 
+  // compute BBW
   // Default bbw data and flags
   BBWData bbw_data;
   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)
   //  {
-  //    boundary_faces(T,F);
+  //    boundary_facets(T,F);
   //  }
   }
   if(vV.size() > 0)
@@ -641,7 +641,7 @@ int main(int argc, char * argv[])
     {
       return 1;
     }
-    triangulate(vF,F);
+    polygon_mesh_to_triangle_mesh(vF,F);
   }
 
   readTGF(skel_filename,C,BE);
@@ -674,7 +674,7 @@ int main(int argc, char * argv[])
   }
   // Create a tweak bar
   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");
   TwType RotationTypeTW = ReTwDefineEnumFromString("RotationType",
     "igl_trackball,two-a...-fixed-up");

+ 3 - 3
examples/slice/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 all: example
 
@@ -11,8 +11,8 @@ all: example
 igl_lib=../../
 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)
 lib=-L$(igl_lib)/lib -ligl
 

+ 2 - 2
examples/sort/Makefile

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

+ 2 - 2
examples/sortrows/Makefile

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

+ 2 - 2
examples/stdin_to_temp/Makefile

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

+ 2 - 2
examples/svd/Makefile

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

+ 2 - 2
examples/textured-mesh/Makefile

@@ -2,7 +2,7 @@
 .PHONY: all
 
 # Shared flags etc.
-include ../../Makefile.conf
+include ../../build/Makefile.conf
 
 all: example
 
@@ -23,7 +23,7 @@ EMBREE_LIB=-L$(EMBREE)/build -lembree -lsys
 
 # YIMAGE Library
 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) 
 
 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/snap_to_canonical_view_quat.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/barycenter.h>
 #include <igl/matlab_format.h>
@@ -101,7 +101,7 @@ void TW_CALL set_rotation_type(const void * value, void * clientData)
   using namespace igl;
   const RotationType old_rotation_type = rotation_type;
   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)
   {
     push_undo();
@@ -457,7 +457,7 @@ void mouse_drag(int mouse_x, int mouse_y)
       }
       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(
           width, height,
           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;
       }
   }
-  
+
   glutPostRedisplay();
 }
 
@@ -532,7 +532,7 @@ int main(int argc, char * argv[])
       cerr<<"Bad V"<<endl;
       return 1;
     }
-    triangulate(vF,F);
+    polygon_mesh_to_triangle_mesh(vF,F);
   }
   if(vTC.size() > 0)
   {
@@ -577,7 +577,7 @@ int main(int argc, char * argv[])
   }
   // Create a tweak bar
   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.push_away(3);
   s.camera.dolly_zoom(25-s.camera.m_angle);

+ 2 - 2
examples/trackball/Makefile

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

+ 1 - 1
examples/transparency/Makefile

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

+ 2 - 2
examples/transparency/example.cpp

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

+ 2 - 2
examples/transpose_blocks/Makefile

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

+ 1 - 1
examples/upright/Makefile

@@ -8,7 +8,7 @@ all: upright
 .PHONY: upright
 
 LIBIGL=/usr/local/igl/libigl/
-include $(LIBIGL)/Makefile.conf
+include $(LIBIGL)/build/Makefile.conf
 LIBIGL_INC=-I$(LIBIGL)/include
 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
 // 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
 // lost in the output file.
 //
@@ -12,7 +12,7 @@
 #include <igl/writeOBJ.h>
 #include <igl/writeOFF.h>
 #include <igl/readWRL.h>
-#include <igl/triangulate.h>
+#include <igl/polygon_mesh_to_triangle_mesh.h>
 #include <igl/readOFF.h>
 #include <igl/readMESH.h>
 #include <igl/draw_mesh.h>
@@ -184,7 +184,7 @@ void display()
   glMaterialfv(GL_BACK, GL_SPECULAR, SILVER_SPECULAR);
   glMaterialf (GL_BACK, GL_SHININESS, 128);
 
-  
+
   draw_mesh(s.V,s.F,s.N);
 
   glDisable(GL_LIGHTING);
@@ -281,7 +281,7 @@ void bake()
   s.V.col(0).array() -= s.Vmid(0);
   s.V.col(1).array() -= s.Vmid(1);
   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();
 }
 
@@ -339,7 +339,7 @@ bool save()
   //  }
   //  //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;
@@ -433,7 +433,7 @@ void key(unsigned char key, int mouse_x, int mouse_y)
     default:
       cout<<"Unknown key command: '"<<key<<"' ("<<int(key)<<")"<<endl;
   }
-  
+
   glutPostRedisplay();
 }
 
@@ -502,7 +502,7 @@ int main(int argc, char * argv[])
   //  }
   //  //if(F.size() > T.size() || F.size() == 0)
   //  {
-  //    boundary_faces(T,F);
+  //    boundary_facets(T,F);
   //  }
   }
   if(vV.size() > 0)
@@ -511,7 +511,7 @@ int main(int argc, char * argv[])
     {
       return 1;
     }
-    triangulate(vF,s.F);
+    polygon_mesh_to_triangle_mesh(vF,s.F);
   }
 
   init_relative();

+ 1 - 1
include/igl/EPS.cpp

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

+ 1 - 1
include/igl/EPS.h

@@ -25,7 +25,7 @@ namespace igl
   template <> IGL_INLINE double EPS_SQ<double>();
 }
 
-#ifdef IGL_HEADER_ONLY
+#ifndef IGL_STATIC_LIBRARY
 #  include "EPS.cpp"
 #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
 // 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>
 
@@ -15,13 +15,14 @@
 
 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>
   class Pos
   {
   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>* FF,
         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.
-// 
+//
 // 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/.
 #ifndef IGL_IO
 #define IGL_IO
 // Input and output functions
-#include "read.h"
+#include "read_triangle_mesh.h"
 #include "readDMAT.h"
 #include "readMESH.h"
 #include "readNODE.h"
@@ -18,7 +18,7 @@
 #include "readWRL.h"
 #include "readCSV.h"
 #include "file_contents_as_string.h"
-#include "write.h"
+#include "write_triangle_mesh.h"
 #include "writeDMAT.h"
 #include "writeMESH.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 TwRemoveAllVars(TwBar *bar);
 
-#ifdef IGL_HEADER_ONLY
+#ifndef IGL_STATIC_LIBRARY
 #  include "ReAntTweakBar.cpp"
 #endif
 

+ 1 - 1
include/igl/WindingNumberTree.h

@@ -140,7 +140,7 @@ inline igl::WindingNumberTree<Point>::WindingNumberTree(
   V(dummyV),
   SV(),
   F(),
-  //boundary(igl::boundary_faces<Eigen::MatrixXi,Eigen::MatrixXi>(F))
+  //boundary(igl::boundary_facets<Eigen::MatrixXi,Eigen::MatrixXi>(F))
   cap(),
   radius(std::numeric_limits<double>::infinity()),
   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);
     Eigen::PlainObjectBase<DerivedB> 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
     Lambda_known_i.block(nk,0,as_lx_count,1) = 
       (-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
 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

+ 5 - 2
include/igl/active_set.h

@@ -20,7 +20,10 @@ namespace igl
   // using QR decomposition otherwise:
   //   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,
   // and further optionally subject to the linear inequality constraints that
   // 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"
 #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
 // 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);

+ 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"
 #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
 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>&);

+ 1 - 1
include/igl/adjacency_matrix.h

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

+ 1 - 1
include/igl/all_edges.h

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

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