├── .appveyor.yml ├── .gitignore ├── .gitmodules ├── .travis.yml ├── CMake └── Modules │ └── FindGurobi.cmake ├── CMakeLists.txt ├── LICENSE ├── README.md ├── data.zip ├── ext ├── RectangleBinPack │ ├── CMakeLists.txt │ ├── Readme.txt │ ├── include │ │ └── RectangleBinPack │ │ │ ├── MaxRectsBinPack.h │ │ │ └── Rect.h │ └── src │ │ ├── GuillotineBinPack.cpp │ │ ├── GuillotineBinPack.h │ │ ├── MaxRectsBinPack.cpp │ │ ├── Rect.cpp │ │ ├── ShelfBinPack.cpp │ │ ├── ShelfBinPack.h │ │ ├── ShelfNextFitBinPack.cpp │ │ ├── ShelfNextFitBinPack.h │ │ ├── SkylineBinPack.cpp │ │ └── SkylineBinPack.h ├── libigl │ ├── external │ │ └── triangle │ │ │ ├── A.poly │ │ │ ├── CMakeLists.txt │ │ │ ├── README │ │ │ ├── makefile │ │ │ ├── showme.c │ │ │ ├── triangle.c │ │ │ ├── triangle.h │ │ │ └── tricall.c │ └── igl │ │ ├── AABB.cpp │ │ ├── AABB.h │ │ ├── ARAPEnergyType.h │ │ ├── AtA_cached.cpp │ │ ├── AtA_cached.h │ │ ├── C_STR.h │ │ ├── Camera.h │ │ ├── ConjugateFFSolverData.h │ │ ├── EPS.cpp │ │ ├── EPS.h │ │ ├── HalfEdgeIterator.cpp │ │ ├── HalfEdgeIterator.h │ │ ├── Hit.h │ │ ├── IO │ │ ├── IndexComparison.h │ │ ├── LinSpaced.h │ │ ├── MeshBooleanType.h │ │ ├── NormalType.h │ │ ├── ONE.h │ │ ├── PI.h │ │ ├── REDRUM.h │ │ ├── STR.h │ │ ├── Singular_Value_Decomposition_Givens_QR_Factorization_Kernel.hpp │ │ ├── Singular_Value_Decomposition_Jacobi_Conjugation_Kernel.hpp │ │ ├── Singular_Value_Decomposition_Kernel_Declarations.hpp │ │ ├── Singular_Value_Decomposition_Main_Kernel_Body.hpp │ │ ├── Singular_Value_Decomposition_Preamble.hpp │ │ ├── SolverStatus.h │ │ ├── SortableRow.h │ │ ├── Timer.h │ │ ├── Viewport.h │ │ ├── WindingNumberAABB.h │ │ ├── WindingNumberMethod.h │ │ ├── WindingNumberTree.h │ │ ├── ZERO.h │ │ ├── active_set.cpp │ │ ├── active_set.h │ │ ├── adjacency_list.cpp │ │ ├── adjacency_list.h │ │ ├── adjacency_matrix.cpp │ │ ├── adjacency_matrix.h │ │ ├── all.cpp │ │ ├── all.h │ │ ├── all_edges.cpp │ │ ├── all_edges.h │ │ ├── all_pairs_distances.cpp │ │ ├── all_pairs_distances.h │ │ ├── ambient_occlusion.cpp │ │ ├── ambient_occlusion.h │ │ ├── angle_bound_frame_fields.cpp │ │ ├── angle_bound_frame_fields.h │ │ ├── angular_distance.cpp │ │ ├── angular_distance.h │ │ ├── anttweakbar │ │ ├── ReAntTweakBar.cpp │ │ ├── ReAntTweakBar.h │ │ ├── cocoa_key_to_anttweakbar_key.cpp │ │ └── cocoa_key_to_anttweakbar_key.h │ │ ├── any.cpp │ │ ├── any.h │ │ ├── any_of.cpp │ │ ├── any_of.h │ │ ├── arap.cpp │ │ ├── arap.h │ │ ├── arap_dof.cpp │ │ ├── arap_dof.h │ │ ├── arap_linear_block.cpp │ │ ├── arap_linear_block.h │ │ ├── arap_rhs.cpp │ │ ├── arap_rhs.h │ │ ├── average_onto_faces.cpp │ │ ├── average_onto_faces.h │ │ ├── average_onto_vertices.cpp │ │ ├── average_onto_vertices.h │ │ ├── avg_edge_length.cpp │ │ ├── avg_edge_length.h │ │ ├── axis_angle_to_quat.cpp │ │ ├── axis_angle_to_quat.h │ │ ├── barycenter.cpp │ │ ├── barycenter.h │ │ ├── barycentric_coordinates.cpp │ │ ├── barycentric_coordinates.h │ │ ├── barycentric_to_global.cpp │ │ ├── barycentric_to_global.h │ │ ├── basename.cpp │ │ ├── basename.h │ │ ├── bbw.cpp │ │ ├── bbw.h │ │ ├── bfs.cpp │ │ ├── bfs.h │ │ ├── bfs_orient.cpp │ │ ├── bfs_orient.h │ │ ├── biharmonic_coordinates.cpp │ │ ├── biharmonic_coordinates.h │ │ ├── bijective_composite_harmonic_mapping.cpp │ │ ├── bijective_composite_harmonic_mapping.h │ │ ├── bone_parents.cpp │ │ ├── bone_parents.h │ │ ├── boundary_conditions.cpp │ │ ├── boundary_conditions.h │ │ ├── boundary_facets.cpp │ │ ├── boundary_facets.h │ │ ├── boundary_loop.cpp │ │ ├── boundary_loop.h │ │ ├── bounding_box.cpp │ │ ├── bounding_box.h │ │ ├── bounding_box_diagonal.cpp │ │ ├── bounding_box_diagonal.h │ │ ├── canonical_quaternions.cpp │ │ ├── canonical_quaternions.h │ │ ├── cat.cpp │ │ ├── cat.h │ │ ├── ceil.cpp │ │ ├── ceil.h │ │ ├── centroid.cpp │ │ ├── centroid.h │ │ ├── circulation.cpp │ │ ├── circulation.h │ │ ├── circumradius.cpp │ │ ├── circumradius.h │ │ ├── collapse_edge.cpp │ │ ├── collapse_edge.h │ │ ├── collapse_small_triangles.cpp │ │ ├── collapse_small_triangles.h │ │ ├── colon.cpp │ │ ├── colon.h │ │ ├── colormap.cpp │ │ ├── colormap.h │ │ ├── column_to_quats.cpp │ │ ├── column_to_quats.h │ │ ├── columnize.cpp │ │ ├── columnize.h │ │ ├── comb_cross_field.cpp │ │ ├── comb_cross_field.h │ │ ├── comb_frame_field.cpp │ │ ├── comb_frame_field.h │ │ ├── comb_line_field.cpp │ │ ├── comb_line_field.h │ │ ├── combine.cpp │ │ ├── combine.h │ │ ├── components.cpp │ │ ├── components.h │ │ ├── compute_frame_field_bisectors.cpp │ │ ├── compute_frame_field_bisectors.h │ │ ├── conjugate_frame_fields.cpp │ │ ├── conjugate_frame_fields.h │ │ ├── connect_boundary_to_infinity.cpp │ │ ├── connect_boundary_to_infinity.h │ │ ├── copyleft │ │ ├── README.md │ │ ├── cgal │ │ │ ├── BinaryWindingNumberOperations.h │ │ │ ├── CGAL_includes.hpp │ │ │ ├── CSGTree.h │ │ │ ├── RemeshSelfIntersectionsParam.h │ │ │ ├── SelfIntersectMesh.h │ │ │ ├── assign.cpp │ │ │ ├── assign.h │ │ │ ├── assign_scalar.cpp │ │ │ ├── assign_scalar.h │ │ │ ├── barycenter.cpp │ │ │ ├── cell_adjacency.cpp │ │ │ ├── cell_adjacency.h │ │ │ ├── closest_facet.cpp │ │ │ ├── closest_facet.h │ │ │ ├── complex_to_mesh.cpp │ │ │ ├── complex_to_mesh.h │ │ │ ├── component_inside_component.cpp │ │ │ ├── component_inside_component.h │ │ │ ├── convex_hull.cpp │ │ │ ├── convex_hull.h │ │ │ ├── delaunay_triangulation.cpp │ │ │ ├── delaunay_triangulation.h │ │ │ ├── extract_cells.cpp │ │ │ ├── extract_cells.h │ │ │ ├── extract_feature.cpp │ │ │ ├── extract_feature.h │ │ │ ├── half_space_box.cpp │ │ │ ├── half_space_box.h │ │ │ ├── hausdorff.cpp │ │ │ ├── hausdorff.h │ │ │ ├── incircle.cpp │ │ │ ├── incircle.h │ │ │ ├── insert_into_cdt.cpp │ │ │ ├── insert_into_cdt.h │ │ │ ├── insphere.cpp │ │ │ ├── insphere.h │ │ │ ├── intersect_other.cpp │ │ │ ├── intersect_other.h │ │ │ ├── intersect_with_half_space.cpp │ │ │ ├── intersect_with_half_space.h │ │ │ ├── lexicographic_triangulation.cpp │ │ │ ├── lexicographic_triangulation.h │ │ │ ├── list_to_matrix.cpp │ │ │ ├── mesh_boolean.cpp │ │ │ ├── mesh_boolean.h │ │ │ ├── mesh_boolean_type_to_funcs.cpp │ │ │ ├── mesh_boolean_type_to_funcs.h │ │ │ ├── mesh_to_cgal_triangle_list.cpp │ │ │ ├── mesh_to_cgal_triangle_list.h │ │ │ ├── mesh_to_polyhedron.cpp │ │ │ ├── mesh_to_polyhedron.h │ │ │ ├── minkowski_sum.cpp │ │ │ ├── minkowski_sum.h │ │ │ ├── order_facets_around_edge.cpp │ │ │ ├── order_facets_around_edge.h │ │ │ ├── order_facets_around_edges.cpp │ │ │ ├── order_facets_around_edges.h │ │ │ ├── orient2D.cpp │ │ │ ├── orient2D.h │ │ │ ├── orient3D.cpp │ │ │ ├── orient3D.h │ │ │ ├── outer_element.cpp │ │ │ ├── outer_element.h │ │ │ ├── outer_facet.cpp │ │ │ ├── outer_facet.h │ │ │ ├── outer_hull.cpp │ │ │ ├── outer_hull.h │ │ │ ├── peel_outer_hull_layers.cpp │ │ │ ├── peel_outer_hull_layers.h │ │ │ ├── peel_winding_number_layers.cpp │ │ │ ├── peel_winding_number_layers.h │ │ │ ├── piecewise_constant_winding_number.cpp │ │ │ ├── piecewise_constant_winding_number.h │ │ │ ├── point_mesh_squared_distance.cpp │ │ │ ├── point_mesh_squared_distance.h │ │ │ ├── point_segment_squared_distance.cpp │ │ │ ├── point_segment_squared_distance.h │ │ │ ├── point_solid_signed_squared_distance.cpp │ │ │ ├── point_solid_signed_squared_distance.h │ │ │ ├── point_triangle_squared_distance.cpp │ │ │ ├── point_triangle_squared_distance.h │ │ │ ├── points_inside_component.cpp │ │ │ ├── points_inside_component.h │ │ │ ├── polyhedron_to_mesh.cpp │ │ │ ├── polyhedron_to_mesh.h │ │ │ ├── projected_cdt.cpp │ │ │ ├── projected_cdt.h │ │ │ ├── projected_delaunay.cpp │ │ │ ├── projected_delaunay.h │ │ │ ├── propagate_winding_numbers.cpp │ │ │ ├── propagate_winding_numbers.h │ │ │ ├── read_triangle_mesh.cpp │ │ │ ├── read_triangle_mesh.h │ │ │ ├── relabel_small_immersed_cells.cpp │ │ │ ├── relabel_small_immersed_cells.h │ │ │ ├── remesh_intersections.cpp │ │ │ ├── remesh_intersections.h │ │ │ ├── remesh_self_intersections.cpp │ │ │ ├── remesh_self_intersections.h │ │ │ ├── remove_unreferenced.cpp │ │ │ ├── resolve_intersections.cpp │ │ │ ├── resolve_intersections.h │ │ │ ├── row_to_point.cpp │ │ │ ├── row_to_point.h │ │ │ ├── segment_segment_squared_distance.cpp │ │ │ ├── segment_segment_squared_distance.h │ │ │ ├── signed_distance_isosurface.cpp │ │ │ ├── signed_distance_isosurface.h │ │ │ ├── slice.cpp │ │ │ ├── slice_mask.cpp │ │ │ ├── snap_rounding.cpp │ │ │ ├── snap_rounding.h │ │ │ ├── string_to_mesh_boolean_type.cpp │ │ │ ├── string_to_mesh_boolean_type.h │ │ │ ├── subdivide_segments.cpp │ │ │ ├── subdivide_segments.h │ │ │ ├── submesh_aabb_tree.cpp │ │ │ ├── submesh_aabb_tree.h │ │ │ ├── triangle_triangle_squared_distance.cpp │ │ │ ├── triangle_triangle_squared_distance.h │ │ │ ├── trim_with_solid.cpp │ │ │ ├── trim_with_solid.h │ │ │ ├── unique.cpp │ │ │ ├── unique_rows.cpp │ │ │ ├── wire_mesh.cpp │ │ │ └── wire_mesh.h │ │ ├── comiso │ │ │ ├── frame_field.cpp │ │ │ ├── frame_field.h │ │ │ ├── miq.cpp │ │ │ ├── miq.h │ │ │ ├── nrosy.cpp │ │ │ └── nrosy.h │ │ ├── cork │ │ │ ├── from_cork_mesh.cpp │ │ │ ├── from_cork_mesh.h │ │ │ ├── mesh_boolean.cpp │ │ │ ├── mesh_boolean.h │ │ │ ├── to_cork_mesh.cpp │ │ │ └── to_cork_mesh.h │ │ ├── marching_cubes.cpp │ │ ├── marching_cubes.h │ │ ├── marching_cubes_tables.h │ │ ├── offset_surface.cpp │ │ ├── offset_surface.h │ │ ├── opengl2 │ │ │ ├── render_to_tga.cpp │ │ │ ├── render_to_tga.h │ │ │ ├── texture_from_tga.cpp │ │ │ ├── texture_from_tga.h │ │ │ ├── tga.cpp │ │ │ └── tga.h │ │ ├── progressive_hulls.cpp │ │ ├── progressive_hulls.h │ │ ├── progressive_hulls_cost_and_placement.cpp │ │ ├── progressive_hulls_cost_and_placement.h │ │ ├── quadprog.cpp │ │ ├── quadprog.h │ │ ├── swept_volume.cpp │ │ ├── swept_volume.h │ │ └── tetgen │ │ │ ├── README │ │ │ ├── cdt.cpp │ │ │ ├── cdt.h │ │ │ ├── mesh_to_tetgenio.cpp │ │ │ ├── mesh_to_tetgenio.h │ │ │ ├── mesh_with_skeleton.cpp │ │ │ ├── mesh_with_skeleton.h │ │ │ ├── read_into_tetgenio.cpp │ │ │ ├── read_into_tetgenio.h │ │ │ ├── tetgenio_to_tetmesh.cpp │ │ │ ├── tetgenio_to_tetmesh.h │ │ │ ├── tetrahedralize.cpp │ │ │ └── tetrahedralize.h │ │ ├── cotmatrix.cpp │ │ ├── cotmatrix.h │ │ ├── cotmatrix_entries.cpp │ │ ├── cotmatrix_entries.h │ │ ├── count.cpp │ │ ├── count.h │ │ ├── covariance_scatter_matrix.cpp │ │ ├── covariance_scatter_matrix.h │ │ ├── cross.cpp │ │ ├── cross.h │ │ ├── cross_field_missmatch.cpp │ │ ├── cross_field_missmatch.h │ │ ├── crouzeix_raviart_cotmatrix.cpp │ │ ├── crouzeix_raviart_cotmatrix.h │ │ ├── crouzeix_raviart_massmatrix.cpp │ │ ├── crouzeix_raviart_massmatrix.h │ │ ├── cumsum.cpp │ │ ├── cumsum.h │ │ ├── cut_mesh.cpp │ │ ├── cut_mesh.h │ │ ├── cut_mesh_from_singularities.cpp │ │ ├── cut_mesh_from_singularities.h │ │ ├── cylinder.cpp │ │ ├── cylinder.h │ │ ├── dated_copy.cpp │ │ ├── dated_copy.h │ │ ├── decimate.cpp │ │ ├── decimate.h │ │ ├── deform_skeleton.cpp │ │ ├── deform_skeleton.h │ │ ├── delaunay_triangulation.cpp │ │ ├── delaunay_triangulation.h │ │ ├── deprecated.h │ │ ├── dfs.cpp │ │ ├── dfs.h │ │ ├── diag.cpp │ │ ├── diag.h │ │ ├── dihedral_angles.cpp │ │ ├── dihedral_angles.h │ │ ├── dijkstra.cpp │ │ ├── dijkstra.h │ │ ├── directed_edge_orientations.cpp │ │ ├── directed_edge_orientations.h │ │ ├── directed_edge_parents.cpp │ │ ├── directed_edge_parents.h │ │ ├── dirname.cpp │ │ ├── dirname.h │ │ ├── dot.cpp │ │ ├── dot.h │ │ ├── dot_row.cpp │ │ ├── dot_row.h │ │ ├── doublearea.cpp │ │ ├── doublearea.h │ │ ├── dqs.cpp │ │ ├── dqs.h │ │ ├── ears.cpp │ │ ├── ears.h │ │ ├── edge_collapse_is_valid.cpp │ │ ├── edge_collapse_is_valid.h │ │ ├── edge_flaps.cpp │ │ ├── edge_flaps.h │ │ ├── edge_lengths.cpp │ │ ├── edge_lengths.h │ │ ├── edge_topology.cpp │ │ ├── edge_topology.h │ │ ├── edges.cpp │ │ ├── edges.h │ │ ├── edges_to_path.cpp │ │ ├── edges_to_path.h │ │ ├── eigs.cpp │ │ ├── eigs.h │ │ ├── embree │ │ ├── EmbreeIntersector.h │ │ ├── Embree_convenience.h │ │ ├── ambient_occlusion.cpp │ │ ├── ambient_occlusion.h │ │ ├── bone_heat.cpp │ │ ├── bone_heat.h │ │ ├── bone_visible.cpp │ │ ├── bone_visible.h │ │ ├── line_mesh_intersection.cpp │ │ ├── line_mesh_intersection.h │ │ ├── reorient_facets_raycast.cpp │ │ ├── reorient_facets_raycast.h │ │ ├── shape_diameter_function.cpp │ │ ├── shape_diameter_function.h │ │ ├── unproject_in_mesh.cpp │ │ ├── unproject_in_mesh.h │ │ ├── unproject_onto_mesh.cpp │ │ └── unproject_onto_mesh.h │ │ ├── euler_characteristic.cpp │ │ ├── euler_characteristic.h │ │ ├── example_fun.cpp │ │ ├── example_fun.h │ │ ├── exterior_edges.cpp │ │ ├── exterior_edges.h │ │ ├── extract_manifold_patches.cpp │ │ ├── extract_manifold_patches.h │ │ ├── extract_non_manifold_edge_curves.cpp │ │ ├── extract_non_manifold_edge_curves.h │ │ ├── face_areas.cpp │ │ ├── face_areas.h │ │ ├── face_occurrences.cpp │ │ ├── face_occurrences.h │ │ ├── faces_first.cpp │ │ ├── faces_first.h │ │ ├── facet_components.cpp │ │ ├── facet_components.h │ │ ├── false_barycentric_subdivision.cpp │ │ ├── false_barycentric_subdivision.h │ │ ├── field_local_global_conversions.cpp │ │ ├── field_local_global_conversions.h │ │ ├── file_contents_as_string.cpp │ │ ├── file_contents_as_string.h │ │ ├── file_dialog_open.cpp │ │ ├── file_dialog_open.h │ │ ├── file_dialog_save.cpp │ │ ├── file_dialog_save.h │ │ ├── file_exists.cpp │ │ ├── file_exists.h │ │ ├── find.cpp │ │ ├── find.h │ │ ├── find_cross_field_singularities.cpp │ │ ├── find_cross_field_singularities.h │ │ ├── find_zero.cpp │ │ ├── find_zero.h │ │ ├── fit_plane.cpp │ │ ├── fit_plane.h │ │ ├── fit_rotations.cpp │ │ ├── fit_rotations.h │ │ ├── flip_avoiding_line_search.cpp │ │ ├── flip_avoiding_line_search.h │ │ ├── flip_edge.cpp │ │ ├── flip_edge.h │ │ ├── flipped_triangles.cpp │ │ ├── flipped_triangles.h │ │ ├── flood_fill.cpp │ │ ├── flood_fill.h │ │ ├── floor.cpp │ │ ├── floor.h │ │ ├── for_each.h │ │ ├── forward_kinematics.cpp │ │ ├── forward_kinematics.h │ │ ├── frame_field_deformer.cpp │ │ ├── frame_field_deformer.h │ │ ├── frame_to_cross_field.cpp │ │ ├── frame_to_cross_field.h │ │ ├── frustum.cpp │ │ ├── frustum.h │ │ ├── gaussian_curvature.cpp │ │ ├── gaussian_curvature.h │ │ ├── get_seconds.cpp │ │ ├── get_seconds.h │ │ ├── get_seconds_hires.cpp │ │ ├── get_seconds_hires.h │ │ ├── grad.cpp │ │ ├── grad.h │ │ ├── grid.cpp │ │ ├── grid.h │ │ ├── grid_search.cpp │ │ ├── grid_search.h │ │ ├── group_sum_matrix.cpp │ │ ├── group_sum_matrix.h │ │ ├── guess_extension.cpp │ │ ├── guess_extension.h │ │ ├── harmonic.cpp │ │ ├── harmonic.h │ │ ├── harwell_boeing.cpp │ │ ├── harwell_boeing.h │ │ ├── hausdorff.cpp │ │ ├── hausdorff.h │ │ ├── hessian.cpp │ │ ├── hessian.h │ │ ├── hessian_energy.cpp │ │ ├── hessian_energy.h │ │ ├── histc.cpp │ │ ├── histc.h │ │ ├── hsv_to_rgb.cpp │ │ ├── hsv_to_rgb.h │ │ ├── igl_inline.h │ │ ├── in_element.cpp │ │ ├── in_element.h │ │ ├── infinite_cost_stopping_condition.cpp │ │ ├── infinite_cost_stopping_condition.h │ │ ├── inradius.cpp │ │ ├── inradius.h │ │ ├── integrable_polyvector_fields.cpp │ │ ├── integrable_polyvector_fields.h │ │ ├── internal_angles.cpp │ │ ├── internal_angles.h │ │ ├── intersect.cpp │ │ ├── intersect.h │ │ ├── invert_diag.cpp │ │ ├── invert_diag.h │ │ ├── is_border_vertex.cpp │ │ ├── is_border_vertex.h │ │ ├── is_boundary_edge.cpp │ │ ├── is_boundary_edge.h │ │ ├── is_dir.cpp │ │ ├── is_dir.h │ │ ├── is_edge_manifold.cpp │ │ ├── is_edge_manifold.h │ │ ├── is_file.cpp │ │ ├── is_file.h │ │ ├── is_irregular_vertex.cpp │ │ ├── is_irregular_vertex.h │ │ ├── is_planar.cpp │ │ ├── is_planar.h │ │ ├── is_readable.cpp │ │ ├── is_readable.h │ │ ├── is_sparse.cpp │ │ ├── is_sparse.h │ │ ├── is_stl.cpp │ │ ├── is_stl.h │ │ ├── is_symmetric.cpp │ │ ├── is_symmetric.h │ │ ├── is_vertex_manifold.cpp │ │ ├── is_vertex_manifold.h │ │ ├── is_writable.cpp │ │ ├── is_writable.h │ │ ├── isdiag.cpp │ │ ├── isdiag.h │ │ ├── ismember.cpp │ │ ├── ismember.h │ │ ├── isolines.cpp │ │ ├── isolines.h │ │ ├── jet.cpp │ │ ├── jet.h │ │ ├── launch_medit.cpp │ │ ├── launch_medit.h │ │ ├── lbs_matrix.cpp │ │ ├── lbs_matrix.h │ │ ├── lexicographic_triangulation.cpp │ │ ├── lexicographic_triangulation.h │ │ ├── lim │ │ ├── lim.cpp │ │ └── lim.h │ │ ├── limit_faces.cpp │ │ ├── limit_faces.h │ │ ├── line_field_missmatch.cpp │ │ ├── line_field_missmatch.h │ │ ├── line_search.cpp │ │ ├── line_search.h │ │ ├── line_segment_in_rectangle.cpp │ │ ├── line_segment_in_rectangle.h │ │ ├── linprog.cpp │ │ ├── linprog.h │ │ ├── list_to_matrix.cpp │ │ ├── list_to_matrix.h │ │ ├── local_basis.cpp │ │ ├── local_basis.h │ │ ├── look_at.cpp │ │ ├── look_at.h │ │ ├── loop.cpp │ │ ├── loop.h │ │ ├── lscm.cpp │ │ ├── lscm.h │ │ ├── map_vertices_to_circle.cpp │ │ ├── map_vertices_to_circle.h │ │ ├── massmatrix.cpp │ │ ├── massmatrix.h │ │ ├── mat_max.cpp │ │ ├── mat_max.h │ │ ├── mat_min.cpp │ │ ├── mat_min.h │ │ ├── mat_to_quat.cpp │ │ ├── mat_to_quat.h │ │ ├── material_colors.h │ │ ├── matlab │ │ ├── MatlabWorkspace.h │ │ ├── MexStream.h │ │ ├── matlabinterface.cpp │ │ ├── matlabinterface.h │ │ ├── mexErrMsgTxt.cpp │ │ ├── mexErrMsgTxt.h │ │ ├── parse_rhs.cpp │ │ ├── parse_rhs.h │ │ ├── prepare_lhs.cpp │ │ ├── prepare_lhs.h │ │ ├── requires_arg.cpp │ │ ├── requires_arg.h │ │ ├── validate_arg.cpp │ │ └── validate_arg.h │ │ ├── matlab_format.cpp │ │ ├── matlab_format.h │ │ ├── matrix_to_list.cpp │ │ ├── matrix_to_list.h │ │ ├── max.cpp │ │ ├── max.h │ │ ├── max_faces_stopping_condition.cpp │ │ ├── max_faces_stopping_condition.h │ │ ├── max_size.cpp │ │ ├── max_size.h │ │ ├── median.cpp │ │ ├── median.h │ │ ├── min.cpp │ │ ├── min.h │ │ ├── min_quad_dense.cpp │ │ ├── min_quad_dense.h │ │ ├── min_quad_with_fixed.cpp │ │ ├── min_quad_with_fixed.h │ │ ├── min_size.cpp │ │ ├── min_size.h │ │ ├── mod.cpp │ │ ├── mod.h │ │ ├── mode.cpp │ │ ├── mode.h │ │ ├── mosek │ │ ├── bbw.cpp │ │ ├── bbw.h │ │ ├── mosek_guarded.cpp │ │ ├── mosek_guarded.h │ │ ├── mosek_linprog.cpp │ │ ├── mosek_linprog.h │ │ ├── mosek_quadprog.cpp │ │ └── mosek_quadprog.h │ │ ├── mvc.cpp │ │ ├── mvc.h │ │ ├── n_polyvector.cpp │ │ ├── n_polyvector.h │ │ ├── n_polyvector_general.cpp │ │ ├── n_polyvector_general.h │ │ ├── nchoosek.cpp │ │ ├── nchoosek.h │ │ ├── next_filename.cpp │ │ ├── next_filename.h │ │ ├── normal_derivative.cpp │ │ ├── normal_derivative.h │ │ ├── normalize_quat.cpp │ │ ├── normalize_quat.h │ │ ├── normalize_row_lengths.cpp │ │ ├── normalize_row_lengths.h │ │ ├── normalize_row_sums.cpp │ │ ├── normalize_row_sums.h │ │ ├── null.cpp │ │ ├── null.h │ │ ├── on_boundary.cpp │ │ ├── on_boundary.h │ │ ├── opengl │ │ ├── create_index_vbo.cpp │ │ ├── create_index_vbo.h │ │ ├── create_mesh_vbo.cpp │ │ ├── create_mesh_vbo.h │ │ ├── create_shader_program.cpp │ │ ├── create_shader_program.h │ │ ├── create_vector_vbo.cpp │ │ ├── create_vector_vbo.h │ │ ├── destroy_shader_program.cpp │ │ ├── destroy_shader_program.h │ │ ├── gl.h │ │ ├── gl_type_size.cpp │ │ ├── gl_type_size.h │ │ ├── glfw │ │ │ ├── background_window.cpp │ │ │ ├── background_window.h │ │ │ ├── map_texture.cpp │ │ │ └── map_texture.h │ │ ├── init_render_to_texture.cpp │ │ ├── init_render_to_texture.h │ │ ├── load_shader.cpp │ │ ├── load_shader.h │ │ ├── print_program_info_log.cpp │ │ ├── print_program_info_log.h │ │ ├── print_shader_info_log.cpp │ │ ├── print_shader_info_log.h │ │ ├── report_gl_error.cpp │ │ ├── report_gl_error.h │ │ ├── uniform_type_to_string.cpp │ │ ├── uniform_type_to_string.h │ │ ├── vertex_array.cpp │ │ └── vertex_array.h │ │ ├── opengl2 │ │ ├── MouseController.h │ │ ├── RotateWidget.h │ │ ├── TranslateWidget.h │ │ ├── draw_beach_ball.cpp │ │ ├── draw_beach_ball.h │ │ ├── draw_floor.cpp │ │ ├── draw_floor.h │ │ ├── draw_mesh.cpp │ │ ├── draw_mesh.h │ │ ├── draw_point.cpp │ │ ├── draw_point.h │ │ ├── draw_rectangular_marquee.cpp │ │ ├── draw_rectangular_marquee.h │ │ ├── draw_skeleton_3d.cpp │ │ ├── draw_skeleton_3d.h │ │ ├── draw_skeleton_vector_graphics.cpp │ │ ├── draw_skeleton_vector_graphics.h │ │ ├── flare_textures.h │ │ ├── gl.h │ │ ├── glext.h │ │ ├── glu.h │ │ ├── lens_flare.cpp │ │ ├── lens_flare.h │ │ ├── model_proj_viewport.cpp │ │ ├── model_proj_viewport.h │ │ ├── print_gl_get.cpp │ │ ├── print_gl_get.h │ │ ├── project.cpp │ │ ├── project.h │ │ ├── right_axis.cpp │ │ ├── right_axis.h │ │ ├── shine_textures.h │ │ ├── sort_triangles.cpp │ │ ├── sort_triangles.h │ │ ├── unproject.cpp │ │ ├── unproject.h │ │ ├── unproject_to_zero_plane.cpp │ │ ├── unproject_to_zero_plane.h │ │ ├── up_axis.cpp │ │ ├── up_axis.h │ │ ├── view_axis.cpp │ │ └── view_axis.h │ │ ├── orient_outward.cpp │ │ ├── orient_outward.h │ │ ├── orientable_patches.cpp │ │ ├── orientable_patches.h │ │ ├── oriented_facets.cpp │ │ ├── oriented_facets.h │ │ ├── orth.cpp │ │ ├── orth.h │ │ ├── ortho.cpp │ │ ├── ortho.h │ │ ├── outer_element.cpp │ │ ├── outer_element.h │ │ ├── parallel_for.h │ │ ├── parallel_transport_angles.cpp │ │ ├── parallel_transport_angles.h │ │ ├── partition.cpp │ │ ├── partition.h │ │ ├── parula.cpp │ │ ├── parula.h │ │ ├── path_to_executable.cpp │ │ ├── path_to_executable.h │ │ ├── pathinfo.cpp │ │ ├── pathinfo.h │ │ ├── per_corner_normals.cpp │ │ ├── per_corner_normals.h │ │ ├── per_edge_normals.cpp │ │ ├── per_edge_normals.h │ │ ├── per_face_normals.cpp │ │ ├── per_face_normals.h │ │ ├── per_vertex_attribute_smoothing.cpp │ │ ├── per_vertex_attribute_smoothing.h │ │ ├── per_vertex_normals.cpp │ │ ├── per_vertex_normals.h │ │ ├── per_vertex_point_to_plane_quadrics.cpp │ │ ├── per_vertex_point_to_plane_quadrics.h │ │ ├── piecewise_constant_winding_number.cpp │ │ ├── piecewise_constant_winding_number.h │ │ ├── pinv.cpp │ │ ├── pinv.h │ │ ├── planarize_quad_mesh.cpp │ │ ├── planarize_quad_mesh.h │ │ ├── ply.h │ │ ├── png │ │ ├── readPNG.cpp │ │ ├── readPNG.h │ │ ├── render_to_png.cpp │ │ ├── render_to_png.h │ │ ├── render_to_png_async.cpp │ │ ├── render_to_png_async.h │ │ ├── texture_from_file.cpp │ │ ├── texture_from_file.h │ │ ├── texture_from_png.cpp │ │ ├── texture_from_png.h │ │ ├── writePNG.cpp │ │ └── writePNG.h │ │ ├── point_in_circle.cpp │ │ ├── point_in_circle.h │ │ ├── point_in_poly.cpp │ │ ├── point_in_poly.h │ │ ├── point_mesh_squared_distance.cpp │ │ ├── point_mesh_squared_distance.h │ │ ├── point_simplex_squared_distance.cpp │ │ ├── point_simplex_squared_distance.h │ │ ├── polar_dec.cpp │ │ ├── polar_dec.h │ │ ├── polar_svd.cpp │ │ ├── polar_svd.h │ │ ├── polar_svd3x3.cpp │ │ ├── polar_svd3x3.h │ │ ├── polygon_mesh_to_triangle_mesh.cpp │ │ ├── polygon_mesh_to_triangle_mesh.h │ │ ├── polyroots.cpp │ │ ├── polyroots.h │ │ ├── polyvector_field_comb_from_matchings_and_cuts.cpp │ │ ├── polyvector_field_comb_from_matchings_and_cuts.h │ │ ├── polyvector_field_cut_mesh_with_singularities.cpp │ │ ├── polyvector_field_cut_mesh_with_singularities.h │ │ ├── polyvector_field_matchings.cpp │ │ ├── polyvector_field_matchings.h │ │ ├── polyvector_field_poisson_reconstruction.cpp │ │ ├── polyvector_field_poisson_reconstruction.h │ │ ├── polyvector_field_singularities_from_matchings.cpp │ │ ├── polyvector_field_singularities_from_matchings.h │ │ ├── principal_curvature.cpp │ │ ├── principal_curvature.h │ │ ├── print_ijv.cpp │ │ ├── print_ijv.h │ │ ├── print_vector.cpp │ │ ├── print_vector.h │ │ ├── procrustes.cpp │ │ ├── procrustes.h │ │ ├── project.cpp │ │ ├── project.h │ │ ├── project_isometrically_to_plane.cpp │ │ ├── project_isometrically_to_plane.h │ │ ├── project_to_line.cpp │ │ ├── project_to_line.h │ │ ├── project_to_line_segment.cpp │ │ ├── project_to_line_segment.h │ │ ├── pseudonormal_test.cpp │ │ ├── pseudonormal_test.h │ │ ├── pso.cpp │ │ ├── pso.h │ │ ├── qslim.cpp │ │ ├── qslim.h │ │ ├── qslim_optimal_collapse_edge_callbacks.cpp │ │ ├── qslim_optimal_collapse_edge_callbacks.h │ │ ├── quad_planarity.cpp │ │ ├── quad_planarity.h │ │ ├── quadric_binary_plus_operator.cpp │ │ ├── quadric_binary_plus_operator.h │ │ ├── quat_conjugate.cpp │ │ ├── quat_conjugate.h │ │ ├── quat_mult.cpp │ │ ├── quat_mult.h │ │ ├── quat_to_axis_angle.cpp │ │ ├── quat_to_axis_angle.h │ │ ├── quat_to_mat.cpp │ │ ├── quat_to_mat.h │ │ ├── quats_to_column.cpp │ │ ├── quats_to_column.h │ │ ├── ramer_douglas_peucker.cpp │ │ ├── ramer_douglas_peucker.h │ │ ├── random_dir.cpp │ │ ├── random_dir.h │ │ ├── random_points_on_mesh.cpp │ │ ├── random_points_on_mesh.h │ │ ├── random_quaternion.cpp │ │ ├── random_quaternion.h │ │ ├── random_search.cpp │ │ ├── random_search.h │ │ ├── randperm.cpp │ │ ├── randperm.h │ │ ├── ray_box_intersect.cpp │ │ ├── ray_box_intersect.h │ │ ├── ray_mesh_intersect.cpp │ │ ├── ray_mesh_intersect.h │ │ ├── ray_sphere_intersect.cpp │ │ ├── ray_sphere_intersect.h │ │ ├── raytri.c │ │ ├── readBF.cpp │ │ ├── readBF.h │ │ ├── readCSV.cpp │ │ ├── readCSV.h │ │ ├── readDMAT.cpp │ │ ├── readDMAT.h │ │ ├── readMESH.cpp │ │ ├── readMESH.h │ │ ├── readNODE.cpp │ │ ├── readNODE.h │ │ ├── readOBJ.cpp │ │ ├── readOBJ.h │ │ ├── readOFF.cpp │ │ ├── readOFF.h │ │ ├── readPLY.cpp │ │ ├── readPLY.h │ │ ├── readSTL.cpp │ │ ├── readSTL.h │ │ ├── readTGF.cpp │ │ ├── readTGF.h │ │ ├── readWRL.cpp │ │ ├── readWRL.h │ │ ├── read_triangle_mesh.cpp │ │ ├── read_triangle_mesh.h │ │ ├── redux.h │ │ ├── remove_duplicate_vertices.cpp │ │ ├── remove_duplicate_vertices.h │ │ ├── remove_duplicates.cpp │ │ ├── remove_duplicates.h │ │ ├── remove_unreferenced.cpp │ │ ├── remove_unreferenced.h │ │ ├── reorder.cpp │ │ ├── reorder.h │ │ ├── repdiag.cpp │ │ ├── repdiag.h │ │ ├── repmat.cpp │ │ ├── repmat.h │ │ ├── resolve_duplicated_faces.cpp │ │ ├── resolve_duplicated_faces.h │ │ ├── rgb_to_hsv.cpp │ │ ├── rgb_to_hsv.h │ │ ├── rotate_by_quat.cpp │ │ ├── rotate_by_quat.h │ │ ├── rotate_vectors.cpp │ │ ├── rotate_vectors.h │ │ ├── rotation_matrix_from_directions.cpp │ │ ├── rotation_matrix_from_directions.h │ │ ├── round.cpp │ │ ├── round.h │ │ ├── rows_to_matrix.cpp │ │ ├── rows_to_matrix.h │ │ ├── sample_edges.cpp │ │ ├── sample_edges.h │ │ ├── seam_edges.cpp │ │ ├── seam_edges.h │ │ ├── segment_segment_intersect.cpp │ │ ├── segment_segment_intersect.h │ │ ├── serialize.h │ │ ├── setdiff.cpp │ │ ├── setdiff.h │ │ ├── setunion.cpp │ │ ├── setunion.h │ │ ├── setxor.cpp │ │ ├── setxor.h │ │ ├── shape_diameter_function.cpp │ │ ├── shape_diameter_function.h │ │ ├── shortest_edge_and_midpoint.cpp │ │ ├── shortest_edge_and_midpoint.h │ │ ├── signed_angle.cpp │ │ ├── signed_angle.h │ │ ├── signed_distance.cpp │ │ ├── signed_distance.h │ │ ├── simplify_polyhedron.cpp │ │ ├── simplify_polyhedron.h │ │ ├── slice.cpp │ │ ├── slice.h │ │ ├── slice_cached.cpp │ │ ├── slice_cached.h │ │ ├── slice_into.cpp │ │ ├── slice_into.h │ │ ├── slice_mask.cpp │ │ ├── slice_mask.h │ │ ├── slice_tets.cpp │ │ ├── slice_tets.h │ │ ├── slim.cpp │ │ ├── slim.h │ │ ├── snap_points.cpp │ │ ├── snap_points.h │ │ ├── snap_to_canonical_view_quat.cpp │ │ ├── snap_to_canonical_view_quat.h │ │ ├── snap_to_fixed_up.cpp │ │ ├── snap_to_fixed_up.h │ │ ├── solid_angle.cpp │ │ ├── solid_angle.h │ │ ├── sort.cpp │ │ ├── sort.h │ │ ├── sort_angles.cpp │ │ ├── sort_angles.h │ │ ├── sort_triangles.cpp │ │ ├── sort_triangles.h │ │ ├── sort_vectors_ccw.cpp │ │ ├── sort_vectors_ccw.h │ │ ├── sortrows.cpp │ │ ├── sortrows.h │ │ ├── sparse.cpp │ │ ├── sparse.h │ │ ├── sparse_cached.cpp │ │ ├── sparse_cached.h │ │ ├── speye.cpp │ │ ├── speye.h │ │ ├── squared_edge_lengths.cpp │ │ ├── squared_edge_lengths.h │ │ ├── stdin_to_temp.cpp │ │ ├── stdin_to_temp.h │ │ ├── straighten_seams.cpp │ │ ├── straighten_seams.h │ │ ├── streamlines.cpp │ │ ├── streamlines.h │ │ ├── sum.cpp │ │ ├── sum.h │ │ ├── svd3x3.cpp │ │ ├── svd3x3.h │ │ ├── svd3x3_avx.cpp │ │ ├── svd3x3_avx.h │ │ ├── svd3x3_sse.cpp │ │ ├── svd3x3_sse.h │ │ ├── swept_volume_bounding_box.cpp │ │ ├── swept_volume_bounding_box.h │ │ ├── swept_volume_signed_distance.cpp │ │ ├── swept_volume_signed_distance.h │ │ ├── trackball.cpp │ │ ├── trackball.h │ │ ├── transpose_blocks.cpp │ │ ├── transpose_blocks.h │ │ ├── triangle │ │ ├── cdt.cpp │ │ ├── cdt.h │ │ ├── triangulate.cpp │ │ └── triangulate.h │ │ ├── triangle_fan.cpp │ │ ├── triangle_fan.h │ │ ├── triangle_triangle_adjacency.cpp │ │ ├── triangle_triangle_adjacency.h │ │ ├── triangles_from_strip.cpp │ │ ├── triangles_from_strip.h │ │ ├── two_axis_valuator_fixed_up.cpp │ │ ├── two_axis_valuator_fixed_up.h │ │ ├── uniformly_sample_two_manifold.cpp │ │ ├── uniformly_sample_two_manifold.h │ │ ├── unique.cpp │ │ ├── unique.h │ │ ├── unique_edge_map.cpp │ │ ├── unique_edge_map.h │ │ ├── unique_rows.cpp │ │ ├── unique_rows.h │ │ ├── unique_simplices.cpp │ │ ├── unique_simplices.h │ │ ├── unproject.cpp │ │ ├── unproject.h │ │ ├── unproject_in_mesh.cpp │ │ ├── unproject_in_mesh.h │ │ ├── unproject_onto_mesh.cpp │ │ ├── unproject_onto_mesh.h │ │ ├── unproject_ray.cpp │ │ ├── unproject_ray.h │ │ ├── unzip_corners.cpp │ │ ├── unzip_corners.h │ │ ├── upsample.cpp │ │ ├── upsample.h │ │ ├── vector_area_matrix.cpp │ │ ├── vector_area_matrix.h │ │ ├── verbose.h │ │ ├── vertex_triangle_adjacency.cpp │ │ ├── vertex_triangle_adjacency.h │ │ ├── viewer │ │ ├── OpenGL_shader.cpp │ │ ├── OpenGL_shader.h │ │ ├── OpenGL_state.cpp │ │ ├── OpenGL_state.h │ │ ├── TODOs.txt │ │ ├── TextRenderer.cpp │ │ ├── TextRenderer.h │ │ ├── TextRenderer_fonts.cpp │ │ ├── TextRenderer_fonts.h │ │ ├── Viewer.cpp │ │ ├── Viewer.h │ │ ├── ViewerCore.cpp │ │ ├── ViewerCore.h │ │ ├── ViewerData.cpp │ │ ├── ViewerData.h │ │ └── ViewerPlugin.h │ │ ├── volume.cpp │ │ ├── volume.h │ │ ├── voxel_grid.cpp │ │ ├── voxel_grid.h │ │ ├── winding_number.cpp │ │ ├── winding_number.h │ │ ├── writeBF.cpp │ │ ├── writeBF.h │ │ ├── writeDMAT.cpp │ │ ├── writeDMAT.h │ │ ├── writeMESH.cpp │ │ ├── writeMESH.h │ │ ├── writeOBJ.cpp │ │ ├── writeOBJ.h │ │ ├── writeOFF.cpp │ │ ├── writeOFF.h │ │ ├── writePLY.cpp │ │ ├── writePLY.h │ │ ├── writeSTL.cpp │ │ ├── writeSTL.h │ │ ├── writeTGF.cpp │ │ ├── writeTGF.h │ │ ├── writeWRL.cpp │ │ ├── writeWRL.h │ │ ├── write_triangle_mesh.cpp │ │ ├── write_triangle_mesh.h │ │ └── xml │ │ ├── ReAntTweakBarXMLSerialization.h │ │ ├── XMLSerializable.h │ │ ├── serialization_test.skip │ │ ├── serialize_xml.cpp │ │ ├── serialize_xml.h │ │ ├── writeDAE.cpp │ │ ├── writeDAE.h │ │ ├── write_triangle_mesh.cpp │ │ └── write_triangle_mesh.h ├── rply │ ├── LICENSE │ ├── rply.c │ └── rply.h ├── scaffold-map │ └── igl │ │ ├── scaf.cpp │ │ └── scaf.h └── stb │ └── stb_image_write.h ├── glsl ├── blinnphong.frag ├── clear.frag ├── clear.vert ├── constant_color.frag ├── cylinder.frag ├── cylinder.geom ├── cylinder.vert ├── flat_shading.geom ├── mesh_colors_quad.tcs ├── mesh_colors_quad.tes ├── mesh_colors_tri.tcs ├── mesh_colors_tri.tes ├── mesh_flat.vert ├── simple.vert ├── sphere.frag ├── sphere.geom ├── sphere.vert └── void.vert ├── include ├── ArclengthStrategyGurobi.h ├── ArclengthStrategyGurobiSeparate.h ├── ArclengthStrategySimple.h ├── Data.h ├── FencedRegion.h ├── FencedRegionRepresentativeCalculator.h ├── ManifoldnessAwareVertexMap.h ├── MotorcycleGraph.h ├── MotorcycleOptionsInPatch.h ├── MultiplierStrategyAllInvalid.h ├── MultiplierStrategyIterativeRounding.h ├── Parametrization.h ├── ParametrizationData.h ├── ParametrizationHelper.h ├── ParametrizationInterfaces.h ├── ParametrizationStrategyLSCMForInteriorScaffoldForBoundary.h ├── Patch.h ├── PatchSet.h ├── PatchSplittingProblem.h ├── PolygonTriangulation.h ├── Singularity.h ├── Statistics.h ├── TargetLengthStrategyPatchAverage.h ├── TargetLengthStrategySimple.h ├── TexturePatch.h ├── common.h ├── gui │ ├── ShaderPool.h │ └── Viewer.h └── meshio.h └── src ├── ArclengthStrategyGurobi.cpp ├── ArclengthStrategyGurobiSeparate.cpp ├── Data.cpp ├── FencedRegion.cpp ├── FencedRegionRepresentativeCalculator.cpp ├── MotorcycleGraph.cpp ├── MultiplierStrategyIterativeRounding.cpp ├── Parametrization.cpp ├── ParametrizationData.cpp ├── ParametrizationHelper.cpp ├── ParametrizationStrategyLSCMForInteriorScaffoldForBoundary.cpp ├── Patch.cpp ├── PolygonTriangulation.cpp ├── Singularity.cpp ├── Statistics.cpp ├── TexturePatch.cpp ├── common.cpp ├── gui ├── ShaderPool.cpp └── Viewer.cpp ├── main.cpp ├── meshio.cpp └── stbi_impl.cpp /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | 3 | .vs 4 | 5 | # Prerequisites 6 | *.d 7 | 8 | # Compiled Object files 9 | *.slo 10 | *.lo 11 | *.o 12 | *.obj 13 | 14 | # Precompiled Headers 15 | *.gch 16 | *.pch 17 | 18 | # Compiled Dynamic libraries 19 | *.so 20 | *.dylib 21 | *.dll 22 | 23 | # Fortran module files 24 | *.mod 25 | *.smod 26 | 27 | # Compiled Static libraries 28 | *.lai 29 | *.la 30 | *.a 31 | *.lib 32 | 33 | # Executables 34 | *.exe 35 | *.out 36 | *.app 37 | /CMakeSettings.json 38 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "ext/nsessentials"] 2 | path = ext/nsessentials 3 | url = https://github.com/NSchertler/NSEssentials 4 | [submodule "ext/nanogui"] 5 | path = ext/nanogui 6 | url = https://github.com/NSchertler/nanogui 7 | [submodule "ext/OpenMesh"] 8 | path = ext/OpenMesh 9 | url = https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh.git 10 | -------------------------------------------------------------------------------- /data.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSchertler/GeneralizedMotorcycleGraph/a34738fe34a051760b4042dc9d740231e511fec1/data.zip -------------------------------------------------------------------------------- /ext/RectangleBinPack/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 2.8) 2 | 3 | project("RectangleBinPack") 4 | 5 | include_directories(include/RectangleBinPack) 6 | 7 | add_library(RectangleBinPack STATIC 8 | src/GuillotineBinPack.cpp 9 | src/MaxRectsBinPack.cpp 10 | src/Rect.cpp 11 | src/ShelfBinPack.cpp 12 | src/ShelfNextFitBinPack.cpp 13 | src/SkylineBinPack.cpp) -------------------------------------------------------------------------------- /ext/RectangleBinPack/Readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSchertler/GeneralizedMotorcycleGraph/a34738fe34a051760b4042dc9d740231e511fec1/ext/RectangleBinPack/Readme.txt -------------------------------------------------------------------------------- /ext/RectangleBinPack/include/RectangleBinPack/MaxRectsBinPack.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSchertler/GeneralizedMotorcycleGraph/a34738fe34a051760b4042dc9d740231e511fec1/ext/RectangleBinPack/include/RectangleBinPack/MaxRectsBinPack.h -------------------------------------------------------------------------------- /ext/RectangleBinPack/include/RectangleBinPack/Rect.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSchertler/GeneralizedMotorcycleGraph/a34738fe34a051760b4042dc9d740231e511fec1/ext/RectangleBinPack/include/RectangleBinPack/Rect.h -------------------------------------------------------------------------------- /ext/RectangleBinPack/src/GuillotineBinPack.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSchertler/GeneralizedMotorcycleGraph/a34738fe34a051760b4042dc9d740231e511fec1/ext/RectangleBinPack/src/GuillotineBinPack.cpp -------------------------------------------------------------------------------- /ext/RectangleBinPack/src/GuillotineBinPack.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSchertler/GeneralizedMotorcycleGraph/a34738fe34a051760b4042dc9d740231e511fec1/ext/RectangleBinPack/src/GuillotineBinPack.h -------------------------------------------------------------------------------- /ext/RectangleBinPack/src/MaxRectsBinPack.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSchertler/GeneralizedMotorcycleGraph/a34738fe34a051760b4042dc9d740231e511fec1/ext/RectangleBinPack/src/MaxRectsBinPack.cpp -------------------------------------------------------------------------------- /ext/RectangleBinPack/src/Rect.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSchertler/GeneralizedMotorcycleGraph/a34738fe34a051760b4042dc9d740231e511fec1/ext/RectangleBinPack/src/Rect.cpp -------------------------------------------------------------------------------- /ext/RectangleBinPack/src/ShelfBinPack.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSchertler/GeneralizedMotorcycleGraph/a34738fe34a051760b4042dc9d740231e511fec1/ext/RectangleBinPack/src/ShelfBinPack.cpp -------------------------------------------------------------------------------- /ext/RectangleBinPack/src/ShelfBinPack.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSchertler/GeneralizedMotorcycleGraph/a34738fe34a051760b4042dc9d740231e511fec1/ext/RectangleBinPack/src/ShelfBinPack.h -------------------------------------------------------------------------------- /ext/RectangleBinPack/src/ShelfNextFitBinPack.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSchertler/GeneralizedMotorcycleGraph/a34738fe34a051760b4042dc9d740231e511fec1/ext/RectangleBinPack/src/ShelfNextFitBinPack.cpp -------------------------------------------------------------------------------- /ext/RectangleBinPack/src/ShelfNextFitBinPack.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSchertler/GeneralizedMotorcycleGraph/a34738fe34a051760b4042dc9d740231e511fec1/ext/RectangleBinPack/src/ShelfNextFitBinPack.h -------------------------------------------------------------------------------- /ext/RectangleBinPack/src/SkylineBinPack.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSchertler/GeneralizedMotorcycleGraph/a34738fe34a051760b4042dc9d740231e511fec1/ext/RectangleBinPack/src/SkylineBinPack.cpp -------------------------------------------------------------------------------- /ext/RectangleBinPack/src/SkylineBinPack.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSchertler/GeneralizedMotorcycleGraph/a34738fe34a051760b4042dc9d740231e511fec1/ext/RectangleBinPack/src/SkylineBinPack.h -------------------------------------------------------------------------------- /ext/libigl/external/triangle/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.12) 2 | project(triangle) 3 | 4 | add_library(triangle STATIC triangle.c) 5 | target_compile_definitions(triangle PRIVATE -DTRILIBRARY -DANSI_DECLARATORS) 6 | if(WIN32) 7 | target_compile_definitions(triangle PRIVATE -DNO_TIMER) 8 | endif() 9 | -------------------------------------------------------------------------------- /ext/libigl/igl/C_STR.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_C_STR_H 9 | #define IGL_C_STR_H 10 | // http://stackoverflow.com/a/2433143/148668 11 | // Suppose you have a function: 12 | // void func(const char * c); 13 | // Then you can write: 14 | // func(C_STR("foo"<<1<<"bar")); 15 | #include 16 | #include 17 | #define C_STR(X) static_cast(std::ostringstream().flush() << X).str().c_str() 18 | #endif 19 | -------------------------------------------------------------------------------- /ext/libigl/igl/EPS.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "EPS.h" 9 | 10 | template <> IGL_INLINE float igl::EPS() 11 | { 12 | return igl::FLOAT_EPS; 13 | } 14 | template <> IGL_INLINE double igl::EPS() 15 | { 16 | return igl::DOUBLE_EPS; 17 | } 18 | 19 | template <> IGL_INLINE float igl::EPS_SQ() 20 | { 21 | return igl::FLOAT_EPS_SQ; 22 | } 23 | template <> IGL_INLINE double igl::EPS_SQ() 24 | { 25 | return igl::DOUBLE_EPS_SQ; 26 | } 27 | 28 | #ifdef IGL_STATIC_LIBRARY 29 | // Explicit template instantiation 30 | #endif 31 | -------------------------------------------------------------------------------- /ext/libigl/igl/Hit.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 2014 Christian Schüller 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla Public License 7 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 8 | // obtain one at http://mozilla.org/MPL/2.0/. 9 | #ifndef IGL_HIT_H 10 | #define IGL_HIT_H 11 | 12 | namespace igl 13 | { 14 | // Reimplementation of the embree::Hit struct from embree1.0 15 | // 16 | // TODO: template on floating point type 17 | struct Hit 18 | { 19 | int id; // primitive id 20 | int gid; // geometry id 21 | float u,v; // barycentric coordinates 22 | float t; // distance = direction*t to intersection 23 | }; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /ext/libigl/igl/IO: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_IO 9 | #define IGL_IO 10 | // Input and output functions 11 | #include "read_triangle_mesh.h" 12 | #include "readDMAT.h" 13 | #include "readMESH.h" 14 | #include "readNODE.h" 15 | #include "readOBJ.h" 16 | #include "readOFF.h" 17 | #include "readTGF.h" 18 | #include "readWRL.h" 19 | #include "readCSV.h" 20 | #include "file_contents_as_string.h" 21 | #include "write_triangle_mesh.h" 22 | #include "writeDMAT.h" 23 | #include "writeMESH.h" 24 | #include "writeOBJ.h" 25 | #include "writeOFF.h" 26 | #include "writeTGF.h" 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /ext/libigl/igl/MeshBooleanType.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_MESH_BOOLEAN_TYPE_H 9 | #define IGL_MESH_BOOLEAN_TYPE_H 10 | namespace igl 11 | { 12 | enum MeshBooleanType 13 | { 14 | MESH_BOOLEAN_TYPE_UNION = 0, 15 | MESH_BOOLEAN_TYPE_INTERSECT = 1, 16 | MESH_BOOLEAN_TYPE_MINUS = 2, 17 | MESH_BOOLEAN_TYPE_XOR = 3, 18 | MESH_BOOLEAN_TYPE_RESOLVE = 4, 19 | NUM_MESH_BOOLEAN_TYPES = 5 20 | }; 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /ext/libigl/igl/NormalType.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_NORMALTYPE_H 9 | #define IGL_NORMALTYPE_H 10 | 11 | namespace igl 12 | { 13 | // PER_VERTEX_NORMALS Normals computed per vertex based on incident faces 14 | // PER_FACE_NORMALS Normals computed per face 15 | // PER_CORNER_NORMALS Normals computed per corner (aka wedge) based on 16 | // incident faces without sharp edge 17 | enum NormalType 18 | { 19 | PER_VERTEX_NORMALS, 20 | PER_FACE_NORMALS, 21 | PER_CORNER_NORMALS 22 | }; 23 | # define NUM_NORMAL_TYPE 3 24 | } 25 | 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /ext/libigl/igl/ONE.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ONE_H 9 | #define IGL_ONE_H 10 | namespace igl 11 | { 12 | // Often one needs a reference to a dummy variable containing one as its 13 | // value, for example when using AntTweakBar's 14 | // TwSetParam( "3D View", "opened", TW_PARAM_INT32, 1, &INT_ONE); 15 | const char CHAR_ONE = 1; 16 | const int INT_ONE = 1; 17 | const unsigned int UNSIGNED_INT_ONE = 1; 18 | const double DOUBLE_ONE = 1; 19 | const float FLOAT_ONE = 1; 20 | } 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /ext/libigl/igl/PI.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_PI_H 9 | #define IGL_PI_H 10 | namespace igl 11 | { 12 | // Use standard mathematical constants' M_PI if available 13 | #ifdef M_PI 14 | const double PI = M_PI; 15 | #else 16 | const double PI = 3.1415926535897932384626433832795; 17 | #endif 18 | } 19 | #endif 20 | -------------------------------------------------------------------------------- /ext/libigl/igl/STR.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_STR_H 9 | #define IGL_STR_H 10 | // http://stackoverflow.com/a/2433143/148668 11 | #include 12 | #include 13 | // Suppose you have a function: 14 | // void func(std::string c); 15 | // Then you can write: 16 | // func(STR("foo"<<1<<"bar")); 17 | #define STR(X) static_cast(std::ostringstream().flush() << X).str() 18 | #endif 19 | -------------------------------------------------------------------------------- /ext/libigl/igl/SolverStatus.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_SOLVER_STATUS_H 9 | #define IGL_SOLVER_STATUS_H 10 | namespace igl 11 | { 12 | enum SolverStatus 13 | { 14 | // Good 15 | SOLVER_STATUS_CONVERGED = 0, 16 | // OK 17 | SOLVER_STATUS_MAX_ITER = 1, 18 | // Bad 19 | SOLVER_STATUS_ERROR = 2, 20 | NUM_SOLVER_STATUSES = 3, 21 | }; 22 | }; 23 | #endif 24 | -------------------------------------------------------------------------------- /ext/libigl/igl/WindingNumberMethod.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_WINDINGNUMBERMETHOD_H 9 | #define IGL_WINDINGNUMBERMETHOD_H 10 | namespace igl 11 | { 12 | // EXACT_WINDING_NUMBER_METHOD exact hierarchical evaluation 13 | // APPROX_SIMPLE_WINDING_NUMBER_METHOD poor approximation 14 | // APPROX_CACHE_WINDING_NUMBER_METHOD another poor approximation 15 | enum WindingNumberMethod 16 | { 17 | EXACT_WINDING_NUMBER_METHOD = 0, 18 | APPROX_SIMPLE_WINDING_NUMBER_METHOD = 1, 19 | APPROX_CACHE_WINDING_NUMBER_METHOD = 2, 20 | NUM_WINDING_NUMBER_METHODS = 3 21 | }; 22 | } 23 | #endif 24 | -------------------------------------------------------------------------------- /ext/libigl/igl/ZERO.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ZERO_H 9 | #define IGL_ZERO_H 10 | namespace igl 11 | { 12 | // Often one needs a reference to a dummy variable containing zero as its 13 | // value, for example when using AntTweakBar's 14 | // TwSetParam( "3D View", "opened", TW_PARAM_INT32, 1, &INT_ZERO); 15 | const char CHAR_ZERO = 0; 16 | const int INT_ZERO = 0; 17 | const unsigned int UNSIGNED_INT_ZERO = 0; 18 | const double DOUBLE_ZERO = 0; 19 | const float FLOAT_ZERO = 0; 20 | } 21 | #endif 22 | -------------------------------------------------------------------------------- /ext/libigl/igl/all.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "all.h" 9 | #include "redux.h" 10 | 11 | 12 | template 13 | IGL_INLINE void igl::all( 14 | const Eigen::SparseMatrix & A, 15 | const int dim, 16 | Eigen::PlainObjectBase& B) 17 | { 18 | typedef typename DerivedB::Scalar Scalar; 19 | igl::redux(A,dim,[](Scalar a, Scalar b){ return a && b!=0;},B); 20 | } 21 | 22 | #ifdef IGL_STATIC_LIBRARY 23 | // Explicit template instantiation 24 | #endif 25 | 26 | 27 | -------------------------------------------------------------------------------- /ext/libigl/igl/all.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ALL_H 9 | #define IGL_ALL_H 10 | #include "igl_inline.h" 11 | #include 12 | #include 13 | namespace igl 14 | { 15 | // For Dense matrices use: A.rowwise().all() or A.colwise().all() 16 | // 17 | // Inputs: 18 | // A m by n sparse matrix 19 | // dim dimension along which to check for all (1 or 2) 20 | // Output: 21 | // B n-long vector (if dim == 1) 22 | // or 23 | // B m-long vector (if dim == 2) 24 | // 25 | template 26 | IGL_INLINE void all( 27 | const Eigen::SparseMatrix & A, 28 | const int dim, 29 | Eigen::PlainObjectBase& B); 30 | } 31 | #ifndef IGL_STATIC_LIBRARY 32 | # include "all.cpp" 33 | #endif 34 | #endif 35 | 36 | 37 | -------------------------------------------------------------------------------- /ext/libigl/igl/angular_distance.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "angular_distance.h" 9 | #include 10 | #include 11 | IGL_INLINE double igl::angular_distance( 12 | const Eigen::Quaterniond & A, 13 | const Eigen::Quaterniond & B) 14 | { 15 | assert(fabs(A.norm()-1) 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ANGULAR_DISTANCE_H 9 | #define IGL_ANGULAR_DISTANCE_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // The "angular distance" between two unit quaternions is the angle of the 15 | // smallest rotation (treated as an Axis and Angle) that takes A to B. 16 | // 17 | // Inputs: 18 | // A unit quaternion 19 | // B unit quaternion 20 | // Returns angular distance 21 | IGL_INLINE double angular_distance( 22 | const Eigen::Quaterniond & A, 23 | const Eigen::Quaterniond & B); 24 | } 25 | 26 | #ifndef IGL_STATIC_LIBRARY 27 | #include "angular_distance.cpp" 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /ext/libigl/igl/anttweakbar/cocoa_key_to_anttweakbar_key.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ANTTWEAKBAR_COCOA_KEY_TO_ANTTWEAKBAR_KEY_H 9 | #define IGL_ANTTWEAKBAR_COCOA_KEY_TO_ANTTWEAKBAR_KEY_H 10 | #include "../igl_inline.h" 11 | 12 | 13 | namespace igl 14 | { 15 | namespace anttweakbar 16 | { 17 | // Convert an unsigned char (like that from Cocoa apps) to AntTweakBar key 18 | // code. 19 | // See also: TranslateKey() in TwMgr.cpp in AntTweakBar source 20 | // Inputs: 21 | // key unsigned char key from keyboard 22 | // Returns int of new key code 23 | IGL_INLINE int cocoa_key_to_anttweakbar_key(int key); 24 | } 25 | } 26 | 27 | #ifndef IGL_STATIC_LIBRARY 28 | # include "cocoa_key_to_anttweakbar_key.cpp" 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /ext/libigl/igl/any.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "any.h" 9 | #include "redux.h" 10 | 11 | 12 | template 13 | IGL_INLINE void igl::any( 14 | const Eigen::SparseMatrix & A, 15 | const int dim, 16 | Eigen::PlainObjectBase& B) 17 | { 18 | typedef typename DerivedB::Scalar Scalar; 19 | igl::redux(A,dim,[](Scalar a, Scalar b){ return a || b!=0;},B); 20 | } 21 | 22 | #ifdef IGL_STATIC_LIBRARY 23 | // Explicit template instantiation 24 | // generated by autoexplicit.sh 25 | template void igl::any >(Eigen::SparseMatrix const&, int, Eigen::PlainObjectBase >&); 26 | #endif 27 | -------------------------------------------------------------------------------- /ext/libigl/igl/any.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ANY_H 9 | #define IGL_ANY_H 10 | #include "igl_inline.h" 11 | #include 12 | #include 13 | namespace igl 14 | { 15 | // For Dense matrices use: A.rowwise().any() or A.colwise().any() 16 | // 17 | // Inputs: 18 | // A m by n sparse matrix 19 | // dim dimension along which to check for any (1 or 2) 20 | // Output: 21 | // B n-long vector (if dim == 1) 22 | // or 23 | // B m-long vector (if dim == 2) 24 | // 25 | template 26 | IGL_INLINE void any( 27 | const Eigen::SparseMatrix & A, 28 | const int dim, 29 | Eigen::PlainObjectBase& B); 30 | } 31 | #ifndef IGL_STATIC_LIBRARY 32 | # include "any.cpp" 33 | #endif 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /ext/libigl/igl/any_of.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "any_of.h" 9 | #include 10 | template 11 | IGL_INLINE bool igl::any_of(const Mat & S) 12 | { 13 | return std::any_of(S.data(),S.data()+S.size(),[](bool s){return s;}); 14 | } 15 | 16 | #ifdef IGL_STATIC_LIBRARY 17 | // Explicit template instantiation 18 | template bool igl::any_of >(Eigen::Matrix const&); 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /ext/libigl/igl/any_of.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ANY_OF_H 9 | #define IGL_ANY_OF_H 10 | #include "igl_inline.h" 11 | namespace igl 12 | { 13 | // Wrapper for STL `any_of` for matrix types 14 | // 15 | // Inputs: 16 | // S matrix 17 | // Returns whether any entries are true 18 | // 19 | // Seems that Eigen (now) implements this for `Eigen::Array` 20 | template 21 | IGL_INLINE bool any_of(const Mat & S); 22 | } 23 | #ifndef IGL_STATIC_LIBRARY 24 | # include "any_of.cpp" 25 | #endif 26 | #endif 27 | -------------------------------------------------------------------------------- /ext/libigl/igl/average_onto_faces.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "average_onto_faces.h" 9 | 10 | template 11 | IGL_INLINE void igl::average_onto_faces(const Eigen::Matrix &V, 12 | const Eigen::Matrix &F, 13 | const Eigen::Matrix &S, 14 | Eigen::Matrix &SF) 15 | { 16 | 17 | SF = Eigen::Matrix::Zero(F.rows(),S.cols()); 18 | 19 | for (int i = 0; i 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_AXIS_ANGLE_TO_QUAT_H 9 | #define IGL_AXIS_ANGLE_TO_QUAT_H 10 | #include "igl_inline.h" 11 | 12 | namespace igl 13 | { 14 | // Convert axis angle representation of a rotation to a quaternion 15 | // A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), 16 | // such that q = x*i + y*j + z*k + w 17 | // Inputs: 18 | // axis 3d vector 19 | // angle scalar 20 | // Outputs: 21 | // quaternion 22 | template 23 | IGL_INLINE void axis_angle_to_quat( 24 | const Q_type *axis, 25 | const Q_type angle, 26 | Q_type *out); 27 | } 28 | 29 | #ifndef IGL_STATIC_LIBRARY 30 | # include "axis_angle_to_quat.cpp" 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /ext/libigl/igl/barycenter.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_BARYCENTER_H 9 | #define IGL_BARYCENTER_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Computes the barycenter of every simplex 15 | // 16 | // Inputs: 17 | // V #V x dim matrix of vertex coordinates 18 | // F #F x simplex_size matrix of indices of simplex corners into V 19 | // Output: 20 | // BC #F x dim matrix of 3d vertices 21 | // 22 | template < 23 | typename DerivedV, 24 | typename DerivedF, 25 | typename DerivedBC> 26 | IGL_INLINE void barycenter( 27 | const Eigen::MatrixBase & V, 28 | const Eigen::MatrixBase & F, 29 | Eigen::PlainObjectBase & BC); 30 | } 31 | 32 | #ifndef IGL_STATIC_LIBRARY 33 | # include "barycenter.cpp" 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /ext/libigl/igl/basename.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_BASENAME_H 9 | #define IGL_BASENAME_H 10 | #include "igl_inline.h" 11 | 12 | #include 13 | 14 | namespace igl 15 | { 16 | // Function like PHP's basename: /etc/sudoers.d --> sudoers.d 17 | // Input: 18 | // path string containing input path 19 | // Returns string containing basename (see php's basename) 20 | // 21 | // See also: dirname, pathinfo 22 | IGL_INLINE std::string basename(const std::string & path); 23 | } 24 | 25 | #ifndef IGL_STATIC_LIBRARY 26 | # include "basename.cpp" 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /ext/libigl/igl/bfs_orient.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_BFS_ORIENT_H 9 | #define IGL_BFS_ORIENT_H 10 | #include 11 | #include 12 | 13 | namespace igl 14 | { 15 | // Consistently orient faces in orientable patches using BFS 16 | // 17 | // F = bfs_orient(F,V); 18 | // 19 | // Inputs: 20 | // F #F by 3 list of faces 21 | // Outputs: 22 | // FF #F by 3 list of faces (OK if same as F) 23 | // C #F list of component ids 24 | // 25 | // 26 | template 27 | IGL_INLINE void bfs_orient( 28 | const Eigen::PlainObjectBase & F, 29 | Eigen::PlainObjectBase & FF, 30 | Eigen::PlainObjectBase & C); 31 | }; 32 | #ifndef IGL_STATIC_LIBRARY 33 | # include "bfs_orient.cpp" 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /ext/libigl/igl/bone_parents.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "bone_parents.h" 9 | 10 | template 11 | IGL_INLINE void igl::bone_parents( 12 | const Eigen::PlainObjectBase& BE, 13 | Eigen::PlainObjectBase& P) 14 | { 15 | P.resize(BE.rows(),1); 16 | // Stupid O(n²) version 17 | for(int e = 0;e, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); 32 | #endif 33 | -------------------------------------------------------------------------------- /ext/libigl/igl/bone_parents.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2014 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_BONE_PARENTS_H 9 | #define IGL_BONE_PARENTS_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // BONE_PARENTS Recover "parent" bones from directed graph representation. 15 | // 16 | // Inputs: 17 | // BE #BE by 2 list of directed bone edges 18 | // Outputs: 19 | // P #BE by 1 list of parent indices into BE, -1 means root. 20 | // 21 | template 22 | IGL_INLINE void bone_parents( 23 | const Eigen::PlainObjectBase& BE, 24 | Eigen::PlainObjectBase& P); 25 | } 26 | 27 | #ifndef IGL_STATIC_LIBRARY 28 | # include "bone_parents.cpp" 29 | #endif 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /ext/libigl/igl/bounding_box_diagonal.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "bounding_box_diagonal.h" 9 | #include "mat_max.h" 10 | #include "mat_min.h" 11 | #include 12 | 13 | IGL_INLINE double igl::bounding_box_diagonal( 14 | const Eigen::MatrixXd & V) 15 | { 16 | using namespace Eigen; 17 | VectorXd maxV,minV; 18 | VectorXi maxVI,minVI; 19 | mat_max(V,1,maxV,maxVI); 20 | mat_min(V,1,minV,minVI); 21 | return sqrt((maxV-minV).array().square().sum()); 22 | } 23 | 24 | #ifdef IGL_STATIC_LIBRARY 25 | // Explicit template instantiation 26 | #endif 27 | -------------------------------------------------------------------------------- /ext/libigl/igl/bounding_box_diagonal.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_BOUNDING_BOX_DIAGONAL_H 9 | #define IGL_BOUNDING_BOX_DIAGONAL_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Compute the length of the diagonal of a given meshes axis-aligned bounding 15 | // box 16 | // 17 | // Inputs: 18 | // V #V by 3 list of vertex positions 19 | // F #F by 3 list of triangle indices into V 20 | // Returns length of bounding box diagonal 21 | IGL_INLINE double bounding_box_diagonal( const Eigen::MatrixXd & V); 22 | } 23 | 24 | #ifndef IGL_STATIC_LIBRARY 25 | # include "bounding_box_diagonal.cpp" 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /ext/libigl/igl/canonical_quaternions.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "canonical_quaternions.h" 9 | 10 | template <> IGL_INLINE float igl::CANONICAL_VIEW_QUAT(int i, int j) 11 | { 12 | return (float)igl::CANONICAL_VIEW_QUAT_F[i][j]; 13 | } 14 | template <> IGL_INLINE double igl::CANONICAL_VIEW_QUAT(int i, int j) 15 | { 16 | return (double)igl::CANONICAL_VIEW_QUAT_D[i][j]; 17 | } 18 | 19 | #ifdef IGL_STATIC_LIBRARY 20 | // Explicit template instantiation 21 | #endif 22 | -------------------------------------------------------------------------------- /ext/libigl/igl/ceil.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_CEIL_H 9 | #define IGL_CEIL_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Ceil a given matrix to nearest integers 15 | // 16 | // Inputs: 17 | // X m by n matrix of scalars 18 | // Outputs: 19 | // Y m by n matrix of ceiled integers 20 | template < typename DerivedX, typename DerivedY> 21 | IGL_INLINE void ceil( 22 | const Eigen::PlainObjectBase& X, 23 | Eigen::PlainObjectBase& Y); 24 | } 25 | 26 | #ifndef IGL_STATIC_LIBRARY 27 | # include "ceil.cpp" 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /ext/libigl/igl/circumradius.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "circumradius.h" 9 | #include "edge_lengths.h" 10 | #include "doublearea.h" 11 | template < 12 | typename DerivedV, 13 | typename DerivedF, 14 | typename DerivedR> 15 | IGL_INLINE void igl::circumradius( 16 | const Eigen::PlainObjectBase & V, 17 | const Eigen::PlainObjectBase & F, 18 | Eigen::PlainObjectBase & R) 19 | { 20 | Eigen::Matrix l; 21 | igl::edge_lengths(V,F,l); 22 | DerivedR A; 23 | igl::doublearea(l,0.,A); 24 | // use formula: R=abc/(4*area) to compute the circum radius 25 | R = l.col(0).array() * l.col(1).array() * l.col(2).array() / (2.0*A.array()); 26 | } 27 | -------------------------------------------------------------------------------- /ext/libigl/igl/circumradius.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_CIRCUMRADIUS_H 9 | #define IGL_CIRCUMRADIUS_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Compute the circumradius of each triangle in a mesh (V,F) 15 | // 16 | // Inputs: 17 | // V #V by dim list of mesh vertex positions 18 | // F #F by 3 list of triangle indices into V 19 | // Outputs: 20 | // R #F list of circumradii 21 | // 22 | template < 23 | typename DerivedV, 24 | typename DerivedF, 25 | typename DerivedR> 26 | IGL_INLINE void circumradius( 27 | const Eigen::PlainObjectBase & V, 28 | const Eigen::PlainObjectBase & F, 29 | Eigen::PlainObjectBase & R); 30 | } 31 | #ifndef IGL_STATIC_LIBRARY 32 | # include "circumradius.cpp" 33 | #endif 34 | #endif 35 | -------------------------------------------------------------------------------- /ext/libigl/igl/column_to_quats.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "column_to_quats.h" 9 | IGL_INLINE bool igl::column_to_quats( 10 | const Eigen::VectorXd & Q, 11 | std::vector< 12 | Eigen::Quaterniond,Eigen::aligned_allocator > & vQ) 13 | { 14 | using namespace Eigen; 15 | if(Q.size() % 4 != 0) 16 | { 17 | return false; 18 | } 19 | const int nQ = Q.size()/4; 20 | vQ.resize(nQ); 21 | for(int q=0;q 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_COLUMN_TO_QUATS_H 9 | #define IGL_COLUMN_TO_QUATS_H 10 | #include "igl_inline.h" 11 | #include 12 | #include 13 | #include 14 | #include 15 | namespace igl 16 | { 17 | // "Columnize" a list of quaternions (q1x,q1y,q1z,q1w,q2x,q2y,q2z,q2w,...) 18 | // 19 | // Inputs: 20 | // Q n*4-long list of coefficients 21 | // Outputs: 22 | // vQ n-long list of quaternions 23 | // Returns false if n%4!=0 24 | IGL_INLINE bool column_to_quats( 25 | const Eigen::VectorXd & Q, 26 | std::vector< 27 | Eigen::Quaterniond,Eigen::aligned_allocator > & vQ); 28 | } 29 | 30 | #ifndef IGL_STATIC_LIBRARY 31 | # include "column_to_quats.cpp" 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /ext/libigl/igl/copyleft/README.md: -------------------------------------------------------------------------------- 1 | ## IGL copyleft subdirectory 2 | 3 | Functions in the `include/igl/copyleft/` subdirectory are in the 4 | `igl::copyleft::` namespace to indicate that they are under a more aggressive 5 | [copyleft](https://en.wikipedia.org/wiki/Copyleft) than 6 | [MPL2](https://en.wikipedia.org/wiki/Mozilla_Public_License) used for the main 7 | `include/igl` directory and `igl::` namespace. Most notably, this subdirectory 8 | includes code that is under 9 | [GPL](https://en.wikipedia.org/wiki/GNU_General_Public_License). 10 | 11 | Typically a company planning on developing software without releasing its 12 | source code will avoid or purchase licenses for such dependencies. If you do 13 | obtain such a license for the dependencies employed here, you are free to use 14 | the libigl functions here as per their MPL2 license. 15 | -------------------------------------------------------------------------------- /ext/libigl/igl/copyleft/cgal/barycenter.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2017 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "../../barycenter.h" 9 | #include 10 | #include 11 | #ifdef IGL_STATIC_LIBRARY 12 | #undef IGL_STATIC_LIBRARY 13 | #include "../../barycenter.cpp" 14 | template void igl::barycenter, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, -1, -1, 0, -1, -1> >(Eigen::MatrixBase, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&); 15 | #endif 16 | -------------------------------------------------------------------------------- /ext/libigl/igl/copyleft/cgal/delaunay_triangulation.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Qingnan Zhou 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #include "delaunay_triangulation.h" 10 | #include "../../delaunay_triangulation.h" 11 | #include "orient2D.h" 12 | #include "incircle.h" 13 | 14 | template< 15 | typename DerivedV, 16 | typename DerivedF> 17 | IGL_INLINE void igl::copyleft::cgal::delaunay_triangulation( 18 | const Eigen::PlainObjectBase& V, 19 | Eigen::PlainObjectBase& F) 20 | { 21 | typedef typename DerivedV::Scalar Scalar; 22 | igl::delaunay_triangulation(V, orient2D, incircle, F); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /ext/libigl/igl/copyleft/cgal/lexicographic_triangulation.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // Qingan Zhou 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla Public License 7 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 8 | // obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #include "lexicographic_triangulation.h" 11 | #include "../../lexicographic_triangulation.h" 12 | #include "orient2D.h" 13 | 14 | template< 15 | typename DerivedP, 16 | typename DerivedF 17 | > 18 | IGL_INLINE void igl::copyleft::cgal::lexicographic_triangulation( 19 | const Eigen::PlainObjectBase& P, 20 | Eigen::PlainObjectBase& F) 21 | { 22 | typedef typename DerivedP::Scalar Scalar; 23 | igl::lexicographic_triangulation(P, orient2D, F); 24 | } 25 | -------------------------------------------------------------------------------- /ext/libigl/igl/copyleft/cgal/list_to_matrix.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2017 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "../../list_to_matrix.h" 9 | #include 10 | #include 11 | #ifdef IGL_STATIC_LIBRARY 12 | #undef IGL_STATIC_LIBRARY 13 | #include "../../list_to_matrix.cpp" 14 | template bool igl::list_to_matrix, Eigen::Matrix, -1, 3, 0, -1, 3> >(std::vector, std::allocator > >, std::allocator, std::allocator > > > > const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&); 15 | #endif 16 | -------------------------------------------------------------------------------- /ext/libigl/igl/copyleft/cgal/orient2D.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Qingan Zhou 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef IGL_COPYLEFT_CGAL_ORIENT_2D_H 10 | #define IGL_COPYLEFT_CGAL_ORIENT_2D_H 11 | 12 | #include "../../igl_inline.h" 13 | 14 | namespace igl 15 | { 16 | namespace copyleft 17 | { 18 | namespace cgal 19 | { 20 | // Inputs: 21 | // pa,pb,pc 2D points. 22 | // Output: 23 | // 1 if pa,pb,pc are counterclockwise oriented. 24 | // 0 if pa,pb,pc are counterclockwise oriented. 25 | // -1 if pa,pb,pc are clockwise oriented. 26 | template 27 | IGL_INLINE short orient2D( 28 | const Scalar pa[2], 29 | const Scalar pb[2], 30 | const Scalar pc[2]); 31 | } 32 | } 33 | } 34 | 35 | #ifndef IGL_STATIC_LIBRARY 36 | # include "orient2D.cpp" 37 | #endif 38 | #endif 39 | -------------------------------------------------------------------------------- /ext/libigl/igl/copyleft/cgal/orient3D.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Qingan Zhou 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef IGL_COPYLEFT_CGAL_ORIENT_3D_H 10 | #define IGL_COPYLEFT_CGAL_ORIENT_3D_H 11 | 12 | #include "../../igl_inline.h" 13 | 14 | namespace igl 15 | { 16 | namespace copyleft 17 | { 18 | namespace cgal 19 | { 20 | // Inputs: 21 | // pa,pb,pc,pd 3D points. 22 | // Output: 23 | // 1 if pa,pb,pc,pd forms a tet of positive volume. 24 | // 0 if pa,pb,pc,pd are coplanar. 25 | // -1 if pa,pb,pc,pd forms a tet of negative volume. 26 | template 27 | IGL_INLINE short orient3D( 28 | const Scalar pa[3], 29 | const Scalar pb[3], 30 | const Scalar pc[3], 31 | const Scalar pd[3]); 32 | } 33 | } 34 | } 35 | 36 | #ifndef IGL_STATIC_LIBRARY 37 | # include "orient3D.cpp" 38 | #endif 39 | #endif 40 | -------------------------------------------------------------------------------- /ext/libigl/igl/copyleft/cgal/peel_winding_number_layers.cpp: -------------------------------------------------------------------------------- 1 | #include "peel_winding_number_layers.h" 2 | 3 | #include 4 | 5 | #include "propagate_winding_numbers.h" 6 | 7 | template< 8 | typename DerivedV, 9 | typename DerivedF, 10 | typename DerivedW > 11 | IGL_INLINE size_t igl::copyleft::cgal::peel_winding_number_layers( 12 | const Eigen::PlainObjectBase & V, 13 | const Eigen::PlainObjectBase & F, 14 | Eigen::PlainObjectBase& W) { 15 | const size_t num_faces = F.rows(); 16 | Eigen::VectorXi labels(num_faces); 17 | labels.setZero(); 18 | 19 | Eigen::MatrixXi winding_numbers; 20 | igl::copyleft::cgal::propagate_winding_numbers(V, F, labels, winding_numbers); 21 | assert(winding_numbers.rows() == num_faces); 22 | assert(winding_numbers.cols() == 2); 23 | 24 | int min_w = winding_numbers.minCoeff(); 25 | int max_w = winding_numbers.maxCoeff(); 26 | assert(max_w > min_w); 27 | 28 | W.resize(num_faces, 1); 29 | for (size_t i=0; i 5 | 6 | namespace igl { 7 | namespace copyleft { 8 | namespace cgal { 9 | template< 10 | typename DerivedV, 11 | typename DerivedF, 12 | typename DerivedW > 13 | IGL_INLINE size_t peel_winding_number_layers( 14 | const Eigen::PlainObjectBase & V, 15 | const Eigen::PlainObjectBase & F, 16 | Eigen::PlainObjectBase& W); 17 | } 18 | } 19 | } 20 | 21 | #ifndef IGL_STATIC_LIBRARY 22 | # include "peel_winding_number_layers.cpp" 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /ext/libigl/igl/copyleft/cgal/read_triangle_mesh.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #include "read_triangle_mesh.h" 10 | #include "assign.h" 11 | #include "../../read_triangle_mesh.h" 12 | 13 | template 14 | IGL_INLINE bool igl::copyleft::cgal::read_triangle_mesh( 15 | const std::string str, 16 | Eigen::PlainObjectBase& V, 17 | Eigen::PlainObjectBase& F) 18 | { 19 | Eigen::MatrixXd Vd; 20 | bool ret = igl::read_triangle_mesh(str,Vd,F); 21 | if(ret) 22 | { 23 | assign(Vd,V); 24 | } 25 | return ret; 26 | } 27 | -------------------------------------------------------------------------------- /ext/libigl/igl/copyleft/cgal/row_to_point.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "row_to_point.h" 9 | 10 | template < 11 | typename Kernel, 12 | typename DerivedV> 13 | IGL_INLINE CGAL::Point_2 igl::copyleft::cgal::row_to_point( 14 | const Eigen::PlainObjectBase & V, 15 | const typename DerivedV::Index & i) 16 | { 17 | return CGAL::Point_2(V(i,0),V(i,1)); 18 | } 19 | -------------------------------------------------------------------------------- /ext/libigl/igl/copyleft/cgal/slice.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2017 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "../../slice.h" 9 | #ifdef IGL_STATIC_LIBRARY 10 | #undef IGL_STATIC_LIBRARY 11 | #include "../../slice.cpp" 12 | #endif 13 | -------------------------------------------------------------------------------- /ext/libigl/igl/copyleft/cgal/slice_mask.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2017 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "../../slice_mask.h" 9 | #include 10 | #include 11 | #ifdef IGL_STATIC_LIBRARY 12 | #undef IGL_STATIC_LIBRARY 13 | #include "../../slice_mask.cpp" 14 | template void igl::slice_mask, -1, 3, 0, -1, 3>, Eigen::Matrix, -1, 3, 0, -1, 3> >(Eigen::DenseBase, -1, 3, 0, -1, 3> > const&, Eigen::Array const&, int, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&); 15 | #endif 16 | -------------------------------------------------------------------------------- /ext/libigl/igl/copyleft/cgal/unique.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2017 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "../../unique.h" 9 | #include 10 | #include 11 | #ifdef IGL_STATIC_LIBRARY 12 | #undef IGL_STATIC_LIBRARY 13 | #include "../../unique.cpp" 14 | #endif 15 | -------------------------------------------------------------------------------- /ext/libigl/igl/copyleft/opengl2/texture_from_tga.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2014 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL_TEXTURE_FROM_TGA_H 9 | #define IGL_OPENGL_TEXTURE_FROM_TGA_H 10 | #include "../../igl_inline.h" 11 | #include "../../opengl2/gl.h" 12 | #include 13 | 14 | namespace igl 15 | { 16 | namespace opengl 17 | { 18 | // Read an image from a .tga file and use it as a texture 19 | // 20 | // Input: 21 | // tga_file path to .tga file 22 | // Output: 23 | // id of generated openGL texture 24 | // Returns true on success, false on failure 25 | IGL_INLINE bool texture_from_tga(const std::string tga_file, GLuint & id); 26 | } 27 | } 28 | 29 | #ifndef IGL_STATIC_LIBRARY 30 | # include "texture_from_tga.cpp" 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /ext/libigl/igl/copyleft/progressive_hulls.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "progressive_hulls.h" 9 | #include "progressive_hulls_cost_and_placement.h" 10 | #include "../decimate.h" 11 | #include "../max_faces_stopping_condition.h" 12 | IGL_INLINE bool igl::copyleft::progressive_hulls( 13 | const Eigen::MatrixXd & V, 14 | const Eigen::MatrixXi & F, 15 | const size_t max_m, 16 | Eigen::MatrixXd & U, 17 | Eigen::MatrixXi & G, 18 | Eigen::VectorXi & J) 19 | { 20 | int m = F.rows(); 21 | Eigen::VectorXi I; 22 | return decimate( 23 | V, 24 | F, 25 | progressive_hulls_cost_and_placement, 26 | max_faces_stopping_condition(m,(const int)m,max_m), 27 | U, 28 | G, 29 | J, 30 | I); 31 | } 32 | -------------------------------------------------------------------------------- /ext/libigl/igl/copyleft/tetgen/README: -------------------------------------------------------------------------------- 1 | IGL interface to tetgen library 2 | 3 | Dependencies: 4 | tetgen 5 | 6 | Travel to $IGL/external/tetgen and issue: 7 | make -f Makefile.igl tetlib 8 | -------------------------------------------------------------------------------- /ext/libigl/igl/cylinder.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_CYLINDER_H 9 | #define IGL_CYLINDER_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Construct a triangle mesh of a cylinder (without caps) 15 | // 16 | // Inputs: 17 | // axis_devisions number of vertices _around the cylinder_ 18 | // height_devisions number of vertices _up the cylinder_ 19 | // Outputs: 20 | // V #V by 3 list of mesh vertex positions 21 | // F #F by 3 list of triangle indices into V 22 | // 23 | template 24 | IGL_INLINE void cylinder( 25 | const int axis_devisions, 26 | const int height_devisions, 27 | Eigen::PlainObjectBase & V, 28 | Eigen::PlainObjectBase & F); 29 | } 30 | #ifndef IGL_STATIC_LIBRARY 31 | # include "cylinder.cpp" 32 | #endif 33 | #endif 34 | -------------------------------------------------------------------------------- /ext/libigl/igl/deprecated.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_DEPRECATED_H 9 | #define IGL_DEPRECATED_H 10 | // Macro for marking a function as deprecated. 11 | // 12 | // http://stackoverflow.com/a/295229/148668 13 | #ifdef __GNUC__ 14 | #define IGL_DEPRECATED(func) func __attribute__ ((deprecated)) 15 | #elif defined(_MSC_VER) 16 | #define IGL_DEPRECATED(func) __declspec(deprecated) func 17 | #else 18 | #pragma message("WARNING: You need to implement IGL_DEPRECATED for this compiler") 19 | #define IGL_DEPRECATED(func) func 20 | #endif 21 | // Usage: 22 | // 23 | // template IGL_INLINE void my_func(Arg1 a); 24 | // 25 | // becomes 26 | // 27 | // template IGL_INLINE IGL_DEPRECATED(void my_func(Arg1 a)); 28 | #endif 29 | -------------------------------------------------------------------------------- /ext/libigl/igl/directed_edge_parents.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2014 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_DIRECTED_EDGE_PARENTS_H 9 | #define IGL_DIRECTED_EDGE_PARENTS_H 10 | #include "igl_inline.h" 11 | 12 | #include 13 | 14 | namespace igl 15 | { 16 | // Recover "parents" (preceeding edges) in a tree given just directed edges. 17 | // 18 | // Inputs: 19 | // E #E by 2 list of directed edges 20 | // Outputs: 21 | // P #E list of parent indices into E (-1) means root 22 | // 23 | template 24 | IGL_INLINE void directed_edge_parents( 25 | const Eigen::PlainObjectBase & E, 26 | Eigen::PlainObjectBase & P); 27 | } 28 | 29 | #ifndef IGL_STATIC_LIBRARY 30 | # include "directed_edge_parents.cpp" 31 | #endif 32 | #endif 33 | -------------------------------------------------------------------------------- /ext/libigl/igl/dirname.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_DIRNAME_H 9 | #define IGL_DIRNAME_H 10 | #include "igl_inline.h" 11 | 12 | #include 13 | 14 | namespace igl 15 | { 16 | // Function like PHP's dirname: /etc/passwd --> /etc, 17 | // Input: 18 | // path string containing input path 19 | // Returns string containing dirname (see php's dirname) 20 | // 21 | // See also: basename, pathinfo 22 | IGL_INLINE std::string dirname(const std::string & path); 23 | } 24 | 25 | #ifndef IGL_STATIC_LIBRARY 26 | # include "dirname.cpp" 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /ext/libigl/igl/dot.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "dot.h" 9 | 10 | // http://www.antisphere.com/Wiki/tools:anttweakbar 11 | IGL_INLINE double igl::dot( 12 | const double *a, 13 | const double *b) 14 | { 15 | return a[0]*b[0] + a[1]*b[1] + a[2]*b[2]; 16 | } 17 | -------------------------------------------------------------------------------- /ext/libigl/igl/dot.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_DOT_H 9 | #define IGL_DOT_H 10 | #include "igl_inline.h" 11 | namespace igl 12 | { 13 | // Computes out = dot(a,b) 14 | // Inputs: 15 | // a left 3d vector 16 | // b right 3d vector 17 | // Returns scalar dot product 18 | IGL_INLINE double dot( 19 | const double *a, 20 | const double *b); 21 | } 22 | 23 | #ifndef IGL_STATIC_LIBRARY 24 | # include "dot.cpp" 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /ext/libigl/igl/dot_row.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2014 Daniele Panozzo 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "igl/dot_row.h" 9 | 10 | template 11 | IGL_INLINE DerivedV igl::dot_row( 12 | const Eigen::PlainObjectBase& A, 13 | const Eigen::PlainObjectBase& B 14 | ) 15 | { 16 | assert(A.rows() == B.rows()); 17 | assert(A.cols() == B.cols()); 18 | 19 | return (A.array() * B.array()).rowwise().sum(); 20 | } 21 | 22 | #ifdef IGL_STATIC_LIBRARY 23 | // Explicit template instantiation 24 | // generated by autoexplicit.sh 25 | template Eigen::Matrix igl::dot_row >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&); 26 | #endif 27 | -------------------------------------------------------------------------------- /ext/libigl/igl/dot_row.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2014 Daniele Panozzo 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_DOT_ROW_H 9 | #define IGL_DOT_ROW_H 10 | 11 | #include "igl/igl_inline.h" 12 | #include 13 | 14 | namespace igl 15 | { 16 | // Compute the dot product between each row of A and B 17 | // Templates: 18 | // DerivedV derived from vertex positions matrix type: i.e. MatrixXd 19 | // Inputs: 20 | // A eigen matrix r by c 21 | // B eigen matrix r by c 22 | // Returns: 23 | // d a column vector with r entries that contains the dot product of each corresponding row of A and B 24 | // 25 | template 26 | IGL_INLINE DerivedV dot_row( 27 | const Eigen::PlainObjectBase& A, 28 | const Eigen::PlainObjectBase& B); 29 | 30 | } 31 | 32 | #ifndef IGL_STATIC_LIBRARY 33 | # include "dot_row.cpp" 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /ext/libigl/igl/ears.h: -------------------------------------------------------------------------------- 1 | #ifndef IGL_EARS_H 2 | #define IGL_EARS_H 3 | #include "igl_inline.h" 4 | #include 5 | namespace igl 6 | { 7 | // FIND_EARS Find all ears (faces with two boundary edges) in a given mesh 8 | // 9 | // [ears,ear_opp] = find_ears(F) 10 | // 11 | // Inputs: 12 | // F #F by 3 list of triangle mesh indices 13 | // Outputs: 14 | // ears #ears list of indices into F of ears 15 | // ear_opp #ears list of indices indicating which edge is non-boundary 16 | // (connecting to flops) 17 | // 18 | template < 19 | typename DerivedF, 20 | typename Derivedear, 21 | typename Derivedear_opp> 22 | IGL_INLINE void ears( 23 | const Eigen::MatrixBase & F, 24 | Eigen::PlainObjectBase & ear, 25 | Eigen::PlainObjectBase & ear_opp); 26 | } 27 | #ifndef IGL_STATIC_LIBRARY 28 | # include "ears.cpp" 29 | #endif 30 | #endif 31 | -------------------------------------------------------------------------------- /ext/libigl/igl/embree/Embree_convenience.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_EMBREE_EMBREE_CONVENIENCE_H 9 | #define IGL_EMBREE_EMBREE_CONVENIENCE_H 10 | 11 | #undef interface 12 | #undef near 13 | #undef far 14 | // Why are these in quotes? isn't that a bad idea? 15 | #ifdef __GNUC__ 16 | // This is how it should be done 17 | # if __GNUC__ >= 4 18 | # if __GNUC_MINOR__ >= 6 19 | # pragma GCC diagnostic push 20 | # pragma GCC diagnostic ignored "-Weffc++" 21 | # endif 22 | # endif 23 | // This is a hack 24 | # pragma GCC system_header 25 | #endif 26 | #include 27 | #include 28 | #include 29 | #ifdef __GNUC__ 30 | # if __GNUC__ >= 4 31 | # if __GNUC_MINOR__ >= 6 32 | # pragma GCC diagnostic pop 33 | # endif 34 | # endif 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /ext/libigl/igl/example_fun.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "example_fun.h" 9 | #include 10 | 11 | template 12 | IGL_INLINE bool igl::example_fun(const Printable & input) 13 | { 14 | using namespace std; 15 | cout<<"example_fun: "<(const double& input); 22 | template bool igl::example_fun(const int& input); 23 | #endif 24 | -------------------------------------------------------------------------------- /ext/libigl/igl/example_fun.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_EXAMPLE_FUN_H 9 | #define IGL_EXAMPLE_FUN_H 10 | 11 | #include "igl_inline.h" 12 | 13 | namespace igl 14 | { 15 | // This is an example of a function, it takes a templated parameter and 16 | // shovels it into cout 17 | // 18 | // Templates: 19 | // T type that supports 20 | // Input: 21 | // input some input of a Printable type 22 | // Returns true for the sake of returning something 23 | template 24 | IGL_INLINE bool example_fun(const Printable & input); 25 | } 26 | 27 | #ifndef IGL_STATIC_LIBRARY 28 | # include "example_fun.cpp" 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /ext/libigl/igl/exterior_edges.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_EXTERIOR_EDGES_H 9 | #define IGL_EXTERIOR_EDGES_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // EXTERIOR_EDGES Determines boundary "edges" and also edges with an 15 | // odd number of occurances where seeing edge (i,j) counts as +1 and seeing 16 | // the opposite edge (j,i) counts as -1 17 | // 18 | // Inputs: 19 | // F #F by simplex_size list of "faces" 20 | // Outputs: 21 | // E #E by simplex_size-1 list of exterior edges 22 | // 23 | IGL_INLINE void exterior_edges( 24 | const Eigen::MatrixXi & F, 25 | Eigen::MatrixXi & E); 26 | // Inline version 27 | IGL_INLINE Eigen::MatrixXi exterior_edges( const Eigen::MatrixXi & F); 28 | } 29 | #ifndef IGL_STATIC_LIBRARY 30 | # include "exterior_edges.cpp" 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /ext/libigl/igl/face_occurrences.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_FACE_OCCURRENCES 9 | #define IGL_FACE_OCCURRENCES 10 | #include "igl_inline.h" 11 | 12 | #include 13 | namespace igl 14 | { 15 | // Count the occruances of each face (row) in a list of face indices 16 | // (irrespecitive of order) 17 | // Inputs: 18 | // F #F by simplex-size 19 | // Outputs 20 | // C #F list of counts 21 | // Known bug: triangles/tets only (where ignoring order still gives simplex) 22 | template 23 | IGL_INLINE void face_occurrences( 24 | const std::vector > & F, 25 | std::vector & C); 26 | } 27 | 28 | #ifndef IGL_STATIC_LIBRARY 29 | # include "face_occurrences.cpp" 30 | #endif 31 | 32 | #endif 33 | 34 | 35 | -------------------------------------------------------------------------------- /ext/libigl/igl/file_contents_as_string.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_FILE_CONTENTS_AS_STRING_H 9 | #define IGL_FILE_CONTENTS_AS_STRING_H 10 | #include "igl_inline.h" 11 | 12 | #include 13 | namespace igl 14 | { 15 | // Read a files contents as plain text into a given string 16 | // Inputs: 17 | // file_name path to file to be read 18 | // Outputs: 19 | // content output string containing contents of the given file 20 | // Returns true on succes, false on error 21 | IGL_INLINE bool file_contents_as_string( 22 | const std::string file_name, 23 | std::string & content); 24 | IGL_INLINE std::string file_contents_as_string( 25 | const std::string file_name); 26 | } 27 | 28 | #ifndef IGL_STATIC_LIBRARY 29 | # include "file_contents_as_string.cpp" 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /ext/libigl/igl/file_dialog_open.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2014 Daniele Panozzo 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_FILE_DIALOG_OPEN_H 9 | #define IGL_FILE_DIALOG_OPEN_H 10 | #include "igl_inline.h" 11 | 12 | #include 13 | 14 | namespace igl 15 | { 16 | // Returns a string with a path to an existing file 17 | // The string is returned empty if no file is selected 18 | // (on Linux machines, it assumes that Zenity is installed) 19 | // 20 | // Usage: 21 | // std::string str = get_open_file_path(); 22 | IGL_INLINE std::string file_dialog_open(); 23 | } 24 | 25 | #ifndef IGL_STATIC_LIBRARY 26 | # include "file_dialog_open.cpp" 27 | #endif 28 | 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /ext/libigl/igl/file_dialog_save.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2014 Daniele Panozzo 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_FILE_DIALOG_SAVE_H 9 | #define IGL_FILE_DIALOG_SAVE_H 10 | #include "igl_inline.h" 11 | 12 | #include 13 | 14 | namespace igl 15 | { 16 | // Returns a string with a path to a new/existing file 17 | // The string is returned empty if no file is selected 18 | // (on Linux machines, it assumes that Zenity is installed) 19 | // 20 | // Usage: 21 | // char buffer[FILE_DIALOG_MAX_BUFFER]; 22 | // get_save_file_path(buffer); 23 | IGL_INLINE std::string file_dialog_save(); 24 | } 25 | 26 | #ifndef IGL_STATIC_LIBRARY 27 | # include "file_dialog_save.cpp" 28 | #endif 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /ext/libigl/igl/file_exists.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "file_exists.h" 9 | 10 | #include 11 | 12 | IGL_INLINE bool igl::file_exists(const std::string filename) 13 | { 14 | struct stat status; 15 | return (stat(filename.c_str(),&status)==0); 16 | } 17 | -------------------------------------------------------------------------------- /ext/libigl/igl/file_exists.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_FILE_EXISTS_H 9 | #define IGL_FILE_EXISTS_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Check if a file or directory exists like PHP's file_exists function: 15 | // http://php.net/manual/en/function.file-exists.php 16 | // Input: 17 | // filename path to file 18 | // Returns true if file exists and is readable and false if file doesn't 19 | // exist or *is not readable* 20 | IGL_INLINE bool file_exists(const std::string filename); 21 | } 22 | 23 | #ifndef IGL_STATIC_LIBRARY 24 | # include "file_exists.cpp" 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /ext/libigl/igl/find_zero.h: -------------------------------------------------------------------------------- 1 | #ifndef IGL_FIND_ZERO_H 2 | #define IGL_FIND_ZERO_H 3 | #include "igl_inline.h" 4 | #include 5 | #include 6 | namespace igl 7 | { 8 | // Find the first zero (whether implicit or explicitly stored) in the 9 | // rows/columns of a matrix. 10 | // Inputs: 11 | // A m by n sparse matrix 12 | // dim dimension along which to check for any (1 or 2) 13 | // Output: 14 | // I n-long vector (if dim == 1) {m means no zeros found} 15 | // or 16 | // I m-long vector (if dim == 2) {n means no zeros found} 17 | // 18 | template 19 | IGL_INLINE void find_zero( 20 | const Eigen::SparseMatrix & A, 21 | const int dim, 22 | Eigen::PlainObjectBase & I); 23 | } 24 | #ifndef IGL_STATIC_LIBRARY 25 | # include "find_zero.cpp" 26 | #endif 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /ext/libigl/igl/fit_plane.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Daniele Panozzo 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_FIT_PLANE_H 9 | #define IGL_FIT_PLANE_H 10 | 11 | #include "igl_inline.h" 12 | #include 13 | 14 | namespace igl 15 | { 16 | // This function fits a plane to a point cloud. 17 | // 18 | // Input: 19 | // V #Vx3 matrix. The 3D point cloud, one row for each vertex. 20 | // Output: 21 | // N 1x3 Vector. The normal of the fitted plane. 22 | // C 1x3 Vector. A point that lies in the fitted plane. 23 | // From http://missingbytes.blogspot.com/2012/06/fitting-plane-to-point-cloud.html 24 | 25 | IGL_INLINE void fit_plane( 26 | const Eigen::MatrixXd & V, 27 | Eigen::RowVector3d & N, 28 | Eigen::RowVector3d & C); 29 | } 30 | 31 | #ifndef IGL_STATIC_LIBRARY 32 | # include "fit_plane.cpp" 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /ext/libigl/igl/floor.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_FLOOR_H 9 | #define IGL_FLOOR_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Floor a given matrix to nearest integers 15 | // 16 | // Inputs: 17 | // X m by n matrix of scalars 18 | // Outputs: 19 | // Y m by n matrix of floored integers 20 | template < typename DerivedX, typename DerivedY> 21 | IGL_INLINE void floor( 22 | const Eigen::PlainObjectBase& X, 23 | Eigen::PlainObjectBase& Y); 24 | } 25 | 26 | #ifndef IGL_STATIC_LIBRARY 27 | # include "floor.cpp" 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /ext/libigl/igl/get_seconds.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "get_seconds.h" 9 | #include 10 | IGL_INLINE double igl::get_seconds() 11 | { 12 | return 13 | std::chrono::duration( 14 | std::chrono::system_clock::now().time_since_epoch()).count(); 15 | } 16 | -------------------------------------------------------------------------------- /ext/libigl/igl/get_seconds.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_GET_SECONDS_H 9 | #define IGL_GET_SECONDS_H 10 | #include "igl_inline.h" 11 | 12 | namespace igl 13 | { 14 | // Return the current time in seconds since program start 15 | // 16 | // Example: 17 | // const auto & tictoc = []() 18 | // { 19 | // static double t_start = igl::get_seconds(); 20 | // double diff = igl::get_seconds()-t_start; 21 | // t_start += diff; 22 | // return diff; 23 | // }; 24 | // tictoc(); 25 | // ... // part 1 26 | // cout<<"part 1: "< 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "get_seconds_hires.h" 9 | 10 | #if _WIN32 11 | # include 12 | # include 13 | IGL_INLINE double igl::get_seconds_hires() 14 | { 15 | LARGE_INTEGER li_freq, li_current; 16 | const bool ret = QueryPerformanceFrequency(&li_freq); 17 | const bool ret2 = QueryPerformanceCounter(&li_current); 18 | assert(ret && ret2); 19 | assert(li_freq.QuadPart > 0); 20 | return double(li_current.QuadPart) / double(li_freq.QuadPart); 21 | } 22 | #else 23 | # include "get_seconds.h" 24 | IGL_INLINE double igl::get_seconds_hires() 25 | { 26 | // Sorry I've no idea how performance counters work on Mac... 27 | return igl::get_seconds(); 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /ext/libigl/igl/get_seconds_hires.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_GET_SECONDS_HIRES_H 9 | #define IGL_GET_SECONDS_HIRES_H 10 | #include "igl_inline.h" 11 | 12 | namespace igl 13 | { 14 | // Return the current time in seconds using performance counters 15 | IGL_INLINE double get_seconds_hires(); 16 | } 17 | 18 | #ifndef IGL_STATIC_LIBRARY 19 | # include "get_seconds_hires.cpp" 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /ext/libigl/igl/grid.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_GRID_H 9 | #define IGL_GRID_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Construct vertices of a regular grid, suitable for input to 15 | // `igl::marching_cubes` 16 | // 17 | // Inputs: 18 | // res 3-long list of number of vertices along the x y and z dimensions 19 | // Outputs: 20 | // GV res(0)*res(1)*res(2) by 3 list of mesh vertex positions. 21 | // 22 | template < 23 | typename Derivedres, 24 | typename DerivedGV> 25 | IGL_INLINE void grid( 26 | const Eigen::MatrixBase & res, 27 | Eigen::PlainObjectBase & GV); 28 | } 29 | #ifndef IGL_STATIC_LIBRARY 30 | # include "grid.cpp" 31 | #endif 32 | #endif 33 | -------------------------------------------------------------------------------- /ext/libigl/igl/grid_search.h: -------------------------------------------------------------------------------- 1 | #ifndef IGL_GRID_SEARCH_H 2 | #define IGL_GRID_SEARCH_H 3 | #include "igl_inline.h" 4 | #include 5 | #include 6 | namespace igl 7 | { 8 | // Solve the problem: 9 | // 10 | // minimize f(x) 11 | // subject to lb ≤ x ≤ ub 12 | // 13 | // by exhaustive grid search. 14 | // 15 | // Inputs: 16 | // f function to minimize 17 | // LB #X vector of finite lower bounds 18 | // UB #X vector of finite upper bounds 19 | // I #X vector of number of steps for each variable 20 | // Outputs: 21 | // X #X optimal parameter vector 22 | // Returns f(X) 23 | // 24 | template < 25 | typename Scalar, 26 | typename DerivedX, 27 | typename DerivedLB, 28 | typename DerivedUB, 29 | typename DerivedI> 30 | IGL_INLINE Scalar grid_search( 31 | const std::function< Scalar (DerivedX &) > f, 32 | const Eigen::MatrixBase & LB, 33 | const Eigen::MatrixBase & UB, 34 | const Eigen::MatrixBase & I, 35 | DerivedX & X); 36 | } 37 | 38 | #ifndef IGL_STATIC_LIBRARY 39 | # include "grid_search.cpp" 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /ext/libigl/igl/guess_extension.h: -------------------------------------------------------------------------------- 1 | #ifndef IGL_GUESS_EXTENSION_H 2 | #define IGL_GUESS_EXTENSION_H 3 | #include "igl_inline.h" 4 | #include 5 | #include 6 | namespace igl 7 | { 8 | // Given a file pointer at the beginning of a "mesh" file, try to guess the 9 | // extension of the file format it comes from. The file pointer is rewound on 10 | // return. 11 | // 12 | // Inputs: 13 | // fp file pointer (see output) 14 | // Outputs: 15 | // fp file pointer rewound 16 | // guess extension as string. One of "mesh",{"obj"},"off","ply","stl", or 17 | // "wrl" 18 | // 19 | IGL_INLINE void guess_extension(FILE * fp, std::string & guess); 20 | IGL_INLINE std::string guess_extension(FILE * fp); 21 | } 22 | #ifndef IGL_STATIC_LIBRARY 23 | # include "guess_extension.cpp" 24 | #endif 25 | #endif 26 | -------------------------------------------------------------------------------- /ext/libigl/igl/igl_inline.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | // This should *NOT* be contained in a IGL_*_H ifdef, since it may be defined 9 | // differently based on when it is included 10 | #ifdef IGL_INLINE 11 | #undef IGL_INLINE 12 | #endif 13 | 14 | #ifndef IGL_STATIC_LIBRARY 15 | # define IGL_INLINE inline 16 | #else 17 | # define IGL_INLINE 18 | #endif 19 | -------------------------------------------------------------------------------- /ext/libigl/igl/inradius.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_INRADIUS_H 9 | #define IGL_INRADIUS_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Compute the inradius of each triangle in a mesh (V,F) 15 | // 16 | // Inputs: 17 | // V #V by dim list of mesh vertex positions 18 | // F #F by 3 list of triangle indices into V 19 | // Outputs: 20 | // R #F list of inradii 21 | // 22 | template < 23 | typename DerivedV, 24 | typename DerivedF, 25 | typename DerivedR> 26 | IGL_INLINE void inradius( 27 | const Eigen::PlainObjectBase & V, 28 | const Eigen::PlainObjectBase & F, 29 | Eigen::PlainObjectBase & R); 30 | } 31 | #ifndef IGL_STATIC_LIBRARY 32 | # include "inradius.cpp" 33 | #endif 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /ext/libigl/igl/intersect.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_INTERSECT_H 9 | #define IGL_INTERSECT_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Determine the intersect between two sets of coefficients using == 15 | // Templates: 16 | // M matrix type that implements indexing by global index M(i) 17 | // Inputs: 18 | // A matrix of coefficients 19 | // B matrix of coefficients 20 | // Output: 21 | // C matrix of elements appearing in both A and B, C is always resized to 22 | // have a single column 23 | template 24 | IGL_INLINE void intersect(const M & A, const M & B, M & C); 25 | // Last argument as return 26 | template 27 | IGL_INLINE M intersect(const M & A, const M & B); 28 | } 29 | #ifndef IGL_STATIC_LIBRARY 30 | #include "intersect.cpp" 31 | #endif 32 | #endif 33 | -------------------------------------------------------------------------------- /ext/libigl/igl/invert_diag.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_INVERT_DIAG_H 9 | #define IGL_INVERT_DIAG_H 10 | #include "igl_inline.h" 11 | #define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET 12 | #include 13 | 14 | namespace igl 15 | { 16 | // Invert the diagonal entries of a matrix (if the matrix is a diagonal 17 | // matrix then this amounts to inverting the matrix) 18 | 19 | // Templates: 20 | // T should be a eigen sparse matrix primitive type like int or double 21 | // Inputs: 22 | // X an m by n sparse matrix 23 | // Outputs: 24 | // Y an m by n sparse matrix 25 | template 26 | IGL_INLINE void invert_diag( 27 | const Eigen::SparseMatrix& X, 28 | Eigen::SparseMatrix& Y); 29 | } 30 | 31 | #ifndef IGL_STATIC_LIBRARY 32 | # include "invert_diag.cpp" 33 | #endif 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /ext/libigl/igl/is_dir.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "is_dir.h" 9 | 10 | #include 11 | 12 | #ifndef S_ISDIR 13 | #define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) 14 | #endif 15 | 16 | #ifndef S_ISREG 17 | #define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) 18 | #endif 19 | 20 | IGL_INLINE bool igl::is_dir(const char * filename) 21 | { 22 | struct stat status; 23 | if(stat(filename,&status)!=0) 24 | { 25 | // path does not exist 26 | return false; 27 | } 28 | // Tests whether existing path is a directory 29 | return S_ISDIR(status.st_mode); 30 | } 31 | -------------------------------------------------------------------------------- /ext/libigl/igl/is_dir.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_IS_DIR_H 9 | #define IGL_IS_DIR_H 10 | #include "igl_inline.h" 11 | namespace igl 12 | { 13 | // Act like php's is_dir function 14 | // http://php.net/manual/en/function.is-dir.php 15 | // Tells whether the given filename is a directory. 16 | // Input: 17 | // filename Path to the file. If filename is a relative filename, it will 18 | // be checked relative to the current working directory. 19 | // Returns TRUE if the filename exists and is a directory, FALSE 20 | // otherwise. 21 | IGL_INLINE bool is_dir(const char * filename); 22 | 23 | } 24 | 25 | #ifndef IGL_STATIC_LIBRARY 26 | # include "is_dir.cpp" 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /ext/libigl/igl/is_file.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "is_file.h" 9 | 10 | #include 11 | #ifdef _WIN32 12 | # ifndef S_ISREG 13 | # define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) 14 | # endif 15 | #endif 16 | IGL_INLINE bool igl::is_file(const char * filename) 17 | { 18 | struct stat status; 19 | if(stat(filename,&status)!=0) 20 | { 21 | // path does not exist 22 | return false; 23 | } 24 | // Tests whether existing path is a regular file 25 | return S_ISREG(status.st_mode); 26 | } 27 | -------------------------------------------------------------------------------- /ext/libigl/igl/is_file.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_IS_FILE_H 9 | #define IGL_IS_FILE_H 10 | #include "igl_inline.h" 11 | namespace igl 12 | { 13 | // Act like php's is_file function 14 | // http://php.net/manual/en/function.is-file.php 15 | // Tells whether the given filename is a regular file. 16 | // Input: 17 | // filename Path to the file. If filename is a relative filename, it will 18 | // be checked relative to the current working directory. 19 | // Returns TRUE if the filename exists and is a regular file, FALSE 20 | // otherwise. 21 | IGL_INLINE bool is_file(const char * filename); 22 | 23 | } 24 | 25 | #ifndef IGL_STATIC_LIBRARY 26 | # include "is_file.cpp" 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /ext/libigl/igl/is_planar.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2014 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "is_planar.h" 9 | IGL_INLINE bool igl::is_planar(const Eigen::MatrixXd & V) 10 | { 11 | if(V.size() == 0) return false; 12 | if(V.cols() == 2) return true; 13 | for(int i = 0;i 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_IS_PLANAR_H 9 | #define IGL_IS_PLANAR_H 10 | #include "igl_inline.h" 11 | 12 | #include 13 | 14 | namespace igl 15 | { 16 | // Determin if a set of points lies on the XY plane 17 | // 18 | // Inputs: 19 | // V #V by dim list of vertex positions 20 | // Return true if a mesh has constant value of 0 in z coordinate 21 | // 22 | // Known bugs: Doesn't determine if vertex is flat if it doesn't lie on the 23 | // XY plane. 24 | IGL_INLINE bool is_planar(const Eigen::MatrixXd & V); 25 | } 26 | 27 | #ifndef IGL_STATIC_LIBRARY 28 | # include "is_planar.cpp" 29 | #endif 30 | #endif 31 | -------------------------------------------------------------------------------- /ext/libigl/igl/is_readable.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_IS_READABLE_H 9 | #define IGL_IS_READABLE_H 10 | #include "igl_inline.h" 11 | namespace igl 12 | { 13 | // Check if a file is reabable like PHP's is_readable function: 14 | // http://www.php.net/manual/en/function.is-readable.php 15 | // Input: 16 | // filename path to file 17 | // Returns true if file exists and is readable and false if file doesn't 18 | // exist or *is not readable* 19 | // 20 | // Note: Windows version will not check user or group ids 21 | IGL_INLINE bool is_readable(const char * filename); 22 | } 23 | 24 | #ifndef IGL_STATIC_LIBRARY 25 | # include "is_readable.cpp" 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /ext/libigl/igl/is_sparse.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "is_sparse.h" 9 | template 10 | IGL_INLINE bool igl::is_sparse( 11 | const Eigen::SparseMatrix & A) 12 | { 13 | return true; 14 | } 15 | template 16 | IGL_INLINE bool igl::is_sparse( 17 | const Eigen::PlainObjectBase& A) 18 | { 19 | return false; 20 | } 21 | 22 | #ifdef IGL_STATIC_LIBRARY 23 | // Explicit template instantiation 24 | // generated by autoexplicit.sh 25 | template bool igl::is_sparse(Eigen::SparseMatrix const&); 26 | // generated by autoexplicit.sh 27 | template bool igl::is_sparse >(Eigen::PlainObjectBase > const&); 28 | #endif 29 | -------------------------------------------------------------------------------- /ext/libigl/igl/is_sparse.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_IS_SPARSE_H 9 | #define IGL_IS_SPARSE_H 10 | #include "igl_inline.h" 11 | #define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET 12 | #include 13 | #include 14 | namespace igl 15 | { 16 | // Determine if a matrix A is sparse 17 | // 18 | // Template: 19 | // T,DerivedA defines scalar type 20 | // Inputs: 21 | // A matrix in question 22 | // Returns true if A is represented with a sparse matrix 23 | template 24 | IGL_INLINE bool is_sparse( 25 | const Eigen::SparseMatrix & A); 26 | template 27 | IGL_INLINE bool is_sparse( 28 | const Eigen::PlainObjectBase& A); 29 | } 30 | 31 | #ifndef IGL_STATIC_LIBRARY 32 | # include "is_sparse.cpp" 33 | #endif 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /ext/libigl/igl/is_stl.h: -------------------------------------------------------------------------------- 1 | #ifndef IGL_IS_STL_H 2 | #define IGL_IS_STL_H 3 | #include "igl_inline.h" 4 | #include 5 | namespace igl 6 | { 7 | // Given a file pointer, determine if it contains an .stl file and then 8 | // rewind it. 9 | // 10 | // Inputs: 11 | // stl_file pointer to file 12 | // Outputs: 13 | // is_ascii flag whether stl is ascii 14 | // Returns whether stl_file is an .stl file 15 | IGL_INLINE bool is_stl(FILE * stl_file, bool & is_ascii); 16 | IGL_INLINE bool is_stl(FILE * stl_file); 17 | }; 18 | #ifndef IGL_STATIC_LIBRARY 19 | # include "is_stl.cpp" 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /ext/libigl/igl/is_writable.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_IS_WRITABLE_H 9 | #define IGL_IS_WRITABLE_H 10 | #include "igl_inline.h" 11 | namespace igl 12 | { 13 | // Check if a file exists *and* is writable like PHP's is_writable function: 14 | // http://www.php.net/manual/en/function.is-writable.php 15 | // Input: 16 | // filename path to file 17 | // Returns true if file exists and is writable and false if file doesn't 18 | // exist or *is not writable* 19 | // 20 | // Note: Windows version will not test group and user id 21 | IGL_INLINE bool is_writable(const char * filename); 22 | } 23 | 24 | #ifndef IGL_STATIC_LIBRARY 25 | # include "is_writable.cpp" 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /ext/libigl/igl/isdiag.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "isdiag.h" 9 | 10 | template 11 | IGL_INLINE bool igl::isdiag(const Eigen::SparseMatrix & A) 12 | { 13 | // Iterate over outside of A 14 | for(int k=0; k::InnerIterator it (A,k); it; ++it) 18 | { 19 | if(it.row() != it.col() && it.value()!=0) 20 | { 21 | return false; 22 | } 23 | } 24 | } 25 | return true; 26 | } 27 | 28 | 29 | #ifdef IGL_STATIC_LIBRARY 30 | // Explicit template instantiation 31 | template bool igl::isdiag(class Eigen::SparseMatrix const &); 32 | #endif 33 | -------------------------------------------------------------------------------- /ext/libigl/igl/isdiag.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ISDIAG_H 9 | #define IGL_ISDIAG_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Determine if a given matrix is diagonal: all non-zeros lie on the 15 | // main diagonal. 16 | // 17 | // Inputs: 18 | // A m by n sparse matrix 19 | // Returns true iff and only if the matrix is diagonal. 20 | template 21 | IGL_INLINE bool isdiag(const Eigen::SparseMatrix & A); 22 | }; 23 | #ifndef IGL_STATIC_LIBRARY 24 | # include "isdiag.cpp" 25 | #endif 26 | #endif 27 | -------------------------------------------------------------------------------- /ext/libigl/igl/line_segment_in_rectangle.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_LINE_SEGMENT_IN_RECTANGLE_H 9 | #define IGL_LINE_SEGMENT_IN_RECTANGLE_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Determine whether a line segment overlaps with a rectangle. 15 | // 16 | // Inputs: 17 | // s source point of line segment 18 | // d dest point of line segment 19 | // A first corner of rectangle 20 | // B opposite corner of rectangle 21 | // Returns true if line segment is at all inside rectangle 22 | IGL_INLINE bool line_segment_in_rectangle( 23 | const Eigen::Vector2d & s, 24 | const Eigen::Vector2d & d, 25 | const Eigen::Vector2d & A, 26 | const Eigen::Vector2d & B); 27 | } 28 | 29 | #ifndef IGL_STATIC_LIBRARY 30 | # include "line_segment_in_rectangle.cpp" 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /ext/libigl/igl/mat_to_quat.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_MAT_TO_QUAT_H 9 | #define IGL_MAT_TO_QUAT_H 10 | #include "igl_inline.h" 11 | namespace igl 12 | { 13 | // Convert a OpenGL (rotation) matrix to a quaternion 14 | // 15 | // Input: 16 | // m 16-element opengl rotation matrix 17 | // Output: 18 | // q 4-element quaternion (not normalized) 19 | template 20 | IGL_INLINE void mat4_to_quat(const Q_type * m, Q_type * q); 21 | // Input: 22 | // m 9-element opengl rotation matrix 23 | template 24 | IGL_INLINE void mat3_to_quat(const Q_type * m, Q_type * q); 25 | } 26 | 27 | #ifndef IGL_STATIC_LIBRARY 28 | # include "mat_to_quat.cpp" 29 | #endif 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /ext/libigl/igl/matlab/mexErrMsgTxt.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "mexErrMsgTxt.h" 9 | 10 | // Overload mexErrMsgTxt to check an assertion then print text only if 11 | // assertion fails 12 | #include "mex.h" 13 | IGL_INLINE void igl::matlab::mexErrMsgTxt(bool assertion, const char * text) 14 | { 15 | if(!assertion) 16 | { 17 | ::mexErrMsgTxt(text); 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /ext/libigl/igl/matlab/mexErrMsgTxt.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_MATLAB_MEXERRMSGTXT_H 9 | #define IGL_MATLAB_MEXERRMSGTXT_H 10 | #include "../igl_inline.h" 11 | namespace igl 12 | { 13 | namespace matlab 14 | { 15 | // Wrapper for mexErrMsgTxt that only calls error if test fails 16 | IGL_INLINE void mexErrMsgTxt(bool test, const char * message); 17 | } 18 | } 19 | #ifndef IGL_STATIC_LIBRARY 20 | # include "mexErrMsgTxt.cpp" 21 | #endif 22 | #endif 23 | -------------------------------------------------------------------------------- /ext/libigl/igl/matlab/requires_arg.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "requires_arg.h" 9 | #include "mexErrMsgTxt.h" 10 | #include "../C_STR.h" 11 | 12 | IGL_INLINE void igl::matlab::requires_arg(const int i, const int nrhs, const char *name) 13 | { 14 | mexErrMsgTxt((i+1) 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_REQUIRES_ARG_H 9 | #define IGL_REQUIRES_ARG_H 10 | #include "../igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | namespace matlab 15 | { 16 | // Simply throw an error if (i+1) 5 | #include 6 | namespace igl 7 | { 8 | // Inputs: 9 | // X m by n matrix 10 | // dim dimension along which to take max 11 | // Outputs: 12 | // Y n-long vector (if dim == 1) 13 | // or 14 | // Y m-long vector (if dim == 2) 15 | // I vector the same size as Y containing the indices along dim of maximum 16 | // entries 17 | template 18 | IGL_INLINE void max( 19 | const Eigen::SparseMatrix & A, 20 | const int dim, 21 | Eigen::PlainObjectBase & B, 22 | Eigen::PlainObjectBase & I); 23 | } 24 | #ifndef IGL_STATIC_LIBRARY 25 | # include "max.cpp" 26 | #endif 27 | #endif 28 | -------------------------------------------------------------------------------- /ext/libigl/igl/max_size.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_MAX_SIZE_H 9 | #define IGL_MAX_SIZE_H 10 | #include "igl_inline.h" 11 | #include 12 | 13 | namespace igl 14 | { 15 | // Determine max size of lists in a vector 16 | // Template: 17 | // T some list type object that implements .size() 18 | // Inputs: 19 | // V vector of list types T 20 | // Returns max .size() found in V, returns -1 if V is empty 21 | template 22 | IGL_INLINE int max_size(const std::vector & V); 23 | } 24 | 25 | #ifndef IGL_STATIC_LIBRARY 26 | # include "max_size.cpp" 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /ext/libigl/igl/median.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_MEDIAN_H 9 | #define IGL_MEDIAN_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Compute the median of an eigen vector 15 | // 16 | // Inputs: 17 | // V #V list of unsorted values 18 | // Outputs: 19 | // m median of those values 20 | // Returns true on success, false on failure 21 | template 22 | IGL_INLINE bool median( 23 | const Eigen::MatrixBase & V, mType & m); 24 | } 25 | 26 | #ifndef IGL_STATIC_LIBRARY 27 | # include "median.cpp" 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /ext/libigl/igl/min.cpp: -------------------------------------------------------------------------------- 1 | #include "min.h" 2 | #include "for_each.h" 3 | #include "find_zero.h" 4 | 5 | template 6 | IGL_INLINE void igl::min( 7 | const Eigen::SparseMatrix & A, 8 | const int dim, 9 | Eigen::PlainObjectBase & B, 10 | Eigen::PlainObjectBase & I) 11 | { 12 | const int n = A.cols(); 13 | const int m = A.rows(); 14 | B.resize(dim==1?n:m); 15 | B.setConstant(std::numeric_limits::max()); 16 | I.resize(dim==1?n:m); 17 | for_each(A,[&B,&I,&dim](int i, int j,const typename DerivedB::Scalar v) 18 | { 19 | if(dim == 2) 20 | { 21 | std::swap(i,j); 22 | } 23 | // Coded as if dim == 1, assuming swap for dim == 2 24 | if(v < B(j)) 25 | { 26 | B(j) = v; 27 | I(j) = i; 28 | } 29 | }); 30 | Eigen::VectorXi Z; 31 | find_zero(A,dim,Z); 32 | for(int j = 0;j 5 | #include 6 | namespace igl 7 | { 8 | // Inputs: 9 | // X m by n matrix 10 | // dim dimension along which to take min 11 | // Outputs: 12 | // Y n-long vector (if dim == 1) 13 | // or 14 | // Y m-long vector (if dim == 2) 15 | // I vector the same size as Y containing the indices along dim of minimum 16 | // entries 17 | template 18 | IGL_INLINE void min( 19 | const Eigen::SparseMatrix & A, 20 | const int dim, 21 | Eigen::PlainObjectBase & B, 22 | Eigen::PlainObjectBase & I); 23 | } 24 | #ifndef IGL_STATIC_LIBRARY 25 | # include "min.cpp" 26 | #endif 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /ext/libigl/igl/min_size.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_MIN_SIZE_H 9 | #define IGL_MIN_SIZE_H 10 | #include "igl_inline.h" 11 | #include 12 | 13 | namespace igl 14 | { 15 | // Determine min size of lists in a vector 16 | // Template: 17 | // T some list type object that implements .size() 18 | // Inputs: 19 | // V vector of list types T 20 | // Returns min .size() found in V, returns -1 if V is empty 21 | template 22 | IGL_INLINE int min_size(const std::vector & V); 23 | } 24 | 25 | 26 | #ifndef IGL_STATIC_LIBRARY 27 | # include "min_size.cpp" 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /ext/libigl/igl/mod.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "mod.h" 9 | 10 | template 11 | IGL_INLINE void igl::mod( 12 | const Eigen::PlainObjectBase & A, 13 | const int base, 14 | Eigen::PlainObjectBase & B) 15 | { 16 | B.resizeLike(A); 17 | for(int i = 0;i 26 | IGL_INLINE DerivedA igl::mod( 27 | const Eigen::PlainObjectBase & A, const int base) 28 | { 29 | DerivedA B; 30 | mod(A,base,B); 31 | return B; 32 | } 33 | #ifdef IGL_STATIC_LIBRARY 34 | #endif 35 | -------------------------------------------------------------------------------- /ext/libigl/igl/mod.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_MOD_H 9 | #define IGL_MOD_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Compute elementwise mod: B = A % base 15 | // 16 | // Inputs: 17 | // A m by n matrix 18 | // base number to mod against 19 | // Outputs: 20 | // B m by n matrix 21 | template 22 | IGL_INLINE void mod( 23 | const Eigen::PlainObjectBase & A, 24 | const int base, 25 | Eigen::PlainObjectBase & B); 26 | template 27 | IGL_INLINE DerivedA mod( 28 | const Eigen::PlainObjectBase & A, const int base); 29 | } 30 | #ifndef IGL_STATIC_LIBRARY 31 | #include "mod.cpp" 32 | #endif 33 | #endif 34 | -------------------------------------------------------------------------------- /ext/libigl/igl/mosek/mosek_guarded.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "mosek_guarded.h" 9 | #include 10 | 11 | IGL_INLINE MSKrescodee igl::mosek::mosek_guarded(const MSKrescodee r) 12 | { 13 | using namespace std; 14 | if(r != MSK_RES_OK) 15 | { 16 | /* In case of an error print error code and description. */ 17 | char symname[MSK_MAX_STR_LEN]; 18 | char desc[MSK_MAX_STR_LEN]; 19 | MSK_getcodedesc(r,symname,desc); 20 | cerr<<"MOSEK ERROR ("< 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_MOSEK_MOSEK_GUARDED_H 9 | #define IGL_MOSEK_MOSEK_GUARDED_H 10 | #include "../igl_inline.h" 11 | 12 | #include "mosek.h" 13 | namespace igl 14 | { 15 | namespace mosek 16 | { 17 | // Little function to wrap around mosek call to handle errors 18 | // 19 | // Inputs: 20 | // r mosek error code returned from mosek call 21 | // Returns r untouched 22 | IGL_INLINE MSKrescodee mosek_guarded(const MSKrescodee r); 23 | } 24 | } 25 | 26 | #ifndef IGL_STATIC_LIBRARY 27 | # include "mosek_guarded.cpp" 28 | #endif 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /ext/libigl/igl/mvc.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_MVC_H 9 | #define IGL_MVC_H 10 | 11 | #include "igl_inline.h" 12 | #include 13 | 14 | namespace igl 15 | { 16 | // MVC - MEAN VALUE COORDINATES 17 | // 18 | // mvc(V,C,W) 19 | // 20 | // Inputs: 21 | // V #V x dim list of vertex positions (dim = 2 or dim = 3) 22 | // C #C x dim list of polygon vertex positions in counter-clockwise order 23 | // (dim = 2 or dim = 3) 24 | // 25 | // Outputs: 26 | // W weights, #V by #C matrix of weights 27 | // 28 | // Known Bugs: implementation is listed as "Broken" 29 | IGL_INLINE void mvc( 30 | const Eigen::MatrixXd &V, 31 | const Eigen::MatrixXd &C, 32 | Eigen::MatrixXd &W); 33 | 34 | } 35 | 36 | #ifndef IGL_STATIC_LIBRARY 37 | # include "mvc.cpp" 38 | #endif 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /ext/libigl/igl/next_filename.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2014 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "next_filename.h" 9 | #include "STR.h" 10 | #include "file_exists.h" 11 | #include 12 | #include 13 | 14 | bool igl::next_filename( 15 | const std::string & prefix, 16 | const int zeros, 17 | const std::string & suffix, 18 | std::string & next) 19 | { 20 | using namespace std; 21 | // O(n), for huge lists could at least find bounds with exponential search 22 | // and then narrow with binary search O(log(n)) 23 | int i = 0; 24 | while(true) 25 | { 26 | next = STR(prefix << setfill('0') << setw(zeros)< 0 && i >= pow(10,zeros)) 33 | { 34 | return false; 35 | } 36 | } 37 | } 38 | 39 | -------------------------------------------------------------------------------- /ext/libigl/igl/normalize_quat.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_NORMALIZE_QUAT_H 9 | #define IGL_NORMALIZE_QUAT_H 10 | #include "igl_inline.h" 11 | 12 | namespace igl 13 | { 14 | // Normalize a quaternion 15 | // A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), 16 | // such that q = x*i + y*j + z*k + w 17 | // Inputs: 18 | // q input quaternion 19 | // Outputs: 20 | // out result of normalization, allowed to be same as q 21 | // Returns true on success, false if len(q) < EPS 22 | template 23 | IGL_INLINE bool normalize_quat( 24 | const Q_type *q, 25 | Q_type *out); 26 | }; 27 | 28 | #ifndef IGL_STATIC_LIBRARY 29 | # include "normalize_quat.cpp" 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /ext/libigl/igl/normalize_row_sums.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_NORMALIZE_ROW_SUMS_H 9 | #define IGL_NORMALIZE_ROW_SUMS_H 10 | #include "igl_inline.h" 11 | #include 12 | 13 | namespace igl 14 | { 15 | // Normalize the rows in A so that their sums are each 1 and place the new 16 | // entries in B 17 | // Inputs: 18 | // A #rows by k input matrix 19 | // Outputs: 20 | // B #rows by k input matrix, can be the same as A 21 | // 22 | // Note: This is just calling an Eigen one-liner. 23 | template 24 | IGL_INLINE void normalize_row_sums( 25 | const Eigen::MatrixBase& A, 26 | Eigen::MatrixBase & B); 27 | } 28 | 29 | #ifndef IGL_STATIC_LIBRARY 30 | # include "normalize_row_sums.cpp" 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /ext/libigl/igl/null.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "null.h" 9 | #include "EPS.h" 10 | 11 | template 12 | IGL_INLINE void igl::null( 13 | const Eigen::PlainObjectBase & A, 14 | Eigen::PlainObjectBase & N) 15 | { 16 | using namespace Eigen; 17 | typedef typename DerivedA::Scalar Scalar; 18 | JacobiSVD svd(A, ComputeFullV); 19 | svd.setThreshold(A.cols() * svd.singularValues().maxCoeff() * EPS()); 20 | N = svd.matrixV().rightCols(A.cols()-svd.rank()); 21 | } 22 | -------------------------------------------------------------------------------- /ext/libigl/igl/null.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_NULL_H 9 | #define IGL_NULL_H 10 | #include "igl_inline.h" 11 | 12 | #include 13 | 14 | namespace igl 15 | { 16 | // Like MATLAB's null 17 | // 18 | // Compute a basis for the null space for the given matrix A: the columns of 19 | // the output N form a basis for the space orthogonal to that spanned by the 20 | // rows of A. 21 | // 22 | // Inputs: 23 | // A m by n matrix 24 | // Outputs: 25 | // N n by r matrix, where r is the row rank of A 26 | template 27 | IGL_INLINE void null( 28 | const Eigen::PlainObjectBase & A, 29 | Eigen::PlainObjectBase & N); 30 | } 31 | 32 | #ifndef IGL_STATIC_LIBRARY 33 | # include "null.cpp" 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /ext/libigl/igl/opengl/create_index_vbo.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL_CREATE_INDEX_VBO_H 9 | #define IGL_OPENGL_CREATE_INDEX_VBO_H 10 | #include "../igl_inline.h" 11 | #include "gl.h" 12 | #include 13 | 14 | // Create a VBO (Vertex Buffer Object) for a list of indices: 15 | // GL_ELEMENT_ARRAY_BUFFER_ARB for the triangle indices (F) 16 | namespace igl 17 | { 18 | namespace opengl 19 | { 20 | // Inputs: 21 | // F #F by 3 eigen Matrix of face (triangle) indices 22 | // Outputs: 23 | // F_vbo_id buffer id for face indices 24 | // 25 | IGL_INLINE void create_index_vbo( 26 | const Eigen::MatrixXi & F, 27 | GLuint & F_vbo_id); 28 | } 29 | } 30 | 31 | #ifndef IGL_STATIC_LIBRARY 32 | # include "create_index_vbo.cpp" 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /ext/libigl/igl/opengl/gl.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013, 2017 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL_GL_H 9 | #define IGL_OPENGL_GL_H 10 | 11 | #ifdef IGL_OPENGL2_GL_H 12 | # error "igl/opengl2/gl.h already included" 13 | #endif 14 | 15 | // Always use this: 16 | // #include "gl.h" 17 | // Instead of: 18 | // #include 19 | // or 20 | // #include 21 | // 22 | 23 | // For now this includes glu, glew and glext (perhaps these should be 24 | // separated) 25 | #ifdef _WIN32 26 | # define NOMINMAX 27 | # include 28 | # undef DrawText 29 | # undef NOMINMAX 30 | #endif 31 | 32 | #ifndef __APPLE__ 33 | # define GLEW_STATIC 34 | # include 35 | #endif 36 | 37 | #ifdef __APPLE__ 38 | # include 39 | # define __gl_h_ /* Prevent inclusion of the old gl.h */ 40 | #else 41 | # include 42 | #endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /ext/libigl/igl/opengl/gl_type_size.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "gl_type_size.h" 9 | #include 10 | 11 | IGL_INLINE int igl::opengl::gl_type_size(const GLenum type) 12 | { 13 | switch(type) 14 | { 15 | case GL_DOUBLE: 16 | return 8; 17 | break; 18 | case GL_FLOAT: 19 | return 4; 20 | break; 21 | case GL_INT: 22 | return 4; 23 | break; 24 | default: 25 | // should handle all other GL_[types] 26 | assert(false && "Implementation incomplete."); 27 | break; 28 | } 29 | return -1; 30 | } 31 | -------------------------------------------------------------------------------- /ext/libigl/igl/opengl/gl_type_size.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL_GL_TYPE_SIZE_H 9 | #define IGL_OPENGL_GL_TYPE_SIZE_H 10 | #include "../igl_inline.h" 11 | #include "gl.h" 12 | 13 | namespace igl 14 | { 15 | namespace opengl 16 | { 17 | // Return the number of bytes for a given OpenGL type // Inputs: 18 | // type enum value of opengl type 19 | // Returns size in bytes of type 20 | IGL_INLINE int gl_type_size(const GLenum type); 21 | } 22 | } 23 | 24 | #ifndef IGL_STATIC_LIBRARY 25 | # include "gl_type_size.cpp" 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /ext/libigl/igl/opengl/glfw/background_window.h: -------------------------------------------------------------------------------- 1 | #ifndef IGL_OPENGL_GLFW_BACKGROUND_WINDOW_H 2 | #define IGL_OPENGL_GLFW_BACKGROUND_WINDOW_H 3 | #include "../../igl_inline.h" 4 | #include "../gl.h" 5 | 6 | #define GLFW_INCLUDE_GLU 7 | #include 8 | 9 | namespace igl 10 | { 11 | namespace opengl 12 | { 13 | namespace glfw 14 | { 15 | // Create a background window with a valid core profile opengl context 16 | // set to current. 17 | // 18 | // After you're finished with this window you may call 19 | // `glfwDestroyWindow(window)` 20 | // 21 | // After you're finished with glfw you should call `glfwTerminate()` 22 | // 23 | // Outputs: 24 | // window pointer to glfw window 25 | // Returns true iff success 26 | IGL_INLINE bool background_window(GLFWwindow* & window); 27 | } 28 | } 29 | } 30 | 31 | #ifndef IGL_STATIC_LIBRARY 32 | # include "background_window.cpp" 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /ext/libigl/igl/opengl/load_shader.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "load_shader.h" 9 | 10 | // Copyright Denis Kovacs 4/10/08 11 | #include "print_shader_info_log.h" 12 | #include 13 | IGL_INLINE GLuint igl::opengl::load_shader(const char *src,const GLenum type) 14 | { 15 | GLuint s = glCreateShader(type); 16 | if(s == 0) 17 | { 18 | fprintf(stderr,"Error: load_shader() failed to create shader.\n"); 19 | return 0; 20 | } 21 | // Pass shader source string 22 | glShaderSource(s, 1, &src, NULL); 23 | glCompileShader(s); 24 | // Print info log (if any) 25 | igl::opengl::print_shader_info_log(s); 26 | return s; 27 | } 28 | -------------------------------------------------------------------------------- /ext/libigl/igl/opengl/load_shader.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL_LOAD_SHADER_H 9 | #define IGL_OPENGL_LOAD_SHADER_H 10 | #include "../igl_inline.h" 11 | #include "gl.h" 12 | 13 | namespace igl 14 | { 15 | namespace opengl 16 | { 17 | // Creates and compiles a shader from a given string 18 | // Inputs: 19 | // src string containing GLSL shader code 20 | // type GLSL type of shader, one of: 21 | // GL_VERTEX_SHADER 22 | // GL_FRAGMENT_SHADER 23 | // GL_GEOMETRY_SHADER 24 | // Returns index id of the newly created shader, 0 on error 25 | IGL_INLINE GLuint load_shader(const char *src,const GLenum type); 26 | } 27 | } 28 | 29 | #ifndef IGL_STATIC_LIBRARY 30 | # include "load_shader.cpp" 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /ext/libigl/igl/opengl/print_program_info_log.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "print_program_info_log.h" 9 | 10 | #include 11 | #include 12 | // Copyright Denis Kovacs 4/10/08 13 | IGL_INLINE void igl::opengl::print_program_info_log(const GLuint obj) 14 | { 15 | GLint infologLength = 0; 16 | GLint charsWritten = 0; 17 | char *infoLog; 18 | 19 | glGetProgramiv(obj, GL_INFO_LOG_LENGTH,&infologLength); 20 | 21 | if (infologLength > 0) 22 | { 23 | infoLog = (char *)malloc(infologLength); 24 | glGetProgramInfoLog(obj, infologLength, &charsWritten, infoLog); 25 | printf("%s\n",infoLog); 26 | free(infoLog); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ext/libigl/igl/opengl/print_program_info_log.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL_PRINT_PROGRAM_INFO_LOG_H 9 | #define IGL_OPENGL_PRINT_PROGRAM_INFO_LOG_H 10 | #include "../igl_inline.h" 11 | #include "gl.h" 12 | 13 | namespace igl 14 | { 15 | namespace opengl 16 | { 17 | // Inputs: 18 | // obj OpenGL index of program to print info log about 19 | IGL_INLINE void print_program_info_log(const GLuint obj); 20 | } 21 | } 22 | 23 | #ifndef IGL_STATIC_LIBRARY 24 | # include "print_program_info_log.cpp" 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /ext/libigl/igl/opengl/print_shader_info_log.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "print_shader_info_log.h" 9 | 10 | #include 11 | #include 12 | // Copyright Denis Kovacs 4/10/08 13 | IGL_INLINE void igl::opengl::print_shader_info_log(const GLuint obj) 14 | { 15 | GLint infologLength = 0; 16 | GLint charsWritten = 0; 17 | char *infoLog; 18 | 19 | // Get shader info log from opengl 20 | glGetShaderiv(obj, GL_INFO_LOG_LENGTH,&infologLength); 21 | // Only print if there is something in the log 22 | if (infologLength > 0) 23 | { 24 | infoLog = (char *)malloc(infologLength); 25 | glGetShaderInfoLog(obj, infologLength, &charsWritten, infoLog); 26 | printf("%s\n",infoLog); 27 | free(infoLog); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ext/libigl/igl/opengl/print_shader_info_log.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL_PRINT_SHADER_INFO_LOG_H 9 | #define IGL_OPENGL_PRINT_SHADER_INFO_LOG_H 10 | #include "../igl_inline.h" 11 | #include "gl.h" 12 | 13 | namespace igl 14 | { 15 | namespace opengl 16 | { 17 | // Inputs: 18 | // obj OpenGL index of shader to print info log about 19 | IGL_INLINE void print_shader_info_log(const GLuint obj); 20 | } 21 | } 22 | 23 | #ifndef IGL_STATIC_LIBRARY 24 | # include "print_shader_info_log.cpp" 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /ext/libigl/igl/opengl/report_gl_error.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL_REPORT_GL_ERROR_H 9 | #define IGL_OPENGL_REPORT_GL_ERROR_H 10 | #include "../igl_inline.h" 11 | 12 | // Hack to allow both opengl/ and opengl2 to use this (we shouldn't allow this) 13 | #ifndef __gl_h_ 14 | # include "gl.h" 15 | #endif 16 | #include 17 | 18 | namespace igl 19 | { 20 | namespace opengl 21 | { 22 | // Print last OpenGL error to stderr prefixed by specified id string 23 | // Inputs: 24 | // id string to appear before any error msgs 25 | // Returns result of glGetError() 26 | IGL_INLINE GLenum report_gl_error(const std::string id); 27 | // No prefix 28 | IGL_INLINE GLenum report_gl_error(); 29 | } 30 | } 31 | 32 | #ifndef IGL_STATIC_LIBRARY 33 | # include "report_gl_error.cpp" 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /ext/libigl/igl/opengl/uniform_type_to_string.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL_UNIFORM_TYPE_TO_STRING_H 9 | #define IGL_OPENGL_UNIFORM_TYPE_TO_STRING_H 10 | #include "../igl_inline.h" 11 | #include "gl.h" 12 | #include 13 | 14 | namespace igl 15 | { 16 | namespace opengl 17 | { 18 | // Convert a GL uniform variable type (say, returned from 19 | // glGetActiveUniform) and output a string naming that type 20 | // Inputs: 21 | // type enum for given type 22 | // Returns string name of that type 23 | IGL_INLINE std::string uniform_type_to_string(const GLenum type); 24 | } 25 | } 26 | 27 | #ifndef IGL_STATIC_LIBRARY 28 | # include "uniform_type_to_string.cpp" 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /ext/libigl/igl/opengl2/draw_beach_ball.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL2_DRAW_BEACH_BALL_H 9 | #define IGL_OPENGL2_DRAW_BEACH_BALL_H 10 | #include "../igl_inline.h" 11 | 12 | namespace igl 13 | { 14 | namespace opengl2 15 | { 16 | // Draw a beach ball icon/glyph (from AntTweakBar) at the current origin 17 | // according to the current orientation: ball has radius 0.75 and axis have 18 | // length 1.15 19 | IGL_INLINE void draw_beach_ball(); 20 | } 21 | } 22 | 23 | #ifndef IGL_STATIC_LIBRARY 24 | # include "draw_beach_ball.cpp" 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /ext/libigl/igl/opengl2/gl.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL2_GL_H 9 | #define IGL_OPENGL2_GL_H 10 | 11 | #ifdef IGL_OPENGL_GL_H 12 | # error "igl/opengl/gl.h already included" 13 | #endif 14 | 15 | // Always use this: 16 | // #include "gl.h" 17 | // Instead of: 18 | // #include 19 | // or 20 | // #include 21 | // 22 | 23 | // For now this includes glu, glew and glext (perhaps these should be 24 | // separated) 25 | #ifdef _WIN32 26 | # define NOMINMAX 27 | # include 28 | # undef DrawText 29 | # undef NOMINMAX 30 | #endif 31 | 32 | #ifndef __APPLE__ 33 | # define GLEW_STATIC 34 | # include 35 | #endif 36 | 37 | #ifdef __APPLE__ 38 | # include 39 | # define __gl_h_ /* Prevent inclusion of the old gl.h */ 40 | #else 41 | # include 42 | #endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /ext/libigl/igl/opengl2/glext.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2017 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL_GLEXT_H 9 | #define IGL_OPENGL_GLEXT_H 10 | 11 | #ifdef IGL_OPENGL2_GLEXT_H 12 | # error "igl/opengl2/glext.h already included" 13 | #endif 14 | 15 | // Always use this: 16 | // #include "gl.h" 17 | // Instead of: 18 | // #include 19 | // or 20 | // #include 21 | // 22 | 23 | #ifdef __APPLE__ 24 | # include 25 | #elif _WIN32 26 | // do nothing(?) 27 | #else 28 | # include 29 | #endif 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /ext/libigl/igl/opengl2/glu.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2017 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL2_GLU_H 9 | #define IGL_OPENGL2_GLU_H 10 | 11 | #ifdef IGL_OPENGL_GLU_H 12 | # error "igl/opengl/glu.h already included" 13 | #endif 14 | 15 | // Always use this: 16 | // #include "glu.h" 17 | // Instead of: 18 | // #include 19 | // or 20 | // #include 21 | // 22 | 23 | #ifdef __APPLE__ 24 | # include 25 | #else 26 | # include 27 | #endif 28 | 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /ext/libigl/igl/opengl2/print_gl_get.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "print_gl_get.h" 9 | 10 | #include 11 | IGL_INLINE void igl::opengl2::print_gl_get(GLenum pname) 12 | { 13 | double dM[16]; 14 | 15 | int rows = 4; 16 | int cols = 4; 17 | switch(pname) 18 | { 19 | case GL_MODELVIEW_MATRIX: 20 | case GL_PROJECTION_MATRIX: 21 | { 22 | rows = 4; 23 | cols = 4; 24 | glGetDoublev(pname,dM); 25 | for(int i = 0;i 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL2_PRINT_GL_GET_H 9 | #define IGL_OPENGL2_PRINT_GL_GET_H 10 | #include "gl.h" 11 | #include "../igl_inline.h" 12 | 13 | namespace igl 14 | { 15 | namespace opengl2 16 | { 17 | // Prints the value of pname found by issuing glGet*(pname,*) 18 | // Inputs: 19 | // pname enum key to gl parameter 20 | IGL_INLINE void print_gl_get(GLenum pname); 21 | } 22 | } 23 | 24 | #ifndef IGL_STATIC_LIBRARY 25 | # include "print_gl_get.cpp" 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /ext/libigl/igl/opengl2/right_axis.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "right_axis.h" 9 | #include "gl.h" 10 | 11 | IGL_INLINE void igl::opengl2::right_axis(double * x, double * y, double * z) 12 | { 13 | double mv[16]; 14 | glGetDoublev(GL_MODELVIEW_MATRIX, mv); 15 | igl::opengl2::right_axis(mv,x,y,z); 16 | } 17 | 18 | IGL_INLINE void igl::opengl2::right_axis(const double * mv,double * x, double * y, double * z) 19 | { 20 | *x = -mv[0*4+0]; 21 | *y = -mv[1*4+0]; 22 | *z = -mv[2*4+0]; 23 | } 24 | 25 | 26 | #ifdef IGL_STATIC_LIBRARY 27 | // Explicit template instantiation 28 | #endif 29 | -------------------------------------------------------------------------------- /ext/libigl/igl/opengl2/up_axis.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "up_axis.h" 9 | #include "gl.h" 10 | 11 | IGL_INLINE void igl::opengl2::up_axis(double * x, double * y, double * z) 12 | { 13 | double mv[16]; 14 | glGetDoublev(GL_MODELVIEW_MATRIX, mv); 15 | igl::opengl2::up_axis(mv,x,y,z); 16 | } 17 | 18 | IGL_INLINE void igl::opengl2::up_axis(const double *mv, double * x, double * y, double * z) 19 | { 20 | *x = -mv[0*4+1]; 21 | *y = -mv[1*4+1]; 22 | *z = -mv[2*4+1]; 23 | } 24 | 25 | #ifdef IGL_STATIC_LIBRARY 26 | // Explicit template instantiation 27 | // generated by autoexplicit.sh 28 | #endif 29 | -------------------------------------------------------------------------------- /ext/libigl/igl/orth.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "orth.h" 9 | 10 | // Broken Implementation 11 | IGL_INLINE void igl::orth(const Eigen::MatrixXd &A, Eigen::MatrixXd &Q) 12 | { 13 | 14 | //perform svd on A = U*S*V' (V is not computed and only the thin U is computed) 15 | Eigen::JacobiSVD svd(A, Eigen::ComputeThinU ); 16 | Eigen::MatrixXd U = svd.matrixU(); 17 | const Eigen::VectorXd S = svd.singularValues(); 18 | 19 | //get rank of A 20 | int m = A.rows(); 21 | int n = A.cols(); 22 | double tol = std::max(m,n) * S.maxCoeff() * 2.2204e-16; 23 | int r = 0; 24 | for (int i = 0; i < S.rows(); ++r,++i) 25 | { 26 | if (S[i] < tol) 27 | break; 28 | } 29 | 30 | //keep r first columns of U 31 | Q = U.block(0,0,U.rows(),r); 32 | } 33 | -------------------------------------------------------------------------------- /ext/libigl/igl/path_to_executable.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_PATH_TO_EXECUTABLE_H 9 | #define IGL_PATH_TO_EXECUTABLE_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Return the path of the current executable. 15 | // Note: Tested for Mac OS X 16 | IGL_INLINE std::string path_to_executable(); 17 | } 18 | #ifndef IGL_STATIC_LIBRARY 19 | # include "path_to_executable.cpp" 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /ext/libigl/igl/pinv.h: -------------------------------------------------------------------------------- 1 | #ifndef IGL_PINV_H 2 | #define IGL_PINV_H 3 | #include "igl_inline.h" 4 | #include 5 | namespace igl 6 | { 7 | // Compute the Moore-Penrose pseudoinverse 8 | // 9 | // Inputs: 10 | // A m by n matrix 11 | // tol tolerance (if negative then default is used) 12 | // Outputs: 13 | // X n by m matrix so that A*X*A = A and X*A*X = X and A*X = (A*X)' and 14 | // (X*A) = (X*A)' 15 | template 16 | void pinv( 17 | const Eigen::MatrixBase & A, 18 | typename DerivedA::Scalar tol, 19 | Eigen::PlainObjectBase & X); 20 | // Wrapper using default tol 21 | template 22 | void pinv( 23 | const Eigen::MatrixBase & A, 24 | Eigen::PlainObjectBase & X); 25 | } 26 | #ifndef IGL_STATIC_LIBRARY 27 | # include "pinv.cpp" 28 | #endif 29 | #endif 30 | -------------------------------------------------------------------------------- /ext/libigl/igl/point_in_circle.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "point_in_circle.h" 9 | 10 | IGL_INLINE bool igl::point_in_circle( 11 | const double qx, 12 | const double qy, 13 | const double cx, 14 | const double cy, 15 | const double r) 16 | { 17 | return (qx-cx)*(qx-cx) + (qy-cy)*(qy-cy) - r*r < 0; 18 | } 19 | -------------------------------------------------------------------------------- /ext/libigl/igl/point_in_circle.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_POINT_IN_CIRCLE_H 9 | #define IGL_POINT_IN_CIRCLE_H 10 | #include "igl_inline.h" 11 | 12 | namespace igl 13 | { 14 | // Determine if 2d point is in a circle 15 | // Inputs: 16 | // qx x-coordinate of query point 17 | // qy y-coordinate of query point 18 | // cx x-coordinate of circle center 19 | // cy y-coordinate of circle center 20 | // r radius of circle 21 | // Returns true if query point is in circle, false otherwise 22 | IGL_INLINE bool point_in_circle( 23 | const double qx, 24 | const double qy, 25 | const double cx, 26 | const double cy, 27 | const double r); 28 | } 29 | 30 | #ifndef IGL_STATIC_LIBRARY 31 | # include "point_in_circle.cpp" 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /ext/libigl/igl/print_vector.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_PRINT_VECTOR_H 9 | #define IGL_PRINT_VECTOR_H 10 | #include "igl_inline.h" 11 | 12 | #include 13 | namespace igl 14 | { 15 | // Not clear what these are supposed to be doing. Currently they print 16 | // vectors to standard error... 17 | template 18 | IGL_INLINE void print_vector( std::vector& v); 19 | template 20 | IGL_INLINE void print_vector( std::vector< std::vector >& v); 21 | template 22 | IGL_INLINE void print_vector(std::vector< std::vector< std::vector > >& v); 23 | } 24 | 25 | #ifndef IGL_STATIC_LIBRARY 26 | # include "print_vector.cpp" 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /ext/libigl/igl/quad_planarity.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_QUAD_PLANARITY_H 9 | #define IGL_QUAD_PLANARITY_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Compute planarity of the faces of a quad mesh 15 | // Inputs: 16 | // V #V by 3 eigen Matrix of mesh vertex 3D positions 17 | // F #F by 4 eigen Matrix of face (quad) indices 18 | // Output: 19 | // P #F by 1 eigen Matrix of mesh face (quad) planarities 20 | // 21 | template 22 | IGL_INLINE void quad_planarity( 23 | const Eigen::PlainObjectBase& V, 24 | const Eigen::PlainObjectBase& F, 25 | Eigen::PlainObjectBase & P); 26 | } 27 | 28 | #ifndef IGL_STATIC_LIBRARY 29 | # include "quad_planarity.cpp" 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /ext/libigl/igl/quadric_binary_plus_operator.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "quadric_binary_plus_operator.h" 9 | 10 | IGL_INLINE std::tuple< Eigen::MatrixXd, Eigen::RowVectorXd, double> 11 | igl::operator+( 12 | const std::tuple< Eigen::MatrixXd, Eigen::RowVectorXd, double> & a, 13 | const std::tuple< Eigen::MatrixXd, Eigen::RowVectorXd, double> & b) 14 | { 15 | std::tuple< 16 | Eigen::MatrixXd, 17 | Eigen::RowVectorXd, 18 | double> c; 19 | std::get<0>(c) = (std::get<0>(a) + std::get<0>(b)).eval(); 20 | std::get<1>(c) = (std::get<1>(a) + std::get<1>(b)).eval(); 21 | std::get<2>(c) = (std::get<2>(a) + std::get<2>(b)); 22 | return c; 23 | } 24 | 25 | -------------------------------------------------------------------------------- /ext/libigl/igl/quat_conjugate.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "quat_conjugate.h" 9 | 10 | template 11 | IGL_INLINE void igl::quat_conjugate( 12 | const Q_type *q1, 13 | Q_type *out) 14 | { 15 | out[0] = -q1[0]; 16 | out[1] = -q1[1]; 17 | out[2] = -q1[2]; 18 | out[3] = q1[3]; 19 | } 20 | 21 | #ifdef IGL_STATIC_LIBRARY 22 | // Explicit template instantiation 23 | // generated by autoexplicit.sh 24 | template void igl::quat_conjugate(double const*, double*); 25 | // generated by autoexplicit.sh 26 | template void igl::quat_conjugate(float const*, float*); 27 | #endif 28 | -------------------------------------------------------------------------------- /ext/libigl/igl/quat_conjugate.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_QUAT_CONJUGATE_H 9 | #define IGL_QUAT_CONJUGATE_H 10 | #include "igl_inline.h" 11 | 12 | namespace igl 13 | { 14 | // Compute conjugate of given quaternion 15 | // http://en.wikipedia.org/wiki/Quaternion#Conjugation.2C_the_norm.2C_and_reciprocal 16 | // A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), 17 | // such that q = x*i + y*j + z*k + w 18 | // Inputs: 19 | // q1 input quaternion 20 | // Outputs: 21 | // out result of conjugation, allowed to be same as input 22 | template 23 | IGL_INLINE void quat_conjugate( 24 | const Q_type *q1, 25 | Q_type *out); 26 | }; 27 | 28 | #ifndef IGL_STATIC_LIBRARY 29 | # include "quat_conjugate.cpp" 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /ext/libigl/igl/quat_mult.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_QUAT_MULT_H 9 | #define IGL_QUAT_MULT_H 10 | #include "igl_inline.h" 11 | 12 | namespace igl 13 | { 14 | // Computes out = q1 * q2 with quaternion multiplication 15 | // A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), 16 | // such that q = x*i + y*j + z*k + w 17 | // Inputs: 18 | // q1 left quaternion 19 | // q2 right quaternion 20 | // Outputs: 21 | // out result of multiplication 22 | template 23 | IGL_INLINE void quat_mult( 24 | const Q_type *q1, 25 | const Q_type *q2, 26 | Q_type *out); 27 | }; 28 | 29 | #ifndef IGL_STATIC_LIBRARY 30 | # include "quat_mult.cpp" 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /ext/libigl/igl/quat_to_mat.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_QUAT_TO_MAT_H 9 | #define IGL_QUAT_TO_MAT_H 10 | #include "igl_inline.h" 11 | // Name history: 12 | // quat2mat until 16 Sept 2011 13 | namespace igl 14 | { 15 | // Convert a quaternion to a 4x4 matrix 16 | // A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), 17 | // such that q = x*i + y*j + z*k + w 18 | // Input: 19 | // quat pointer to four elements of quaternion (x,y,z,w) 20 | // Output: 21 | // mat pointer to 16 elements of matrix 22 | template 23 | IGL_INLINE void quat_to_mat(const Q_type * quat, Q_type * mat); 24 | } 25 | 26 | #ifndef IGL_STATIC_LIBRARY 27 | # include "quat_to_mat.cpp" 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /ext/libigl/igl/quats_to_column.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "quats_to_column.h" 9 | 10 | IGL_INLINE void igl::quats_to_column( 11 | const std::vector< 12 | Eigen::Quaterniond,Eigen::aligned_allocator > vQ, 13 | Eigen::VectorXd & Q) 14 | { 15 | Q.resize(vQ.size()*4); 16 | for(int q = 0;q<(int)vQ.size();q++) 17 | { 18 | auto & xyzw = vQ[q].coeffs(); 19 | for(int c = 0;c<4;c++) 20 | { 21 | Q(q*4+c) = xyzw(c); 22 | } 23 | } 24 | } 25 | 26 | IGL_INLINE Eigen::VectorXd igl::quats_to_column( 27 | const std::vector< 28 | Eigen::Quaterniond,Eigen::aligned_allocator > vQ) 29 | { 30 | Eigen::VectorXd Q; 31 | quats_to_column(vQ,Q); 32 | return Q; 33 | } 34 | -------------------------------------------------------------------------------- /ext/libigl/igl/random_dir.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_RANDOM_DIR_H 9 | #define IGL_RANDOM_DIR_H 10 | #include "igl_inline.h" 11 | 12 | #include 13 | 14 | namespace igl 15 | { 16 | // Generate a uniformly random unit direction in 3D, return as vector 17 | IGL_INLINE Eigen::Vector3d random_dir(); 18 | // Generate n stratified uniformly random unit directions in 3d, return as rows 19 | // of an n by 3 matrix 20 | // 21 | // Inputs: 22 | // n number of directions 23 | // Return n by 3 matrix of random directions 24 | IGL_INLINE Eigen::MatrixXd random_dir_stratified(const int n); 25 | } 26 | 27 | #ifndef IGL_STATIC_LIBRARY 28 | # include "random_dir.cpp" 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /ext/libigl/igl/random_quaternion.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_RANDOM_QUATERNION_H 9 | #define IGL_RANDOM_QUATERNION_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Return a random quaternion via uniform sampling of the 4-sphere 15 | template 16 | IGL_INLINE Eigen::Quaternion random_quaternion(); 17 | } 18 | #ifndef IGL_STATIC_LIBRARY 19 | #include "random_quaternion.cpp" 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /ext/libigl/igl/random_search.h: -------------------------------------------------------------------------------- 1 | #ifndef IGL_RANDOM_SEARCH_H 2 | #define IGL_RANDOM_SEARCH_H 3 | #include "igl_inline.h" 4 | #include 5 | #include 6 | namespace igl 7 | { 8 | // Solve the problem: 9 | // 10 | // minimize f(x) 11 | // subject to lb ≤ x ≤ ub 12 | // 13 | // by uniform random search. 14 | // 15 | // Inputs: 16 | // f function to minimize 17 | // LB #X vector of finite lower bounds 18 | // UB #X vector of finite upper bounds 19 | // iters number of iterations 20 | // Outputs: 21 | // X #X optimal parameter vector 22 | // Returns f(X) 23 | // 24 | template < 25 | typename Scalar, 26 | typename DerivedX, 27 | typename DerivedLB, 28 | typename DerivedUB> 29 | IGL_INLINE Scalar random_search( 30 | const std::function< Scalar (DerivedX &) > f, 31 | const Eigen::MatrixBase & LB, 32 | const Eigen::MatrixBase & UB, 33 | const int iters, 34 | DerivedX & X); 35 | } 36 | 37 | #ifndef IGL_STATIC_LIBRARY 38 | # include "random_search.cpp" 39 | #endif 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /ext/libigl/igl/randperm.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "randperm.h" 9 | #include "colon.h" 10 | #include 11 | 12 | template 13 | IGL_INLINE void igl::randperm( 14 | const int n, 15 | Eigen::PlainObjectBase & I) 16 | { 17 | Eigen::VectorXi II; 18 | igl::colon(0,1,n-1,II); 19 | I = II; 20 | std::random_shuffle(I.data(),I.data()+n); 21 | } 22 | 23 | #ifdef IGL_STATIC_LIBRARY 24 | // Explicit template instantiation 25 | template void igl::randperm >(int, Eigen::PlainObjectBase >&); 26 | template void igl::randperm >(int, Eigen::PlainObjectBase >&); 27 | #endif 28 | -------------------------------------------------------------------------------- /ext/libigl/igl/randperm.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_RANDPERM_H 9 | #define IGL_RANDPERM_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Like matlab's randperm(n) but minus 1 15 | // 16 | // Inputs: 17 | // n number of elements 18 | // Outputs: 19 | // I n list of rand permutation of 0:n-1 20 | template 21 | IGL_INLINE void randperm( 22 | const int n, 23 | Eigen::PlainObjectBase & I); 24 | } 25 | #ifndef IGL_STATIC_LIBRARY 26 | # include "randperm.cpp" 27 | #endif 28 | #endif 29 | -------------------------------------------------------------------------------- /ext/libigl/igl/readCSV.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_READ_CSV_H 9 | #define IGL_READ_CSV_H 10 | 11 | #include "igl/igl_inline.h" 12 | #include 13 | #include 14 | #include 15 | 16 | namespace igl 17 | { 18 | // read a matrix from a csv file into a Eigen matrix 19 | // Templates: 20 | // Scalar type for the matrix 21 | // Inputs: 22 | // str path to .csv file 23 | // Outputs: 24 | // M eigen matrix 25 | template 26 | IGL_INLINE bool readCSV( 27 | const std::string str, 28 | Eigen::Matrix& M); 29 | } 30 | 31 | #ifndef IGL_STATIC_LIBRARY 32 | # include "readCSV.cpp" 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /ext/libigl/igl/reorder.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_REORDER_H 9 | #define IGL_REORDER_H 10 | #include "igl_inline.h" 11 | #include 12 | // For size_t 13 | #include 14 | #include 15 | 16 | namespace igl 17 | { 18 | // Act like matlab's Y = X(I) for std vectors 19 | // where I contains a vector of indices so that after, 20 | // Y[j] = X[I[j]] for index j 21 | // this implies that Y.size() == I.size() 22 | // X and Y are allowed to be the same reference 23 | template< class T > 24 | IGL_INLINE void reorder( 25 | const std::vector & unordered, 26 | std::vector const & index_map, 27 | std::vector & ordered); 28 | } 29 | 30 | #ifndef IGL_STATIC_LIBRARY 31 | # include "reorder.cpp" 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /ext/libigl/igl/rgb_to_hsv.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_RGB_TO_HSV_H 9 | #define IGL_RGB_TO_HSV_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Convert RGB to HSV 15 | // 16 | // Inputs: 17 | // r red value ([0,1]) 18 | // g green value ([0,1]) 19 | // b blue value ([0,1]) 20 | // Outputs: 21 | // h hue value (degrees: [0,360]) 22 | // s saturation value ([0,1]) 23 | // v value value ([0,1]) 24 | template 25 | IGL_INLINE void rgb_to_hsv(const R * rgb, H * hsv); 26 | template 27 | IGL_INLINE void rgb_to_hsv( 28 | const Eigen::PlainObjectBase & R, 29 | Eigen::PlainObjectBase & H); 30 | }; 31 | 32 | #ifndef IGL_STATIC_LIBRARY 33 | # include "rgb_to_hsv.cpp" 34 | #endif 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /ext/libigl/igl/rotate_by_quat.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ROTATE_BY_QUAT_H 9 | #define IGL_ROTATE_BY_QUAT_H 10 | #include "igl_inline.h" 11 | 12 | namespace igl 13 | { 14 | // Compute rotation of a given vector/point by a quaternion 15 | // A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), 16 | // such that q = x*i + y*j + z*k + w 17 | // Inputs: 18 | // v input 3d point/vector 19 | // q input quaternion 20 | // Outputs: 21 | // out result of rotation, allowed to be same as v 22 | template 23 | IGL_INLINE void rotate_by_quat( 24 | const Q_type *v, 25 | const Q_type *q, 26 | Q_type *out); 27 | }; 28 | 29 | #ifndef IGL_STATIC_LIBRARY 30 | # include "rotate_by_quat.cpp" 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /ext/libigl/igl/rotation_matrix_from_directions.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson, Daniele Panozzo, Olga Diamanti 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ROTATION_MATRIX_FROM_DIRECTIONS_H 9 | #define IGL_ROTATION_MATRIX_FROM_DIRECTIONS_H 10 | #include "igl_inline.h" 11 | 12 | #include 13 | 14 | namespace igl 15 | { 16 | // Given 2 vectors centered on origin calculate the rotation matrix from 17 | // first to the second 18 | // 19 | // Inputs: 20 | // v0 3D column vector 21 | // v1 3D column vector 22 | // Output: 23 | // 3 by 3 rotation matrix that takes v0 to v1 24 | // 25 | template 26 | IGL_INLINE Eigen::Matrix rotation_matrix_from_directions( 27 | const Eigen::Matrix v0, 28 | const Eigen::Matrix v1); 29 | } 30 | 31 | #ifndef IGL_STATIC_LIBRARY 32 | #include "rotation_matrix_from_directions.cpp" 33 | #endif 34 | #endif 35 | -------------------------------------------------------------------------------- /ext/libigl/igl/round.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ROUND_H 9 | #define IGL_ROUND_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Round a scalar value 15 | // 16 | // Inputs: 17 | // x number 18 | // Returns x rounded to integer 19 | template 20 | DerivedX round(const DerivedX r); 21 | // Round a given matrix to nearest integers 22 | // 23 | // Inputs: 24 | // X m by n matrix of scalars 25 | // Outputs: 26 | // Y m by n matrix of rounded integers 27 | template < typename DerivedX, typename DerivedY> 28 | IGL_INLINE void round( 29 | const Eigen::PlainObjectBase& X, 30 | Eigen::PlainObjectBase& Y); 31 | } 32 | 33 | #ifndef IGL_STATIC_LIBRARY 34 | # include "round.cpp" 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /ext/libigl/igl/rows_to_matrix.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ROWS_TO_MATRIX_H 9 | #define IGL_ROWS_TO_MATRIX_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Convert a list (std::vector) of row vectors of the same length to a matrix 15 | // Template: 16 | // Row row vector type, must implement: 17 | // .size() 18 | // Mat Matrix type, must implement: 19 | // .resize(m,n) 20 | // .row(i) = Row 21 | // Inputs: 22 | // V a m-long list of vectors of size n 23 | // Outputs: 24 | // M an m by n matrix 25 | // Returns true on success, false on errors 26 | template 27 | IGL_INLINE bool rows_to_matrix(const std::vector & V,Mat & M); 28 | } 29 | 30 | #ifndef IGL_STATIC_LIBRARY 31 | # include "rows_to_matrix.cpp" 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /ext/libigl/igl/sample_edges.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "sample_edges.h" 9 | 10 | IGL_INLINE void igl::sample_edges( 11 | const Eigen::MatrixXd & V, 12 | const Eigen::MatrixXi & E, 13 | const int k, 14 | Eigen::MatrixXd & S) 15 | { 16 | using namespace Eigen; 17 | // Resize output 18 | S.resize(V.rows() + k * E.rows(),V.cols()); 19 | // Copy V at front of S 20 | S.block(0,0,V.rows(),V.cols()) = V; 21 | 22 | // loop over edges 23 | for(int i = 0;i 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "shortest_edge_and_midpoint.h" 9 | 10 | IGL_INLINE void igl::shortest_edge_and_midpoint( 11 | const int e, 12 | const Eigen::MatrixXd & V, 13 | const Eigen::MatrixXi & /*F*/, 14 | const Eigen::MatrixXi & E, 15 | const Eigen::VectorXi & /*EMAP*/, 16 | const Eigen::MatrixXi & /*EF*/, 17 | const Eigen::MatrixXi & /*EI*/, 18 | double & cost, 19 | Eigen::RowVectorXd & p) 20 | { 21 | cost = (V.row(E(e,0))-V.row(E(e,1))).norm(); 22 | p = 0.5*(V.row(E(e,0))+V.row(E(e,1))); 23 | } 24 | -------------------------------------------------------------------------------- /ext/libigl/igl/signed_angle.h: -------------------------------------------------------------------------------- 1 | #ifndef IGL_SIGNED_ANGLE_H 2 | #define IGL_SIGNED_ANGLE_H 3 | #include "igl_inline.h" 4 | #include 5 | namespace igl 6 | { 7 | // Compute the signed angle subtended by the oriented 3d triangle (A,B,C) at some point P 8 | // 9 | // Inputs: 10 | // A 2D position of corner 11 | // B 2D position of corner 12 | // P 2D position of query point 13 | // returns signed angle 14 | template < 15 | typename DerivedA, 16 | typename DerivedB, 17 | typename DerivedP> 18 | IGL_INLINE typename DerivedA::Scalar signed_angle( 19 | const Eigen::MatrixBase & A, 20 | const Eigen::MatrixBase & B, 21 | const Eigen::MatrixBase & P); 22 | } 23 | #ifndef IGL_STATIC_LIBRARY 24 | # include "signed_angle.cpp" 25 | #endif 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /ext/libigl/igl/solid_angle.h: -------------------------------------------------------------------------------- 1 | #ifndef IGL_SOLID_ANGLE_H 2 | #define IGL_SOLID_ANGLE_H 3 | #include "igl_inline.h" 4 | #include 5 | namespace igl 6 | { 7 | // Compute the signed solid angle subtended by the oriented 3d triangle (A,B,C) at some point P 8 | // 9 | // Inputs: 10 | // A 3D position of corner 11 | // B 3D position of corner 12 | // C 3D position of corner 13 | // P 3D position of query point 14 | // Returns signed solid angle 15 | template < 16 | typename DerivedA, 17 | typename DerivedB, 18 | typename DerivedC, 19 | typename DerivedP> 20 | IGL_INLINE typename DerivedA::Scalar solid_angle( 21 | const Eigen::MatrixBase & A, 22 | const Eigen::MatrixBase & B, 23 | const Eigen::MatrixBase & C, 24 | const Eigen::MatrixBase & P); 25 | } 26 | #ifndef IGL_STATIC_LIBRARY 27 | # include "solid_angle.cpp" 28 | #endif 29 | #endif 30 | -------------------------------------------------------------------------------- /ext/libigl/igl/speye.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "speye.h" 9 | 10 | template 11 | IGL_INLINE void igl::speye(const int m, const int n, Eigen::SparseMatrix & I) 12 | { 13 | // size of diagonal 14 | int d = (m(m,n); 16 | I.reserve(d); 17 | for(int i = 0;i 25 | IGL_INLINE void igl::speye(const int n, Eigen::SparseMatrix & I) 26 | { 27 | return igl::speye(n,n,I); 28 | } 29 | 30 | #ifdef IGL_STATIC_LIBRARY 31 | // Explicit template instantiation 32 | // generated by autoexplicit.sh 33 | template void igl::speye(int, Eigen::SparseMatrix&); 34 | template void igl::speye >(int, int, Eigen::SparseMatrix, 0, int>&); 35 | #endif 36 | -------------------------------------------------------------------------------- /ext/libigl/igl/stdin_to_temp.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "stdin_to_temp.h" 9 | 10 | #include 11 | 12 | IGL_INLINE bool igl::stdin_to_temp(FILE ** temp_file) 13 | { 14 | // get a temporary file 15 | *temp_file = tmpfile(); 16 | if(*temp_file == NULL) 17 | { 18 | fprintf(stderr,"IOError: temp file could not be created.\n"); 19 | return false; 20 | } 21 | char c; 22 | // c++'s cin handles the stdind input in a reasonable way 23 | while (std::cin.good()) 24 | { 25 | c = std::cin.get(); 26 | if(std::cin.good()) 27 | { 28 | if(1 != fwrite(&c,sizeof(char),1,*temp_file)) 29 | { 30 | fprintf(stderr,"IOError: error writing to tempfile.\n"); 31 | return false; 32 | } 33 | } 34 | } 35 | // rewind file getting it ready to read from 36 | rewind(*temp_file); 37 | return true; 38 | } 39 | -------------------------------------------------------------------------------- /ext/libigl/igl/swept_volume_bounding_box.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "swept_volume_bounding_box.h" 9 | #include "LinSpaced.h" 10 | 11 | IGL_INLINE void igl::swept_volume_bounding_box( 12 | const size_t & n, 13 | const std::function & V, 14 | const size_t & steps, 15 | Eigen::AlignedBox3d & box) 16 | { 17 | using namespace Eigen; 18 | box.setEmpty(); 19 | const VectorXd t = igl::LinSpaced(steps,0,1); 20 | // Find extent over all time steps 21 | for(int ti = 0;ti 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_TRIANGLE_FAN_H 9 | #define IGL_TRIANGLE_FAN_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Given a list of faces tesselate all of the "exterior" edges forming another 15 | // list of 16 | // 17 | // Inputs: 18 | // E #E by simplex_size-1 list of exterior edges (see exterior_edges.h) 19 | // Outputs: 20 | // cap #cap by simplex_size list of "faces" tessleating the boundary edges 21 | IGL_INLINE void triangle_fan( 22 | const Eigen::MatrixXi & E, 23 | Eigen::MatrixXi & cap); 24 | // In-line version 25 | IGL_INLINE Eigen::MatrixXi triangle_fan( const Eigen::MatrixXi & E); 26 | } 27 | #ifndef IGL_STATIC_LIBRARY 28 | # include "triangle_fan.cpp" 29 | #endif 30 | #endif 31 | -------------------------------------------------------------------------------- /ext/libigl/igl/triangles_from_strip.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "triangles_from_strip.h" 9 | #include 10 | 11 | template 12 | IGL_INLINE void igl::triangles_from_strip( 13 | const Eigen::MatrixBase& S, 14 | Eigen::PlainObjectBase& F) 15 | { 16 | using namespace std; 17 | F.resize(S.size()-2,3); 18 | for(int s = 0;s < S.size()-2;s++) 19 | { 20 | if(s%2 == 0) 21 | { 22 | F(s,0) = S(s+2); 23 | F(s,1) = S(s+1); 24 | F(s,2) = S(s+0); 25 | }else 26 | { 27 | F(s,0) = S(s+0); 28 | F(s,1) = S(s+1); 29 | F(s,2) = S(s+2); 30 | } 31 | } 32 | } 33 | 34 | #ifdef IGL_STATIC_LIBRARY 35 | // Explicit template instantiation 36 | #endif 37 | -------------------------------------------------------------------------------- /ext/libigl/igl/triangles_from_strip.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2014 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_TRIANGLES_FROM_STRIP_H 9 | #define IGL_TRIANGLES_FROM_STRIP_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // TRIANGLES_FROM_STRIP Create a list of triangles from a stream of indices 15 | // along a strip. 16 | // 17 | // Inputs: 18 | // S #S list of indices 19 | // Outputs: 20 | // F #S-2 by 3 list of triangle indices 21 | // 22 | template 23 | IGL_INLINE void triangles_from_strip( 24 | const Eigen::MatrixBase& S, 25 | Eigen::PlainObjectBase& F); 26 | } 27 | 28 | #ifndef IGL_STATIC_LIBRARY 29 | # include "triangles_from_strip.cpp" 30 | #endif 31 | 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /ext/libigl/igl/viewer/TextRenderer_fonts.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2014 Wenzel Jacob 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef IGL_TEXT_RENDERER_FONTS_H 10 | #define IGL_TEXT_RENDERER_FONTS_H 11 | 12 | #include 13 | 14 | #ifndef IGL_STATIC_LIBRARY 15 | namespace 16 | { 17 | #endif 18 | extern uint8_t igl_entypo_ttf[]; 19 | extern uint32_t igl_entypo_ttf_size; 20 | 21 | extern uint8_t igl_roboto_bold_ttf[]; 22 | extern uint32_t igl_roboto_bold_ttf_size; 23 | 24 | extern uint8_t igl_roboto_regular_ttf[]; 25 | extern uint32_t igl_roboto_regular_ttf_size; 26 | 27 | #ifndef IGL_STATIC_LIBRARY 28 | } 29 | #endif 30 | 31 | #ifndef IGL_STATIC_LIBRARY 32 | namespace 33 | { 34 | #include "TextRenderer_fonts.cpp" 35 | } 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /ext/libigl/igl/xml/write_triangle_mesh.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "write_triangle_mesh.h" 9 | #include "../write_triangle_mesh.h" 10 | #include "../pathinfo.h" 11 | #include "writeDAE.h" 12 | 13 | template 14 | IGL_INLINE bool igl::xml::write_triangle_mesh( 15 | const std::string str, 16 | const Eigen::PlainObjectBase& V, 17 | const Eigen::PlainObjectBase& F, 18 | const bool ascii) 19 | { 20 | using namespace std; 21 | // dirname, basename, extension and filename 22 | string d,b,e,f; 23 | pathinfo(str,d,b,e,f); 24 | // Convert extension to lower case 25 | std::transform(e.begin(), e.end(), e.begin(), ::tolower); 26 | if(e == "dae") 27 | { 28 | return writeDAE(str,V,F); 29 | }else 30 | { 31 | return igl::write_triangle_mesh(str,V,F,ascii); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ext/rply/LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSchertler/GeneralizedMotorcycleGraph/a34738fe34a051760b4042dc9d740231e511fec1/ext/rply/LICENSE -------------------------------------------------------------------------------- /glsl/blinnphong.frag: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | /* 4 | This file is part of the implementation for the technical paper 5 | 6 | Field-Aligned Online Surface Reconstruction 7 | Nico Schertler, Marco Tarini, Wenzel Jakob, Misha Kazhdan, Stefan Gumhold, Daniele Panozzo 8 | ACM TOG 36, 4, July 2017 (Proceedings of SIGGRAPH 2017) 9 | 10 | Use of this source code is granted via a BSD-style license, which can be found 11 | in License.txt in the repository root. 12 | 13 | @author Nico Schertler 14 | */ 15 | 16 | in FRAG_IN 17 | { 18 | vec4 pos; 19 | vec4 color; 20 | vec3 n; 21 | } frag; 22 | 23 | out vec4 result; 24 | 25 | void main(void) 26 | { 27 | vec3 h = normalize(-frag.pos.xyz); 28 | vec3 normal = normalize(frag.n.xyz); 29 | 30 | float diffuseFactor = 0.1 + 0.7 * max(0.0, abs(normalize(normal.xyz).z)); 31 | 32 | //Inside faces 33 | if(!gl_FrontFacing) 34 | diffuseFactor *= 0.5; 35 | 36 | float specularFactor = pow(abs(dot(h, normal)), 75); 37 | 38 | result = vec4(diffuseFactor * frag.color.rgb, frag.color.a) + specularFactor * vec4(1, 1, 1, 0); 39 | 40 | //Gamma correction 41 | const float gamma = 2.2 * 1.2; 42 | result.rgb = pow(result.rgb, vec3(1.0 / gamma)); 43 | } -------------------------------------------------------------------------------- /glsl/clear.frag: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | layout(location=0) out vec4 color; 4 | layout(location=1) out int id; 5 | 6 | in vec4 clipPos; 7 | 8 | void main() 9 | { 10 | float t = (clipPos.y + 1) / 2; 11 | color = (1 - t) * vec4(0.1, 0.1f, 0.3f, 1.00) + t * vec4(0.5, 0.6, 0.8, 1.0); 12 | id = -1; 13 | } -------------------------------------------------------------------------------- /glsl/clear.vert: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | const vec2 vertices[3] = vec2[]( vec2(-1.0, 1.0), vec2(-1.0, -3.0), vec2(3.0, 1.0)); 4 | 5 | out vec4 clipPos; 6 | 7 | void main() 8 | { 9 | clipPos = vec4(vertices[gl_VertexID], 0.0, 1.0); 10 | gl_Position = clipPos; 11 | } -------------------------------------------------------------------------------- /glsl/constant_color.frag: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | in vec4 vertexColor; 4 | in vec2 vertexTexCoords; 5 | 6 | uniform vec4 color; 7 | uniform bool useUniformColor; 8 | uniform bool visualizeTexCoords; 9 | uniform float texCoordScale; 10 | 11 | out vec4 result; 12 | 13 | void main() 14 | { 15 | result = (useUniformColor ? color : vertexColor); 16 | if(visualizeTexCoords) 17 | { 18 | //result.xyz *= fract(texCoordScale * vertexTexCoords.y); 19 | int cellId = (int(texCoordScale * vertexTexCoords.x) + int(texCoordScale * vertexTexCoords.y)); 20 | if(cellId % 2 == 0) 21 | ;//result.xyz *= 0.5 + 0.5 * fract(texCoordScale * vertexTexCoords.x); 22 | else 23 | result.xyz *= 0.3; 24 | //result.xyz *= 0.3 + 0.2 * fract(texCoordScale * vertexTexCoords.y); 25 | } 26 | } -------------------------------------------------------------------------------- /glsl/cylinder.vert: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | in vec3 position; 4 | in vec4 color; 5 | 6 | out vData 7 | { 8 | vec3 pos; 9 | vec4 color; 10 | } vertex; 11 | 12 | uniform mat4 mv; 13 | 14 | void main() 15 | { 16 | vertex.pos = position; 17 | vertex.color = color; 18 | } 19 | -------------------------------------------------------------------------------- /glsl/flat_shading.geom: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | /* 4 | This file is part of the implementation for the technical paper 5 | 6 | Field-Aligned Online Surface Reconstruction 7 | Nico Schertler, Marco Tarini, Wenzel Jakob, Misha Kazhdan, Stefan Gumhold, Daniele Panozzo 8 | ACM TOG 36, 4, July 2017 (Proceedings of SIGGRAPH 2017) 9 | 10 | Use of this source code is granted via a BSD-style license, which can be found 11 | in License.txt in the repository root. 12 | 13 | @author Nico Schertler 14 | */ 15 | 16 | layout(triangles) in; 17 | layout(triangle_strip, max_vertices = 3) out; 18 | 19 | in GEOM_IN 20 | { 21 | vec4 pos; 22 | vec4 color; 23 | } vIn[]; 24 | 25 | out FRAG_IN 26 | { 27 | vec4 pos; 28 | vec4 color; 29 | vec3 n; 30 | } vOut; 31 | 32 | void main(void) 33 | { 34 | vOut.n = normalize(cross(vIn[1].pos.xyz - vIn[0].pos.xyz, vIn[2].pos.xyz - vIn[0].pos.xyz)); 35 | for(int i = 0; i < 3; ++i) 36 | { 37 | vOut.pos = vIn[i].pos; 38 | vOut.color = vIn[i].color; 39 | gl_Position = gl_in[i].gl_Position; 40 | EmitVertex(); 41 | } 42 | } -------------------------------------------------------------------------------- /glsl/mesh_colors_quad.tcs: -------------------------------------------------------------------------------- 1 | #version 430 2 | 3 | layout (vertices = 4) out; 4 | 5 | uniform int R; 6 | 7 | struct QuadData 8 | { 9 | vec2 cornerTexCoords[4]; 10 | vec2 texCoords[9]; 11 | uint cPtr; 12 | }; 13 | 14 | layout(std430, binding = 0) buffer quadData 15 | { 16 | QuadData quads[]; 17 | }; 18 | 19 | out TCS_OUT 20 | { 21 | vec2 pos; 22 | } vertex[]; 23 | 24 | patch out uint quadId; 25 | 26 | void main(void) 27 | { 28 | int quadIdx = gl_PrimitiveID; 29 | int vIdx = gl_InvocationID; 30 | 31 | QuadData quad = quads[quadIdx]; 32 | vertex[gl_InvocationID].pos = quad.cornerTexCoords[gl_InvocationID]; 33 | 34 | quadId = quadIdx; 35 | 36 | gl_TessLevelOuter[0] = R; 37 | gl_TessLevelOuter[1] = R; 38 | gl_TessLevelOuter[2] = R; 39 | gl_TessLevelOuter[3] = R; 40 | 41 | gl_TessLevelInner[0] = R; 42 | gl_TessLevelInner[1] = R; 43 | } -------------------------------------------------------------------------------- /glsl/mesh_colors_tri.tcs: -------------------------------------------------------------------------------- 1 | #version 430 2 | layout (vertices = 3) out; 3 | 4 | uniform int R; 5 | 6 | struct TriData 7 | { 8 | vec2 cornerTexCoords[3]; 9 | vec2 edgeTexCoords[3]; 10 | uint cPtr; 11 | }; 12 | 13 | layout(std430, binding = 0) buffer triData 14 | { 15 | TriData tris[]; 16 | }; 17 | 18 | out TCS_OUT 19 | { 20 | vec2 pos; 21 | } vertex[]; 22 | 23 | patch out uint triId; 24 | 25 | void main(void) 26 | { 27 | int triIdx = gl_PrimitiveID; 28 | int vIdx = gl_InvocationID; 29 | 30 | TriData tri = tris[triIdx]; 31 | vertex[gl_InvocationID].pos = tri.cornerTexCoords[gl_InvocationID]; 32 | 33 | triId = triIdx; 34 | 35 | gl_TessLevelOuter[0] = R; 36 | gl_TessLevelOuter[1] = R; 37 | gl_TessLevelOuter[2] = R; 38 | 39 | gl_TessLevelInner[0] = R; 40 | } -------------------------------------------------------------------------------- /glsl/mesh_flat.vert: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | /* 4 | This file is part of the implementation for the technical paper 5 | 6 | Field-Aligned Online Surface Reconstruction 7 | Nico Schertler, Marco Tarini, Wenzel Jakob, Misha Kazhdan, Stefan Gumhold, Daniele Panozzo 8 | ACM TOG 36, 4, July 2017 (Proceedings of SIGGRAPH 2017) 9 | 10 | Use of this source code is granted via a BSD-style license, which can be found 11 | in License.txt in the repository root. 12 | 13 | @author Nico Schertler 14 | */ 15 | 16 | uniform mat4 mv; 17 | uniform mat4 mvp; 18 | 19 | in vec3 position; 20 | 21 | out GEOM_IN 22 | { 23 | vec4 pos; 24 | vec4 color; 25 | } vOut; 26 | 27 | 28 | void main() 29 | { 30 | vec4 p = vec4(position, 1); 31 | vOut.pos = mv * p; 32 | gl_Position = mvp * p; 33 | vOut.color = vec4(0.933, 0.839, 0.686, 1); 34 | } -------------------------------------------------------------------------------- /glsl/simple.vert: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | in vec4 position; 4 | in vec4 color; 5 | in vec2 texCoords; 6 | 7 | out vec4 vertexColor; 8 | out vec2 vertexTexCoords; 9 | 10 | uniform mat4 mvp; 11 | 12 | void main() 13 | { 14 | gl_Position = mvp * position; 15 | vertexColor = color; 16 | vertexTexCoords = texCoords; 17 | } -------------------------------------------------------------------------------- /glsl/sphere.vert: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | /* 4 | This file is part of the implementation for the technical paper 5 | 6 | Field-Aligned Online Surface Reconstruction 7 | Nico Schertler, Marco Tarini, Wenzel Jakob, Misha Kazhdan, Stefan Gumhold, Daniele Panozzo 8 | ACM TOG 36, 4, July 2017 (Proceedings of SIGGRAPH 2017) 9 | 10 | Use of this source code is granted via a BSD-style license, which can be found 11 | in License.txt in the repository root. 12 | 13 | @author Nico Schertler 14 | */ 15 | 16 | in vec4 positionRadius; 17 | in vec4 color; 18 | 19 | out vData 20 | { 21 | vec4 pos; 22 | vec4 color; 23 | float radius; 24 | } vertex; 25 | 26 | uniform mat4 mv; 27 | uniform bool constantRadius; 28 | uniform float radius; 29 | 30 | void main() 31 | { 32 | vec4 p = vec4(positionRadius.xyz, 1); 33 | vertex.pos = mv * p; 34 | vertex.radius = (constantRadius ? radius : positionRadius.w * length(mv[0].xyz)); 35 | vertex.color = color; 36 | } 37 | -------------------------------------------------------------------------------- /glsl/void.vert: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | /* 4 | This file is part of the implementation for the technical paper 5 | 6 | Field-Aligned Online Surface Reconstruction 7 | Nico Schertler, Marco Tarini, Wenzel Jakob, Misha Kazhdan, Stefan Gumhold, Daniele Panozzo 8 | ACM TOG 36, 4, July 2017 (Proceedings of SIGGRAPH 2017) 9 | 10 | Use of this source code is granted via a BSD-style license, which can be found 11 | in License.txt in the repository root. 12 | 13 | @author Nico Schertler 14 | */ 15 | 16 | void main() 17 | { 18 | } 19 | -------------------------------------------------------------------------------- /include/ArclengthStrategyGurobi.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ParametrizationData.h" 4 | #include "ParametrizationInterfaces.h" 5 | #include 6 | 7 | //Represents a strategy that calculates integer arc lengths using a global constrained quadratic energy and Gurobi. 8 | class ArclengthStrategyGurobi : public IArclengthStrategy 9 | { 10 | public: 11 | //Instantiates the strategy. 12 | //discreteOptimizationTimeLimit - the time limit after which optimization is stopped; there may or may not be a result after that 13 | ArclengthStrategyGurobi(const std::chrono::steady_clock::duration& discreteOptimizationTimeLimit); 14 | 15 | void CalculateParametricLengths(ParametrizationData& optData); 16 | 17 | private: 18 | //The time limit after which optimization is stopped. 19 | const std::chrono::steady_clock::duration& discreteOptimizationTimeLimit; 20 | }; -------------------------------------------------------------------------------- /include/ArclengthStrategyGurobiSeparate.h: -------------------------------------------------------------------------------- 1 | #include "ParametrizationInterfaces.h" 2 | 3 | //Represents a strategy that calculates integer arc lengths using separate quadratic energies per patch and Gurobi. 4 | class ArclengthStrategyGurobiSeparate : public IArclengthStrategy 5 | { 6 | public: 7 | void CalculateParametricLengths(ParametrizationData& optData); 8 | }; -------------------------------------------------------------------------------- /include/Data.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSchertler/GeneralizedMotorcycleGraph/a34738fe34a051760b4042dc9d740231e511fec1/include/Data.h -------------------------------------------------------------------------------- /include/MotorcycleGraph.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSchertler/GeneralizedMotorcycleGraph/a34738fe34a051760b4042dc9d740231e511fec1/include/MotorcycleGraph.h -------------------------------------------------------------------------------- /include/MultiplierStrategyAllInvalid.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ParametrizationData.h" 4 | #include "ParametrizationInterfaces.h" 5 | 6 | #include 7 | 8 | class MultiplierStrategyAllInvalid : public IMultiplierStrategy 9 | { 10 | public: 11 | void CalculateMultipliers(ParametrizationData& optData) 12 | { 13 | nse::util::TimedBlock b("Invalidating all arc constraints .."); 14 | 15 | #pragma omp parallel for 16 | for (int i = 0; i < optData.arcConstraints.size(); ++i) 17 | optData.arcConstraints[i].broken = true; 18 | } 19 | }; -------------------------------------------------------------------------------- /include/MultiplierStrategyIterativeRounding.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ParametrizationData.h" 4 | #include "ParametrizationInterfaces.h" 5 | 6 | //Deprecated 7 | class MultiplierStrategyIterativeRounding : public IMultiplierStrategy 8 | { 9 | public: 10 | void CalculateMultipliers(ParametrizationData& optData); 11 | }; -------------------------------------------------------------------------------- /include/ParametrizationInterfaces.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ParametrizationData.h" 4 | 5 | class ITargetlengthStrategy 6 | { 7 | public: 8 | virtual void SetParametricTargetLength(ParametrizationData& optData) = 0; 9 | }; 10 | 11 | 12 | class IMultiplierStrategy 13 | { 14 | public: 15 | virtual void CalculateMultipliers(ParametrizationData& optData) = 0; 16 | }; 17 | 18 | 19 | class IArclengthStrategy 20 | { 21 | public: 22 | virtual void CalculateParametricLengths(ParametrizationData& optData) = 0; 23 | }; 24 | 25 | 26 | class IParameterizationStrategy 27 | { 28 | public: 29 | // 30 | // parametrizationErrorThreshold - the patch energy above which more seams are made visible in order to reduce distortion 31 | virtual void CalculateParameterization(ParametrizationData& data, float parametrizationErrorThreshold) = 0; 32 | }; -------------------------------------------------------------------------------- /include/ParametrizationStrategyLSCMForInteriorScaffoldForBoundary.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ParametrizationData.h" 4 | #include "ParametrizationInterfaces.h" 5 | 6 | //Parametrization strategy that uses LSCM for patches without an open boundary and 7 | //scaffold map for all other patches. 8 | class ParametrizationStrategyLSCMForInteriorScaffoldForBoundary : public IParameterizationStrategy 9 | { 10 | public: 11 | ParametrizationStrategyLSCMForInteriorScaffoldForBoundary(float factor); 12 | void CalculateParameterization(ParametrizationData& data, float parametrizationErrorThreshold); 13 | 14 | private: 15 | float factor; 16 | }; -------------------------------------------------------------------------------- /include/Patch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "common.h" 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | //Represents a patch of (not necessarily connected) faces of an underlying mesh by their boundary. 11 | class Patch 12 | { 13 | public: 14 | 15 | }; 16 | -------------------------------------------------------------------------------- /include/PatchSet.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "common.h" 4 | #include "FencedRegion.h" 5 | 6 | #include 7 | #include 8 | 9 | struct EnteringEdge 10 | { 11 | size_t patchIdx; 12 | int enteringViaEdgeColor; 13 | 14 | EnteringEdge() { } 15 | 16 | EnteringEdge(size_t patchIdx, int enteringViaEdgeColor) 17 | : patchIdx(patchIdx), enteringViaEdgeColor(enteringViaEdgeColor) 18 | { } 19 | }; 20 | 21 | struct PatchSet 22 | { 23 | std::map enteringEdgeToPatch; 24 | 25 | std::vector patches; 26 | 27 | void clear() 28 | { 29 | patches.clear(); 30 | enteringEdgeToPatch.clear(); 31 | } 32 | }; -------------------------------------------------------------------------------- /include/PolygonTriangulation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | //Triangulates a 3D polygon according to the DP algorithm presented in 9 | // Filling gaps in the boundary of a polyhedron, Barequet and Sharir, Computer Aided Geometric Design 1995 10 | extern std::vector> TriangulatePolygon(const std::vector& polygon); -------------------------------------------------------------------------------- /include/Statistics.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class Statistics 6 | { 7 | public: 8 | void AddDatum(float datum); 9 | 10 | void Clear(); 11 | 12 | std::size_t Size() const; 13 | 14 | void SetGlobalShift(float shift); 15 | 16 | float Average() const; 17 | float Median(); 18 | 19 | //p between 0 and 1 20 | float Percentile(float p); 21 | 22 | float Variance() const; 23 | 24 | float Min(); 25 | 26 | float Max(); 27 | 28 | private: 29 | 30 | void Sort(); 31 | 32 | std::vector data; 33 | 34 | float sum = 0; 35 | 36 | bool isSorted = true; 37 | 38 | float globalShift = 0; //an offset that is added to all data 39 | }; -------------------------------------------------------------------------------- /include/TargetLengthStrategySimple.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ParametrizationData.h" 4 | #include "ParametrizationInterfaces.h" 5 | 6 | //Strategy that sets the target lengths of all halfarcs to their respective number of comprising edges. 7 | class TargetLengthStrategySimple : public ITargetlengthStrategy 8 | { 9 | public: 10 | TargetLengthStrategySimple() 11 | { } 12 | 13 | void SetParametricTargetLength(ParametrizationData& optData) 14 | { 15 | #pragma omp parallel for 16 | for (int i = 0; i < optData.halfarcs.size(); ++i) 17 | { 18 | optData.parametricHalfarcTargetLengths[i] = optData.halfarcs[i].Length(); 19 | } 20 | } 21 | }; -------------------------------------------------------------------------------- /include/common.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSchertler/GeneralizedMotorcycleGraph/a34738fe34a051760b4042dc9d740231e511fec1/include/common.h -------------------------------------------------------------------------------- /include/gui/ShaderPool.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | //Singleton. Holds all shaders during the runtime of the application. 6 | class ShaderPool 7 | { 8 | private: 9 | static ShaderPool* _instance; 10 | ShaderPool(); 11 | 12 | public: 13 | static ShaderPool* Instance(); 14 | void CompileAll(); 15 | 16 | //Shader that renders a mesh using flat shading 17 | nse::gui::GLShader FlatMeshShader; 18 | 19 | //Shader that renders a sphere using raycasting 20 | nse::gui::GLShader SphereShader; 21 | 22 | //Shader that renders objects with a constant color without illumination 23 | nse::gui::GLShader SimpleShader; 24 | 25 | //Shader used to clear the render target 26 | nse::gui::GLShader ClearShader; 27 | 28 | //Shader that renders cylinders using raycasting 29 | nse::gui::GLShader CylinderShader; 30 | 31 | //Shader used to render mesh colors to texture 32 | nse::gui::GLShader MeshColorsQuadShader; 33 | 34 | //Shader used to render mesh colors to texture 35 | nse::gui::GLShader MeshColorsTriShader; 36 | }; -------------------------------------------------------------------------------- /include/meshio.h: -------------------------------------------------------------------------------- 1 | /* 2 | @author Wenzel Jakob 3 | @author Nico Schertler 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "common.h" 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | #ifndef _WIN32 15 | #include 16 | #endif 17 | 18 | 19 | extern void LoadMesh(const std::string &filename, Matrix3Xf& V, FaceList& F); 20 | 21 | extern void load_obj(const std::string &filename, Matrix3Xf &V, FaceList& F, Matrix2Xf &T, FaceList& FT); -------------------------------------------------------------------------------- /src/ParametrizationData.cpp: -------------------------------------------------------------------------------- 1 | #include "ParametrizationData.h" 2 | 3 | FaceConstraintInfo::FaceConstraintInfo(ParametrizationData* optData, int face, ConstraintDirection direction) 4 | : optData(optData) 5 | { 6 | int patchSides[2] = { direction == LeftRight ? 0 : 1, direction == LeftRight ? 2 : 3 }; 7 | 8 | auto& f = optData->patches[face]; 9 | if (f.PatchSides().size() != 4) 10 | return; 11 | if (f.PatchSides()[patchSides[0]].size() == 0 || f.PatchSides()[patchSides[1]].size() == 0) 12 | return; 13 | 14 | for (int k = 0; k < 2; ++k) 15 | { 16 | auto currentSide = patchSides[k]; 17 | canGrow[k] = f.CanSideGrow(currentSide); 18 | for (int i = 0; i < f.PatchSides()[currentSide].size(); ++i) 19 | { 20 | auto arcIdx = f.PatchSides()[currentSide][i]; 21 | 22 | auto& arc = optData->graph->Halfarcs()[arcIdx]; 23 | auto arcEdge = optData->graph->MotorcycleHalfedge(*arc.begin()); 24 | 25 | bool isBoundary = optData->mesh->is_boundary(arcEdge) || optData->mesh->is_boundary(optData->mesh->opposite_halfedge_handle(arcEdge)); 26 | 27 | if(!isBoundary) 28 | arcs[k].push_back(arcIdx); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /src/Patch.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSchertler/GeneralizedMotorcycleGraph/a34738fe34a051760b4042dc9d740231e511fec1/src/Patch.cpp -------------------------------------------------------------------------------- /src/common.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSchertler/GeneralizedMotorcycleGraph/a34738fe34a051760b4042dc9d740231e511fec1/src/common.cpp -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "gui/Viewer.h" 4 | 5 | #include 6 | 7 | int main() 8 | { 9 | try 10 | { 11 | #if _WIN32 12 | std::cout.imbue(std::locale("en-US")); 13 | #else 14 | std::cout.imbue(std::locale("en_US.utf8")); 15 | #endif 16 | } 17 | catch (...) 18 | { 19 | std::cerr << "Warning: Could not set english locale." << std::endl; 20 | } 21 | 22 | nanogui::init(); 23 | 24 | { 25 | nanogui::ref viewer = new Viewer(); 26 | viewer->setVisible(true); 27 | 28 | nse::util::GLDebug::SetupDebugCallback(); 29 | nse::util::GLDebug::IgnoreGLError(131185); 30 | 31 | try 32 | { 33 | nanogui::mainloop(); 34 | } 35 | catch (std::runtime_error& e) 36 | { 37 | std::cerr << e.what() << std::endl; 38 | } 39 | 40 | } 41 | 42 | nanogui::shutdown(); 43 | 44 | return 0; 45 | } -------------------------------------------------------------------------------- /src/stbi_impl.cpp: -------------------------------------------------------------------------------- 1 | #define STB_IMAGE_WRITE_IMPLEMENTATION 2 | #include "stb_image_write.h" --------------------------------------------------------------------------------