├── .clang-format ├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md ├── tsan.suppressions.ini └── workflows │ ├── continuous.yaml │ └── wheel.yaml ├── .gitignore ├── CMakeLists.txt ├── CODE_OF_CONDUCT.md ├── LICENSE ├── LagrangeOptions.cmake.sample ├── NOTICE.txt ├── README.md ├── VERSION ├── cmake ├── lagrange │ ├── lagrangeConfig.cmake.in │ ├── lagrangeMklModules.txt │ ├── lagrange_add_compile_test.cmake │ ├── lagrange_add_example.cmake │ ├── lagrange_add_executable.cmake │ ├── lagrange_add_module.cmake │ ├── lagrange_add_performance.cmake │ ├── lagrange_add_python_binding.cmake │ ├── lagrange_add_test.cmake │ ├── lagrange_alias_target.cmake │ ├── lagrange_config_from_preset.cmake │ ├── lagrange_copy_headers.cmake │ ├── lagrange_cpm_cache.cmake │ ├── lagrange_download_data.cmake │ ├── lagrange_filter_flags.cmake │ ├── lagrange_find_package.cmake │ ├── lagrange_global_flags.cmake │ ├── lagrange_has_onetbb.cmake │ ├── lagrange_include_modules.cmake │ ├── lagrange_install.cmake │ ├── lagrange_limit_parallelism.cmake │ ├── lagrange_runtime_dependencies.cmake │ ├── lagrange_set_sanitizers.cmake │ ├── lagrange_tbb_sanitizers.cmake │ ├── lagrange_vcpkg_toolchain.cmake │ ├── lagrange_warnings.cmake │ └── lagrange_xcode_check.cmake └── recipes │ └── external │ ├── Boost.cmake │ ├── Boost.wasm.patch │ ├── CPM.cmake │ ├── Eigen3.cmake │ ├── MKL.cmake │ ├── MKL.json │ ├── OpenSubdiv.cmake │ ├── OpenVDB.cmake │ ├── TBB.cmake │ ├── assimp.cmake │ ├── assimp.patch │ ├── blas.cmake │ ├── blosc.cmake │ ├── catch2.cmake │ ├── cli11.cmake │ ├── clipper2.cmake │ ├── code-coverage.cmake │ ├── cpptrace.cmake │ ├── embree.cmake │ ├── embree.patch │ ├── entt.cmake │ ├── filesystem.cmake │ ├── fmt.cmake │ ├── geometry-central.cmake │ ├── gklib.cmake │ ├── gl3w.cmake │ ├── glad.cmake │ ├── glfw.cmake │ ├── happly.cmake │ ├── ilmbase.cmake │ ├── imgui.cmake │ ├── imgui_fonts.cmake │ ├── imguizmo.cmake │ ├── lagrange-assets.cmake │ ├── lapack.cmake │ ├── libigl.cmake │ ├── metis.cmake │ ├── mikktspace.cmake │ ├── miniz.cmake │ ├── mshio.cmake │ ├── nanobind.cmake │ ├── nanoflann.cmake │ ├── nanort.cmake │ ├── nanosvg.cmake │ ├── nasoq.cmake │ ├── nlohmann_json.cmake │ ├── onetbb.cmake │ ├── openblas.cmake │ ├── pcg.cmake │ ├── poissonrecon.cmake │ ├── polyscope.cmake │ ├── portable_file_dialogs.cmake │ ├── python.cmake │ ├── quadprog.cmake │ ├── sanitizers.cmake │ ├── shape_gradient_domain.cmake │ ├── simde.cmake │ ├── span-lite.cmake │ ├── span-lite.natvis │ ├── spdlog.cmake │ ├── stackwalker.cmake │ ├── stb.cmake │ ├── tinyad.cmake │ ├── tinyexr.cmake │ ├── tinygltf.cmake │ ├── tinyobjloader.cmake │ ├── tracy.cmake │ ├── ufbx.cmake │ └── winding_number.cmake ├── docs ├── code │ └── CMakeLists.txt ├── cpp │ ├── CMakeLists.txt │ ├── Doxyfile │ ├── DoxygenLayout.xml │ └── header.html └── python │ ├── .gitignore │ ├── Makefile │ ├── make.bat │ └── source │ ├── _static │ └── .gitkeep │ ├── _templates │ └── .gitkeep │ ├── conf.py │ └── index.rst ├── modules ├── CMakeLists.txt ├── bvh │ ├── CMakeLists.txt │ ├── examples │ │ ├── CMakeLists.txt │ │ └── weld_vertices.cpp │ ├── include │ │ └── lagrange │ │ │ └── bvh │ │ │ ├── AABBIGL.h │ │ │ ├── BVH.h │ │ │ ├── BVHNanoflann.h │ │ │ ├── BVHType.h │ │ │ ├── EdgeAABBTree.h │ │ │ ├── EdgeAABBTree.impl.h │ │ │ ├── create_BVH.h │ │ │ ├── project_attributes_closest_vertex.h │ │ │ └── zip_boundary.h │ └── tests │ │ ├── CMakeLists.txt │ │ ├── test_AABBIGL.cpp │ │ ├── test_BVHNanoflann.cpp │ │ ├── test_EdgeAABBTree.cpp │ │ ├── test_projection.cpp │ │ └── test_zip_boundary.cpp ├── core │ ├── CMakeLists.txt │ ├── core.md │ ├── examples │ │ ├── CMakeLists.txt │ │ ├── fix_nonmanifold.cpp │ │ ├── mesh_cleanup.cpp │ │ └── mesh_viewer.cpp │ ├── include │ │ └── lagrange │ │ │ ├── ActingMeshGeometry.h │ │ │ ├── Attribute.h │ │ │ ├── AttributeFwd.h │ │ │ ├── AttributeTypes.h │ │ │ ├── AttributeValueType.h │ │ │ ├── Attributes.h │ │ │ ├── Components.h │ │ │ ├── Connectivity.h │ │ │ ├── DisjointSets.h │ │ │ ├── DistortionMetric.h │ │ │ ├── Edge.h │ │ │ ├── ExactPredicates.h │ │ │ ├── ExactPredicatesShewchuk.h │ │ │ ├── GenuineMeshGeometry.h │ │ │ ├── IndexedAttribute.h │ │ │ ├── IndexedAttributes.h │ │ │ ├── Logger.h │ │ │ ├── Mesh.h │ │ │ ├── MeshGeometry.h │ │ │ ├── MeshNavigation.h │ │ │ ├── MeshTopology.h │ │ │ ├── MeshTrait.h │ │ │ ├── NormalWeightingType.h │ │ │ ├── SurfaceMesh.h │ │ │ ├── SurfaceMeshTypes.h │ │ │ ├── api.h │ │ │ ├── attribute_names.h │ │ │ ├── attributes │ │ │ ├── attribute_utils.h │ │ │ ├── condense_indexed_attribute.h │ │ │ ├── eval_as_attribute.h │ │ │ ├── map_attributes.h │ │ │ ├── map_corner_attributes.h │ │ │ ├── map_facet_attributes.h │ │ │ ├── map_indexed_attributes.h │ │ │ ├── map_vertex_attributes.h │ │ │ ├── rename_attribute.h │ │ │ ├── unify_corner_indices.h │ │ │ └── unify_index_buffer.h │ │ │ ├── cast.h │ │ │ ├── cast_attribute.h │ │ │ ├── chain_corners_around_edges.h │ │ │ ├── chain_corners_around_vertices.h │ │ │ ├── chain_edges.h │ │ │ ├── chain_edges_into_simple_loops.h │ │ │ ├── combine_mesh_list.h │ │ │ ├── combine_meshes.h │ │ │ ├── common.h │ │ │ ├── compute_area.h │ │ │ ├── compute_barycentric_coordinates.h │ │ │ ├── compute_bordered_components.h │ │ │ ├── compute_centroid.h │ │ │ ├── compute_components.h │ │ │ ├── compute_corner_normal.h │ │ │ ├── compute_dihedral_angles.h │ │ │ ├── compute_dijkstra_distance.h │ │ │ ├── compute_edge_lengths.h │ │ │ ├── compute_euler.h │ │ │ ├── compute_facet_area.h │ │ │ ├── compute_facet_normal.h │ │ │ ├── compute_greedy_coloring.h │ │ │ ├── compute_lift_operator.h │ │ │ ├── compute_mesh_centroid.h │ │ │ ├── compute_mesh_covariance.h │ │ │ ├── compute_normal.h │ │ │ ├── compute_pointcloud_pca.h │ │ │ ├── compute_seam_edges.h │ │ │ ├── compute_tangent_bitangent.h │ │ │ ├── compute_triangle_normal.h │ │ │ ├── compute_uv_charts.h │ │ │ ├── compute_uv_distortion.h │ │ │ ├── compute_uv_tile_list.h │ │ │ ├── compute_vertex_normal.h │ │ │ ├── compute_vertex_valence.h │ │ │ ├── compute_vertex_vertex_adjacency.h │ │ │ ├── compute_weighted_corner_normal.h │ │ │ ├── corner_to_edge_mapping.h │ │ │ ├── corner_to_edge_mapping.impl.h │ │ │ ├── create_mesh.h │ │ │ ├── eigen_convert.h │ │ │ ├── experimental │ │ │ ├── Array.h │ │ │ ├── Array.impl.h │ │ │ ├── Array.serialization.h │ │ │ ├── Attribute.h │ │ │ ├── AttributeManager.h │ │ │ ├── IndexedAttribute.h │ │ │ ├── IndexedAttributeManager.h │ │ │ ├── Scalar.h │ │ │ └── create_array.h │ │ │ ├── extract_boundary_loops.h │ │ │ ├── extract_submesh.h │ │ │ ├── filter_attributes.h │ │ │ ├── find_matching_attributes.h │ │ │ ├── foreach_attribute.h │ │ │ ├── get_opposite_edge.h │ │ │ ├── internal │ │ │ ├── attribute_string_utils.h │ │ │ ├── bfs_orient.h │ │ │ ├── delaunay_split.h │ │ │ ├── dijkstra.h │ │ │ ├── doublearea.h │ │ │ ├── fast_edge_sort.h │ │ │ ├── find_attribute_utils.h │ │ │ ├── get_uv_attribute.h │ │ │ ├── internal_angles.h │ │ │ ├── invert_mapping.h │ │ │ ├── map_attributes.h │ │ │ ├── orientable_patches.h │ │ │ ├── shared_ptr.h │ │ │ ├── skinning.h │ │ │ ├── smart_ptr │ │ │ │ ├── control_block.h │ │ │ │ ├── default_delete.h │ │ │ │ └── ptr.h │ │ │ ├── sortrows.h │ │ │ ├── string_from_scalar.h │ │ │ ├── unique_rows.h │ │ │ ├── vertex_components.h │ │ │ ├── visit_attribute.h │ │ │ └── weak_ptr.h │ │ │ ├── isoline.h │ │ │ ├── legacy │ │ │ ├── Components.h │ │ │ ├── MeshTopology.h │ │ │ ├── attributes │ │ │ │ ├── attribute_utils.h │ │ │ │ ├── condense_indexed_attribute.h │ │ │ │ ├── eval_as_attribute.h │ │ │ │ ├── map_attributes.h │ │ │ │ ├── map_corner_attributes.h │ │ │ │ ├── map_facet_attributes.h │ │ │ │ ├── map_indexed_attributes.h │ │ │ │ ├── map_vertex_attributes.h │ │ │ │ ├── rename_attribute.h │ │ │ │ ├── unify_corner_indices.h │ │ │ │ └── unify_index_buffer.h │ │ │ ├── chain_edges.h │ │ │ ├── chain_edges_into_simple_loops.h │ │ │ ├── check_flipped_uv.h │ │ │ ├── combine_mesh_list.h │ │ │ ├── compute_bordered_components.h │ │ │ ├── compute_corner_normal.h │ │ │ ├── compute_dihedral_angles.h │ │ │ ├── compute_dijkstra_distance.h │ │ │ ├── compute_edge_lengths.h │ │ │ ├── compute_euler.h │ │ │ ├── compute_facet_area.h │ │ │ ├── compute_mesh_centroid.h │ │ │ ├── compute_mesh_covariance.h │ │ │ ├── compute_normal.h │ │ │ ├── compute_pointcloud_pca.h │ │ │ ├── compute_tangent_bitangent.h │ │ │ ├── compute_triangle_normal.h │ │ │ ├── compute_uv_distortion.h │ │ │ ├── compute_vertex_normal.h │ │ │ ├── compute_vertex_valence.h │ │ │ ├── extract_boundary_loops.h │ │ │ ├── extract_submesh.h │ │ │ ├── inline.h │ │ │ ├── internal │ │ │ │ └── dijkstra.h │ │ │ ├── marching_triangles.h │ │ │ ├── normalize_meshes.h │ │ │ ├── orient_outward.h │ │ │ ├── quad_to_tri.h │ │ │ ├── reorder_mesh_vertices.h │ │ │ ├── select_facets_by_normal_similarity.h │ │ │ ├── select_facets_in_frustum.h │ │ │ └── thicken_and_close_mesh.h │ │ │ ├── map_attribute.h │ │ │ ├── marching_triangles.h │ │ │ ├── mesh_cleanup │ │ │ ├── close_small_holes.h │ │ │ ├── detect_degenerate_facets.h │ │ │ ├── detect_degenerate_triangles.h │ │ │ ├── is_vertex_manifold.h │ │ │ ├── legacy │ │ │ │ ├── close_small_holes.h │ │ │ │ ├── detect_degenerate_triangles.h │ │ │ │ ├── is_vertex_manifold.h │ │ │ │ ├── remove_degenerate_triangles.h │ │ │ │ ├── remove_duplicate_facets.h │ │ │ │ ├── remove_duplicate_vertices.h │ │ │ │ ├── remove_isolated_vertices.h │ │ │ │ ├── remove_null_area_triangles.h │ │ │ │ ├── remove_short_edges.h │ │ │ │ ├── remove_topologically_degenerate_triangles.h │ │ │ │ ├── resolve_nonmanifoldness.h │ │ │ │ ├── resolve_vertex_nonmanifoldness.h │ │ │ │ ├── split_long_edges.h │ │ │ │ └── split_triangle.h │ │ │ ├── remove_degenerate_facets.h │ │ │ ├── remove_degenerate_triangles.h │ │ │ ├── remove_duplicate_facets.h │ │ │ ├── remove_duplicate_vertices.h │ │ │ ├── remove_isolated_vertices.h │ │ │ ├── remove_null_area_facets.h │ │ │ ├── remove_null_area_triangles.h │ │ │ ├── remove_short_edges.h │ │ │ ├── remove_topologically_degenerate_facets.h │ │ │ ├── remove_topologically_degenerate_triangles.h │ │ │ ├── rescale_uv_charts.h │ │ │ ├── resolve_nonmanifoldness.h │ │ │ ├── resolve_vertex_nonmanifoldness.h │ │ │ ├── split_long_edges.h │ │ │ ├── split_triangle.h │ │ │ └── unflip_uv_triangles.h │ │ │ ├── mesh_convert.h │ │ │ ├── mesh_convert.impl.h │ │ │ ├── normalize_meshes.h │ │ │ ├── orient_outward.h │ │ │ ├── orientation.h │ │ │ ├── permute_facets.h │ │ │ ├── permute_vertices.h │ │ │ ├── point_on_segment.h │ │ │ ├── point_segment_squared_distance.h │ │ │ ├── point_triangle_squared_distance.h │ │ │ ├── quad_to_tri.h │ │ │ ├── remap_vertices.h │ │ │ ├── reorder_mesh.h │ │ │ ├── reorder_mesh_vertices.h │ │ │ ├── sample_points_on_surface.h │ │ │ ├── segment_segment_squared_distance.h │ │ │ ├── select_facets_by_normal_similarity.h │ │ │ ├── select_facets_in_frustum.h │ │ │ ├── separate_by_components.h │ │ │ ├── separate_by_facet_groups.h │ │ │ ├── thicken_and_close_mesh.h │ │ │ ├── topology.h │ │ │ ├── transform_mesh.h │ │ │ ├── triangulate_polygonal_facets.h │ │ │ ├── types │ │ │ ├── ConnectivityType.h │ │ │ ├── MappingPolicy.h │ │ │ └── TransformOptions.h │ │ │ ├── unify_index_buffer.h │ │ │ ├── utils │ │ │ ├── AdjacencyList.h │ │ │ ├── BitField.h │ │ │ ├── DisjointSets.h │ │ │ ├── Error.h │ │ │ ├── ProgressCallback.h │ │ │ ├── SharedSpan.h │ │ │ ├── SmallSet.h │ │ │ ├── SmallVector.h │ │ │ ├── StackSet.h │ │ │ ├── StackVector.h │ │ │ ├── assert.h │ │ │ ├── build.h │ │ │ ├── chain_edges.h │ │ │ ├── copy_on_write_ptr.h │ │ │ ├── fmt_eigen.h │ │ │ ├── fpe.h │ │ │ ├── function_ref.h │ │ │ ├── geometry2d.h │ │ │ ├── geometry3d.h │ │ │ ├── hash.h │ │ │ ├── invalid.h │ │ │ ├── point_on_segment.h │ │ │ ├── point_segment_squared_distance.h │ │ │ ├── point_triangle_squared_distance.h │ │ │ ├── quad_area.h │ │ │ ├── range.h │ │ │ ├── safe_cast.h │ │ │ ├── scope_guard.h │ │ │ ├── span.h │ │ │ ├── stl_eigen.h │ │ │ ├── strings.h │ │ │ ├── tbb.h │ │ │ ├── timing.h │ │ │ ├── tracy.h │ │ │ ├── triangle_area.h │ │ │ ├── triangle_orientation_2d.h │ │ │ ├── triangle_uv_distortion.h │ │ │ ├── utils.h │ │ │ ├── value_ptr.h │ │ │ ├── warning.h │ │ │ ├── warnoff.h │ │ │ └── warnon.h │ │ │ ├── uv_mesh.h │ │ │ ├── views.h │ │ │ └── weld_indexed_attribute.h │ ├── performance │ │ ├── CMakeLists.txt │ │ ├── attributes │ │ │ └── condense_uv.cpp │ │ ├── components.cpp │ │ ├── connectivity.cpp │ │ ├── dijkstra.cpp │ │ ├── experimental │ │ │ └── array.cpp │ │ ├── marquee.cpp │ │ ├── mesh_initialization.cpp │ │ ├── predicates_speed.cpp │ │ ├── refine.cpp │ │ ├── remove_degenerate_triangles.cpp │ │ ├── remove_duplicate_vertices.cpp │ │ ├── remove_short_edges.cpp │ │ ├── repeated_loading.cpp │ │ ├── resolve_nonmanifoldness.cpp │ │ ├── select_vertices_speed.cpp │ │ ├── unify_index_buffer.cpp │ │ └── view_tangent_frame.cpp │ ├── python │ │ ├── CMakeLists.txt │ │ ├── include │ │ │ └── lagrange │ │ │ │ └── python │ │ │ │ ├── core.h │ │ │ │ ├── tensor_utils.h │ │ │ │ └── utils │ │ │ │ └── StackVector.h │ │ ├── scripts │ │ │ ├── meshconvert.py │ │ │ └── meshstat.py │ │ ├── src │ │ │ ├── PyAttribute.h │ │ │ ├── PyIndexedAttribute.h │ │ │ ├── bind_attribute.h │ │ │ ├── bind_enum.cpp │ │ │ ├── bind_enum.h │ │ │ ├── bind_indexed_attribute.h │ │ │ ├── bind_mesh_cleanup.h │ │ │ ├── bind_surface_mesh.h │ │ │ ├── bind_utilities.h │ │ │ ├── core.cpp │ │ │ ├── logging.cpp │ │ │ ├── logging.h │ │ │ └── tensor_utils.cpp │ │ └── tests │ │ │ ├── assets.py │ │ │ ├── test_attribute.py │ │ │ ├── test_cast_attribute.py │ │ │ ├── test_close_small_holes.py │ │ │ ├── test_combine_meshes.py │ │ │ ├── test_compute_centroid.py │ │ │ ├── test_compute_components.py │ │ │ ├── test_compute_dihedral_angles.py │ │ │ ├── test_compute_dijkstra_distance.py │ │ │ ├── test_compute_edge_lengths.py │ │ │ ├── test_compute_facet_area.py │ │ │ ├── test_compute_facet_normal.py │ │ │ ├── test_compute_mesh_covariance.py │ │ │ ├── test_compute_normal.py │ │ │ ├── test_compute_pointcloud_pca.py │ │ │ ├── test_compute_seam_edges.py │ │ │ ├── test_compute_tangent_bitangent.py │ │ │ ├── test_compute_uv_distortion.py │ │ │ ├── test_compute_vertex_normal.py │ │ │ ├── test_compute_vertex_valence.py │ │ │ ├── test_detect_degenerate_facets.py │ │ │ ├── test_filter_attributes.py │ │ │ ├── test_indexed_attribute.py │ │ │ ├── test_isoline.py │ │ │ ├── test_normalize_meshes.py │ │ │ ├── test_orient_outward.py │ │ │ ├── test_permute_facets.py │ │ │ ├── test_permute_vertices.py │ │ │ ├── test_remap_vertices.py │ │ │ ├── test_remove_degenerate_facets.py │ │ │ ├── test_remove_duplicate_vertices.py │ │ │ ├── test_remove_null_area_facets.py │ │ │ ├── test_remove_short_edges.py │ │ │ ├── test_remove_topologically_degenerate_facets.py │ │ │ ├── test_resolve_nonmanifoldness.py │ │ │ ├── test_select_facets_by_normal_similarity.py │ │ │ ├── test_select_facets_in_frustum.py │ │ │ ├── test_split_long_edges.py │ │ │ ├── test_surface_mesh.py │ │ │ ├── test_thicken_and_close_mesh.py │ │ │ ├── test_transform_mesh.py │ │ │ ├── test_triangulate_polygonal_facets.py │ │ │ ├── test_unify_index_buffer.py │ │ │ ├── test_weld_indexed_attribute.py │ │ │ └── utils.py │ ├── src │ │ ├── Attribute.cpp │ │ ├── ExactPredicates.cpp │ │ ├── ExactPredicatesShewchuk.cpp │ │ ├── IndexedAttribute.cpp │ │ ├── Logger.cpp │ │ ├── Mesh.cpp │ │ ├── SurfaceMesh.cpp │ │ ├── cast.cpp │ │ ├── cast_attribute.cpp │ │ ├── combine_meshes.cpp │ │ ├── compute_area.cpp │ │ ├── compute_centroid.cpp │ │ ├── compute_components.cpp │ │ ├── compute_dihedral_angles.cpp │ │ ├── compute_dijkstra_distance.cpp │ │ ├── compute_edge_lengths.cpp │ │ ├── compute_facet_normal.cpp │ │ ├── compute_greedy_coloring.cpp │ │ ├── compute_mesh_covariance.cpp │ │ ├── compute_normal.cpp │ │ ├── compute_pointcloud_pca.cpp │ │ ├── compute_seam_edges.cpp │ │ ├── compute_tangent_bitangent.cpp │ │ ├── compute_uv_charts.cpp │ │ ├── compute_uv_distortion.cpp │ │ ├── compute_uv_tile_list.cpp │ │ ├── compute_vertex_normal.cpp │ │ ├── compute_vertex_valence.cpp │ │ ├── compute_vertex_vertex_adjacency.cpp │ │ ├── compute_weighted_corner_normal.cpp │ │ ├── create_mesh.cpp │ │ ├── eigen.cpp │ │ ├── extract_boundary_loops.cpp │ │ ├── extract_submesh.cpp │ │ ├── filter_attributes.cpp │ │ ├── find_matching_attributes.cpp │ │ ├── foreach_attribute.cpp │ │ ├── fpe.cpp │ │ ├── internal │ │ │ ├── attribute_string_utils.cpp │ │ │ ├── bucket_sort.h │ │ │ ├── compute_weighted_corner_normal.cpp │ │ │ ├── compute_weighted_corner_normal.h │ │ │ ├── dijkstra.cpp │ │ │ ├── find_attribute_utils.cpp │ │ │ ├── get_uv_attribute.cpp │ │ │ ├── map_attributes.cpp │ │ │ ├── recompute_facet_normal_if_needed.h │ │ │ └── string_from_scalar.cpp │ │ ├── isoline.cpp │ │ ├── map_attribute.cpp │ │ ├── mapbox │ │ │ └── earcut.h │ │ ├── mesh_cleanup │ │ │ ├── close_small_holes.cpp │ │ │ ├── detect_degenerate_facets.cpp │ │ │ ├── remove_degenerate_facets.cpp │ │ │ ├── remove_duplicate_facets.cpp │ │ │ ├── remove_duplicate_vertices.cpp │ │ │ ├── remove_isolated_vertices.cpp │ │ │ ├── remove_null_area_facets.cpp │ │ │ ├── remove_short_edges.cpp │ │ │ ├── remove_topologically_degenerate_facets.cpp │ │ │ ├── rescale_uv_charts.cpp │ │ │ ├── resolve_nonmanifoldness.cpp │ │ │ ├── resolve_vertex_nonmanifoldness.cpp │ │ │ ├── split_edges.cpp │ │ │ ├── split_edges.h │ │ │ ├── split_long_edges.cpp │ │ │ ├── split_triangle.cpp │ │ │ ├── split_triangle.h │ │ │ └── unflip_uv_triangles.cpp │ │ ├── normalize_meshes.cpp │ │ ├── orient_outward.cpp │ │ ├── orientation.cpp │ │ ├── permute_facets.cpp │ │ ├── permute_vertices.cpp │ │ ├── predicates.cpp │ │ ├── remap_vertices.cpp │ │ ├── reorder_mesh.cpp │ │ ├── select_facets_by_normal_similarity.cpp │ │ ├── select_facets_in_frustum.cpp │ │ ├── separate_by_components.cpp │ │ ├── separate_by_facet_groups.cpp │ │ ├── thicken_and_close_mesh.cpp │ │ ├── topology.cpp │ │ ├── transform_mesh.cpp │ │ ├── triangulate_polygonal_facets.cpp │ │ ├── unify_index_buffer.cpp │ │ ├── utils │ │ │ ├── DisjointSets.cpp │ │ │ ├── Error.cpp │ │ │ ├── ProgressCallback.cpp │ │ │ ├── assert.cpp │ │ │ ├── chain_edges.cpp │ │ │ ├── point_on_segment.cpp │ │ │ ├── strings.cpp │ │ │ ├── tbb.cpp │ │ │ └── triangle_uv_distortion.cpp │ │ ├── uv_mesh.cpp │ │ ├── views.cpp │ │ └── weld_indexed_attribute.cpp │ └── tests │ │ ├── CMakeLists.txt │ │ ├── attributes │ │ ├── test_attribute_utils.cpp │ │ ├── test_condense_indexed_attribute.cpp │ │ └── test_unify_index_buffer.cpp │ │ ├── compile_errors │ │ ├── CMakeLists.txt │ │ ├── test_assert.cpp │ │ ├── test_attribute_type.cpp │ │ ├── test_mesh_attribute.cpp │ │ ├── test_mesh_convert1.cpp │ │ ├── test_mesh_convert2.cpp │ │ ├── test_mesh_type.cpp │ │ ├── test_pimpl.cpp │ │ └── test_safe_cast.cpp │ │ ├── compute_tangent_bitangent_mikktspace.h │ │ ├── experimental │ │ ├── test_array.cpp │ │ └── test_indexed_attributes.cpp │ │ ├── fmt │ │ ├── CMakeLists.txt │ │ ├── test_fmt.cpp │ │ └── user_fmt_formatter.h │ │ ├── mesh_cleanup │ │ ├── test_close_small_holes.cpp │ │ ├── test_detect_degenerate_facets.cpp │ │ ├── test_detect_degenerate_triangles.cpp │ │ ├── test_remove_degenerate_facets.cpp │ │ ├── test_remove_degenerate_triangles.cpp │ │ ├── test_remove_duplicate_facets.cpp │ │ ├── test_remove_duplicate_vertices.cpp │ │ ├── test_remove_isolated_vertices.cpp │ │ ├── test_remove_null_area_facets.cpp │ │ ├── test_remove_short_edges.cpp │ │ ├── test_remove_topologically_degenerate_facets.cpp │ │ ├── test_remove_topologically_degenerate_triangles.cpp │ │ ├── test_rescale_uv_charts.cpp │ │ ├── test_resolve_nonmanifoldness.cpp │ │ ├── test_resolve_vertex_nonmanifoldness.cpp │ │ └── test_split_long_edges.cpp │ │ ├── test_Connectivity.cpp │ │ ├── test_DisjointSets.cpp │ │ ├── test_Edge.cpp │ │ ├── test_EdgeFacetMap.cpp │ │ ├── test_EdgeMap.cpp │ │ ├── test_ExactPredicates.cpp │ │ ├── test_IndexedAttribute.cpp │ │ ├── test_assert.cpp │ │ ├── test_attribute.cpp │ │ ├── test_bitfield.cpp │ │ ├── test_chain_edges.cpp │ │ ├── test_combine_mesh_list.cpp │ │ ├── test_combine_meshes.cpp │ │ ├── test_common.cpp │ │ ├── test_compute_centroid.cpp │ │ ├── test_compute_components.cpp │ │ ├── test_compute_corner_normal.cpp │ │ ├── test_compute_dihedral_angles.cpp │ │ ├── test_compute_dijkstra_distance.cpp │ │ ├── test_compute_edge_lengths.cpp │ │ ├── test_compute_facet_area.cpp │ │ ├── test_compute_facet_normal.cpp │ │ ├── test_compute_greedy_coloring.cpp │ │ ├── test_compute_mesh_centroid.cpp │ │ ├── test_compute_mesh_covariance.cpp │ │ ├── test_compute_normal.cpp │ │ ├── test_compute_pointcloud_pca.cpp │ │ ├── test_compute_seam_edges.cpp │ │ ├── test_compute_tangent_bitangent.cpp │ │ ├── test_compute_uv_charts.cpp │ │ ├── test_compute_uv_distortion.cpp │ │ ├── test_compute_vertex_normal.cpp │ │ ├── test_compute_vertex_valence.cpp │ │ ├── test_compute_vertex_vertex_adjacency.cpp │ │ ├── test_compute_weighted_corner_normal.cpp │ │ ├── test_corner_to_edge_mapping.cpp │ │ ├── test_create_mesh.cpp │ │ ├── test_dijkstra.cpp │ │ ├── test_extract_boundary_loops.cpp │ │ ├── test_extract_submesh.cpp │ │ ├── test_filter_cast.cpp │ │ ├── test_foreach_attribute.cpp │ │ ├── test_initialize_edges.cpp │ │ ├── test_internal_angles.cpp │ │ ├── test_isoline.cpp │ │ ├── test_legacy_select_facets_by_normal_similarity.cpp │ │ ├── test_legacy_select_facets_in_frustum.cpp │ │ ├── test_logger.cpp │ │ ├── test_map_attribute.cpp │ │ ├── test_marching_triangles.cpp │ │ ├── test_mesh.cpp │ │ ├── test_mesh_convert.cpp │ │ ├── test_mesh_trait.cpp │ │ ├── test_normalize_meshes.cpp │ │ ├── test_orient_outward.cpp │ │ ├── test_permute_facets.cpp │ │ ├── test_permute_vertices.cpp │ │ ├── test_pimpl.cpp │ │ ├── test_quad_to_tri.cpp │ │ ├── test_remap_vertices.cpp │ │ ├── test_reorder_mesh.cpp │ │ ├── test_reorder_mesh_vertices.cpp │ │ ├── test_rng_mesh.cpp │ │ ├── test_sample_points_on_surface.cpp │ │ ├── test_select_facets_by_normal_similarity.cpp │ │ ├── test_select_facets_in_frustum.cpp │ │ ├── test_select_vertices.cpp │ │ ├── test_separate_by_components.cpp │ │ ├── test_strack_set.cpp │ │ ├── test_strings.cpp │ │ ├── test_surface_mesh.cpp │ │ ├── test_surface_other.cpp │ │ ├── test_thicken_and_close_mesh.cpp │ │ ├── test_topology.cpp │ │ ├── test_transform_mesh.cpp │ │ ├── test_triangulate_polygonal_facets.cpp │ │ ├── test_unify_index_buffer.cpp │ │ ├── test_utils_chain_edges.cpp │ │ ├── test_utils_geometry2d.cpp │ │ ├── test_utils_geometry3d.cpp │ │ ├── test_utils_hash.cpp │ │ ├── test_utils_range.cpp │ │ ├── test_utils_safe_cast.cpp │ │ ├── test_utils_small_vector.cpp │ │ ├── test_utils_strings.cpp │ │ ├── test_utils_triangle_uv_distortion.cpp │ │ ├── test_utils_utils.cpp │ │ ├── test_views.cpp │ │ └── test_weld_indexed_attribute.cpp ├── filtering │ ├── CMakeLists.txt │ ├── examples │ │ ├── CMakeLists.txt │ │ └── mesh_smoothing.cpp │ ├── filtering.md │ ├── include │ │ └── lagrange │ │ │ └── filtering │ │ │ ├── api.h │ │ │ ├── attribute_smoothing.h │ │ │ └── mesh_smoothing.h │ ├── python │ │ ├── CMakeLists.txt │ │ ├── include │ │ │ └── lagrange │ │ │ │ └── python │ │ │ │ ├── filtering.h │ │ │ │ └── setup_mkl.h │ │ ├── src │ │ │ ├── filtering.cpp │ │ │ └── setup_mkl.cpp │ │ └── tests │ │ │ ├── assets.py │ │ │ └── test_mesh_smoothing.py │ ├── src │ │ ├── AccelerateSupport.h │ │ ├── ThreadPool.h │ │ ├── attribute_smoothing.cpp │ │ ├── mesh_smoothing.cpp │ │ ├── smoothing_utils.cpp │ │ └── smoothing_utils.h │ └── tests │ │ ├── CMakeLists.txt │ │ ├── test_smoothing.cpp │ │ └── test_threadpool.cpp ├── fs │ ├── CMakeLists.txt │ ├── fs.md │ ├── include │ │ └── lagrange │ │ │ └── fs │ │ │ ├── api.h │ │ │ ├── detail │ │ │ └── guess_backend.h │ │ │ ├── file_utils.h │ │ │ └── filesystem.h │ ├── src │ │ ├── file_utils.cpp │ │ └── filesystem.cpp │ └── tests │ │ ├── CMakeLists.txt │ │ └── test_file_utils.cpp ├── image │ ├── CMakeLists.txt │ ├── examples │ │ ├── CMakeLists.txt │ │ └── texture_sampling_demo.cpp │ ├── image.md │ ├── include │ │ └── lagrange │ │ │ └── image │ │ │ ├── ImageStorage.h │ │ │ ├── ImageType.h │ │ │ ├── ImageView.h │ │ │ ├── RawInputImage.h │ │ │ ├── RawInputImage.impl.h │ │ │ ├── api.h │ │ │ ├── image_filters.h │ │ │ ├── image_sampling.h │ │ │ ├── image_type_conversion.h │ │ │ └── image_utils.h │ ├── python │ │ ├── CMakeLists.txt │ │ ├── include │ │ │ └── lagrange │ │ │ │ └── python │ │ │ │ └── image.h │ │ └── src │ │ │ └── image.cpp │ ├── src │ │ ├── RawInputImage.cpp │ │ ├── image_filters.cpp │ │ ├── image_sampling.cpp │ │ ├── image_type_conversion.cpp │ │ └── image_utils.cpp │ └── tests │ │ ├── CMakeLists.txt │ │ ├── test_image.cpp │ │ └── test_image_sampling.cpp ├── image_io │ ├── CMakeLists.txt │ ├── examples │ │ ├── CMakeLists.txt │ │ └── mesh_to_svg.cpp │ ├── include │ │ └── lagrange │ │ │ └── image_io │ │ │ ├── api.h │ │ │ ├── common.h │ │ │ ├── convert_image.h │ │ │ ├── exr.h │ │ │ ├── load_image.h │ │ │ ├── save_image.h │ │ │ └── save_image_svg.h │ ├── src │ │ ├── exr.cpp │ │ ├── load_image.cpp │ │ └── save_image.cpp │ └── tests │ │ ├── CMakeLists.txt │ │ └── test_image_io.cpp ├── io │ ├── CMakeLists.txt │ ├── examples │ │ ├── CMakeLists.txt │ │ ├── mesh_convert.cpp │ │ └── scene_io.cpp │ ├── include │ │ └── lagrange │ │ │ └── io │ │ │ ├── api.h │ │ │ ├── internal │ │ │ ├── detect_file_format.h │ │ │ ├── load_assimp.h │ │ │ ├── load_obj.h │ │ │ └── scene_utils.h │ │ │ ├── legacy │ │ │ ├── load_mesh.h │ │ │ ├── load_mesh.impl.h │ │ │ ├── load_mesh_assimp.h │ │ │ ├── load_mesh_ext.h │ │ │ ├── load_mesh_ply.h │ │ │ ├── save_mesh.h │ │ │ └── save_mesh_ply.h │ │ │ ├── load_mesh.h │ │ │ ├── load_mesh.impl.h │ │ │ ├── load_mesh_assimp.h │ │ │ ├── load_mesh_ext.h │ │ │ ├── load_mesh_fbx.h │ │ │ ├── load_mesh_gltf.h │ │ │ ├── load_mesh_msh.h │ │ │ ├── load_mesh_obj.h │ │ │ ├── load_mesh_ply.h │ │ │ ├── load_mesh_stl.h │ │ │ ├── load_scene.h │ │ │ ├── load_scene_assimp.h │ │ │ ├── load_scene_fbx.h │ │ │ ├── load_scene_gltf.h │ │ │ ├── load_scene_obj.h │ │ │ ├── load_simple_scene.h │ │ │ ├── load_simple_scene_assimp.h │ │ │ ├── load_simple_scene_fbx.h │ │ │ ├── load_simple_scene_gltf.h │ │ │ ├── save_graph.h │ │ │ ├── save_mesh.h │ │ │ ├── save_mesh_gltf.h │ │ │ ├── save_mesh_msh.h │ │ │ ├── save_mesh_obj.h │ │ │ ├── save_mesh_ply.h │ │ │ ├── save_scene.h │ │ │ ├── save_scene_gltf.h │ │ │ ├── save_simple_scene.h │ │ │ ├── save_simple_scene_gltf.h │ │ │ └── types.h │ ├── io.md │ ├── python │ │ ├── CMakeLists.txt │ │ ├── include │ │ │ └── lagrange │ │ │ │ └── python │ │ │ │ └── io.h │ │ ├── src │ │ │ └── io.cpp │ │ └── tests │ │ │ └── test_io.py │ ├── src │ │ ├── internal │ │ │ ├── convert_attribute_utils.h │ │ │ ├── detect_file_format.cpp │ │ │ └── scene_utils.cpp │ │ ├── legacy_load_mesh.cpp │ │ ├── load_assimp.cpp │ │ ├── load_fbx.cpp │ │ ├── load_gltf.cpp │ │ ├── load_mesh.cpp │ │ ├── load_mesh_msh.cpp │ │ ├── load_mesh_ply.cpp │ │ ├── load_mesh_stl.cpp │ │ ├── load_obj.cpp │ │ ├── load_scene.cpp │ │ ├── load_simple_scene.cpp │ │ ├── save_gltf.cpp │ │ ├── save_mesh.cpp │ │ ├── save_mesh_msh.cpp │ │ ├── save_mesh_obj.cpp │ │ ├── save_mesh_ply.cpp │ │ ├── save_scene.cpp │ │ ├── save_simple_scene.cpp │ │ └── stitch_mesh.h │ └── tests │ │ ├── CMakeLists.txt │ │ ├── test_io.cpp │ │ ├── test_legacy_load_mesh_assimp.cpp │ │ ├── test_legacy_load_mesh_ext.cpp │ │ ├── test_legacy_mesh_io.cpp │ │ ├── test_load_assimp.cpp │ │ ├── test_load_gltf.cpp │ │ ├── test_load_mesh_data.h │ │ ├── test_load_scene.cpp │ │ ├── test_load_simple_scene.cpp │ │ ├── test_msh.cpp │ │ ├── test_obj.cpp │ │ ├── test_ply.cpp │ │ ├── test_save_mesh.cpp │ │ ├── test_save_scene.cpp │ │ └── test_save_simple_scene.cpp ├── main.md ├── partitioning │ ├── CMakeLists.txt │ ├── examples │ │ ├── CMakeLists.txt │ │ └── partition_mesh_vertices.cpp │ ├── include │ │ └── lagrange │ │ │ └── partitioning │ │ │ ├── api.h │ │ │ ├── partition_mesh_vertices.h │ │ │ └── types.h │ ├── partitioning.md │ ├── src │ │ └── partition_mesh_vertices.cpp │ └── tests │ │ ├── CMakeLists.txt │ │ └── test_partitioning.cpp ├── poisson │ ├── CMakeLists.txt │ ├── examples │ │ ├── CMakeLists.txt │ │ └── poisson_reconstruction.cpp │ ├── include │ │ └── lagrange │ │ │ └── poisson │ │ │ ├── AttributeEvaluator.h │ │ │ ├── CommonOptions.h │ │ │ ├── api.h │ │ │ └── mesh_from_oriented_points.h │ ├── python │ │ ├── CMakeLists.txt │ │ ├── include │ │ │ └── lagrange │ │ │ │ └── python │ │ │ │ └── poisson.h │ │ ├── scripts │ │ │ └── poisson_recon.py │ │ ├── src │ │ │ └── poisson.cpp │ │ └── tests │ │ │ └── test_poisson_reconstruction.py │ ├── src │ │ ├── AttributeEvaluator.cpp │ │ ├── ThreadPool.h │ │ ├── mesh_from_oriented_points.cpp │ │ └── octree_depth.h │ └── tests │ │ ├── CMakeLists.txt │ │ ├── test_poisson.cpp │ │ └── test_threadpool.cpp ├── python │ ├── CMakeLists.txt │ └── lagrange │ │ ├── _logging.py │ │ └── py.typed ├── raycasting │ ├── CMakeLists.txt │ ├── examples │ │ ├── CMakeLists.txt │ │ ├── project.cpp │ │ └── uv_image.cpp │ ├── include │ │ └── lagrange │ │ │ └── raycasting │ │ │ ├── ClosestPointResult.h │ │ │ ├── EmbreeHelper.h │ │ │ ├── EmbreeRayCaster.h │ │ │ ├── RayCasterMesh.h │ │ │ ├── api.h │ │ │ ├── create_ray_caster.h │ │ │ ├── embree_closest_point.h │ │ │ ├── project_attributes.h │ │ │ ├── project_attributes_closest_point.h │ │ │ ├── project_attributes_directional.h │ │ │ ├── project_options.h │ │ │ └── project_particles_directional.h │ ├── performance │ │ ├── CMakeLists.txt │ │ └── ray_casting.cpp │ ├── raycasting.md │ ├── src │ │ └── EmbreeHelper.cpp │ └── tests │ │ ├── CMakeLists.txt │ │ ├── test_EmbreeRayCaster.cpp │ │ ├── test_project_attributes.cpp │ │ ├── test_project_particles.cpp │ │ └── test_raycasting_speed.cpp ├── scene │ ├── CMakeLists.txt │ ├── include │ │ └── lagrange │ │ │ └── scene │ │ │ ├── RemeshingOptions.h │ │ │ ├── Scene.h │ │ │ ├── SceneExtension.h │ │ │ ├── SceneTypes.h │ │ │ ├── SimpleScene.h │ │ │ ├── SimpleSceneTypes.h │ │ │ ├── api.h │ │ │ ├── cast.h │ │ │ ├── compute_mesh_weights.h │ │ │ ├── internal │ │ │ ├── bake_scaling.h │ │ │ └── scene_string_utils.h │ │ │ ├── scene_utils.h │ │ │ └── simple_scene_convert.h │ ├── python │ │ ├── CMakeLists.txt │ │ ├── include │ │ │ └── lagrange │ │ │ │ └── python │ │ │ │ └── scene.h │ │ ├── scripts │ │ │ └── extract_texture.py │ │ ├── src │ │ │ ├── bind_scene.h │ │ │ ├── bind_simple_scene.h │ │ │ ├── bind_value.h │ │ │ └── scene.cpp │ │ └── tests │ │ │ ├── test_mesh_instance.py │ │ │ ├── test_scene.py │ │ │ └── test_simple_scene.py │ ├── src │ │ ├── Scene.cpp │ │ ├── SimpleScene.cpp │ │ ├── cast.cpp │ │ ├── compute_mesh_weights.cpp │ │ ├── internal │ │ │ ├── bake_scaling.cpp │ │ │ └── scene_string_utils.cpp │ │ ├── scene_utils.cpp │ │ └── simple_scene_convert.cpp │ └── tests │ │ ├── CMakeLists.txt │ │ ├── test_scene.cpp │ │ └── test_simple_scene.cpp ├── subdivision │ ├── CMakeLists.txt │ ├── examples │ │ ├── CMakeLists.txt │ │ └── mesh_subdivision.cpp │ ├── include │ │ └── lagrange │ │ │ └── subdivision │ │ │ ├── api.h │ │ │ ├── legacy │ │ │ ├── mesh_subdivision.h │ │ │ ├── midpoint_subdivision.h │ │ │ └── sqrt_subdivision.h │ │ │ ├── mesh_subdivision.h │ │ │ ├── midpoint_subdivision.h │ │ │ └── sqrt_subdivision.h │ ├── python │ │ ├── CMakeLists.txt │ │ ├── include │ │ │ └── lagrange │ │ │ │ └── python │ │ │ │ └── subdivision.h │ │ ├── scripts │ │ │ └── mesh_subdivision.py │ │ ├── src │ │ │ └── subdivision.cpp │ │ └── tests │ │ │ └── test_mesh_subdivision.py │ ├── src │ │ ├── MeshConverter.h │ │ ├── TopologyRefinerFactory.h │ │ ├── midpoint_subdivision.cpp │ │ ├── sqrt_subdivision.cpp │ │ ├── subdivide_adaptive.cpp │ │ ├── subdivide_mesh.cpp │ │ └── subdivide_uniform.cpp │ ├── subdivision.md │ └── tests │ │ ├── CMakeLists.txt │ │ └── test_mesh_subdivision.cpp ├── testing │ ├── CMakeLists.txt │ ├── include │ │ └── lagrange │ │ │ └── testing │ │ │ ├── api.h │ │ │ ├── check_mesh.h │ │ │ ├── common.h │ │ │ ├── create_test_mesh.h │ │ │ ├── detect_fp_behavior.h │ │ │ ├── equivalence_check.h │ │ │ └── require_approx.h │ ├── main │ │ └── main.cpp │ └── src │ │ ├── common.cpp │ │ ├── create_test_mesh.cpp │ │ ├── detect_fp_behavior.cpp │ │ ├── detect_fp_behavior_helper.cpp │ │ └── detect_fp_behavior_helper.h ├── ui │ ├── CMakeLists.txt │ ├── README.md │ ├── cmake │ │ └── lagrange_ui_generate_shaders.cmake │ ├── examples │ │ ├── 101_Viewer.cpp │ │ ├── 102_MeshFromFile.cpp │ │ ├── 103_MeshFromMemory.cpp │ │ ├── 104_MainLoop.cpp │ │ ├── 105_Keybinds.cpp │ │ ├── 106_Mouse.cpp │ │ ├── 107_UIPanel.cpp │ │ ├── 108_FileDialog.cpp │ │ ├── CMakeLists.txt │ │ ├── ui_callbacks │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ ├── ui_dynamic_mesh │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ ├── ui_playground │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ ├── ui_scene │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ ├── ui_show_attribute │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ └── ui_treenode │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ ├── include │ │ └── lagrange │ │ │ └── ui │ │ │ ├── Entity.h │ │ │ ├── UI.h │ │ │ ├── Viewer.h │ │ │ ├── api.h │ │ │ ├── components │ │ │ ├── AcceleratedPicking.h │ │ │ ├── AttributeRender.h │ │ │ ├── Bounds.h │ │ │ ├── CameraComponents.h │ │ │ ├── Common.h │ │ │ ├── ElementSelection.h │ │ │ ├── EventEmitter.h │ │ │ ├── GLMesh.h │ │ │ ├── IBL.h │ │ │ ├── Input.h │ │ │ ├── Layer.h │ │ │ ├── Light.h │ │ │ ├── MeshData.h │ │ │ ├── MeshGeometry.h │ │ │ ├── MeshRender.h │ │ │ ├── MeshSelectionRender.h │ │ │ ├── ObjectIDViewport.h │ │ │ ├── RenderContext.h │ │ │ ├── Selection.h │ │ │ ├── SelectionContext.h │ │ │ ├── SelectionViewport.h │ │ │ ├── ShadowMap.h │ │ │ ├── Transform.h │ │ │ ├── TreeNode.h │ │ │ ├── UIPanel.h │ │ │ ├── VertexData.h │ │ │ └── Viewport.h │ │ │ ├── default_components.h │ │ │ ├── default_entities.h │ │ │ ├── default_events.h │ │ │ ├── default_ibls.h │ │ │ ├── default_keybinds.h │ │ │ ├── default_panels.h │ │ │ ├── default_shaders.h │ │ │ ├── default_systems.h │ │ │ ├── default_tools.h │ │ │ ├── imgui │ │ │ ├── UIWidget.h │ │ │ ├── buttons.h │ │ │ ├── imconfig.h │ │ │ └── progress.h │ │ │ ├── panels │ │ │ ├── ComponentPanel.h │ │ │ ├── KeybindsPanel.h │ │ │ ├── LoggerPanel.h │ │ │ ├── RendererPanel.h │ │ │ ├── ScenePanel.h │ │ │ ├── ToolbarPanel.h │ │ │ └── ViewportPanel.h │ │ │ ├── systems │ │ │ ├── camera_systems.h │ │ │ ├── camera_turntable.h │ │ │ ├── render_background.h │ │ │ ├── render_geometry.h │ │ │ ├── render_shadowmaps.h │ │ │ ├── render_viewports.h │ │ │ ├── update_accelerated_picking.h │ │ │ ├── update_gizmo.h │ │ │ ├── update_lights.h │ │ │ ├── update_mesh_bounds.h │ │ │ ├── update_mesh_buffers.h │ │ │ ├── update_mesh_elements_hovered.h │ │ │ ├── update_mesh_hovered.h │ │ │ ├── update_scene_bounds.h │ │ │ └── update_transform_hierarchy.h │ │ │ ├── types │ │ │ ├── AABB.h │ │ │ ├── Camera.h │ │ │ ├── Color.h │ │ │ ├── FrameBuffer.h │ │ │ ├── Frustum.h │ │ │ ├── GLContext.h │ │ │ ├── Keybinds.h │ │ │ ├── Material.h │ │ │ ├── RayFacetHit.h │ │ │ ├── Shader.h │ │ │ ├── ShaderLoader.h │ │ │ ├── Systems.h │ │ │ ├── Texture.h │ │ │ ├── Tools.h │ │ │ └── VertexBuffer.h │ │ │ └── utils │ │ │ ├── bounds.h │ │ │ ├── colormap.h │ │ │ ├── events.h │ │ │ ├── file_dialog.h │ │ │ ├── ibl.h │ │ │ ├── immediate.h │ │ │ ├── input.h │ │ │ ├── io.h │ │ │ ├── io_assimp.h │ │ │ ├── layer.h │ │ │ ├── lights.h │ │ │ ├── logger.h │ │ │ ├── math.h │ │ │ ├── mesh.h │ │ │ ├── mesh.impl.h │ │ │ ├── mesh_picking.h │ │ │ ├── objectid_viewport.h │ │ │ ├── pair_hash.h │ │ │ ├── render.h │ │ │ ├── selection.h │ │ │ ├── template.h │ │ │ ├── tools.h │ │ │ ├── treenode.h │ │ │ ├── uipanel.h │ │ │ └── viewport.h │ ├── src │ │ ├── Viewer.cpp │ │ ├── adobe_mdl │ │ │ ├── annotations.mdl │ │ │ ├── convert.mdl │ │ │ ├── mtl.mdl │ │ │ └── util.mdl │ │ ├── default_components.cpp │ │ ├── default_entities.cpp │ │ ├── default_ibls.cpp │ │ ├── default_keybinds.cpp │ │ ├── default_panels.cpp │ │ ├── default_shaders.cpp │ │ ├── default_tools.cpp │ │ ├── imgui │ │ │ ├── UIWidget.cpp │ │ │ ├── buttons.cpp │ │ │ └── progress.cpp │ │ ├── panels │ │ │ ├── ComponentPanel.cpp │ │ │ ├── KeybindsPanel.cpp │ │ │ ├── LoggerPanel.cpp │ │ │ ├── RendererPanel.cpp │ │ │ ├── ScenePanel.cpp │ │ │ ├── ToolbarPanel.cpp │ │ │ └── ViewportPanel.cpp │ │ ├── shaders │ │ │ ├── cubemap │ │ │ │ ├── convolve.shader │ │ │ │ ├── specular.shader │ │ │ │ └── to_cube.shader │ │ │ ├── depth │ │ │ │ ├── to_cubemap.shader │ │ │ │ └── to_texture.shader │ │ │ ├── face_id.shader │ │ │ ├── layout │ │ │ │ ├── default_fragment_layout.glsl │ │ │ │ └── default_vertex_layout.glsl │ │ │ ├── lines │ │ │ │ ├── attribute_to_lines.shader │ │ │ │ ├── edge_to_line.shader │ │ │ │ └── triangle_to_lines.shader │ │ │ ├── post │ │ │ │ ├── FXAA.shader │ │ │ │ ├── outline.shader │ │ │ │ └── tonemap.shader │ │ │ ├── skybox.shader │ │ │ ├── surface │ │ │ │ ├── colormap.frag │ │ │ │ ├── edge_attribute.shader │ │ │ │ ├── flat.frag │ │ │ │ ├── objectid.shader │ │ │ │ ├── pbr.frag │ │ │ │ ├── phong.frag │ │ │ │ ├── simple.shader │ │ │ │ ├── surface.shader │ │ │ │ └── vertex_attribute.shader │ │ │ ├── texture.shader │ │ │ ├── uniforms │ │ │ │ ├── common.glsl │ │ │ │ ├── ibl.glsl │ │ │ │ ├── lights.glsl │ │ │ │ └── materials.glsl │ │ │ └── util │ │ │ │ ├── brdf_lut.shader │ │ │ │ ├── default.vertex │ │ │ │ ├── light.glsl │ │ │ │ ├── material.glsl │ │ │ │ ├── multisample.glsl │ │ │ │ ├── pbr.glsl │ │ │ │ ├── pbr_shading.glsl │ │ │ │ ├── phong.glsl │ │ │ │ └── split_by_edge.geom │ │ ├── systems │ │ │ ├── camera_systems.cpp │ │ │ ├── render_background.cpp │ │ │ ├── render_geometry.cpp │ │ │ ├── render_shadowmaps.cpp │ │ │ ├── render_viewports.cpp │ │ │ ├── update_accelerated_picking.cpp │ │ │ ├── update_gizmo.cpp │ │ │ ├── update_lights.cpp │ │ │ ├── update_mesh_bounds.cpp │ │ │ ├── update_mesh_buffers.cpp │ │ │ ├── update_mesh_elements_hovered.cpp │ │ │ ├── update_mesh_hovered.cpp │ │ │ ├── update_scene_bounds.cpp │ │ │ └── update_transform_hierarchy.cpp │ │ ├── types │ │ │ ├── AABB.cpp │ │ │ ├── Camera.cpp │ │ │ ├── FrameBuffer.cpp │ │ │ ├── Frustum.cpp │ │ │ ├── GLContext.cpp │ │ │ ├── Keybinds.cpp │ │ │ ├── Material.cpp │ │ │ ├── Shader.cpp │ │ │ ├── ShaderLoader.cpp │ │ │ ├── Systems.cpp │ │ │ ├── Texture.cpp │ │ │ ├── Tools.cpp │ │ │ └── VertexBuffer.cpp │ │ └── utils │ │ │ ├── bounds.cpp │ │ │ ├── colormap.cpp │ │ │ ├── file_dialog.cpp │ │ │ ├── ibl.cpp │ │ │ ├── immediate.cpp │ │ │ ├── input.cpp │ │ │ ├── io.cpp │ │ │ ├── layer.cpp │ │ │ ├── lights.cpp │ │ │ ├── math.cpp │ │ │ ├── mesh.cpp │ │ │ ├── mesh_picking.cpp │ │ │ ├── objectid_viewport.cpp │ │ │ ├── render.cpp │ │ │ ├── selection.cpp │ │ │ ├── tools_utils.cpp │ │ │ ├── treenode.cpp │ │ │ ├── uipanel.cpp │ │ │ └── viewport.cpp │ ├── tests │ │ ├── CMakeLists.txt │ │ ├── main.cpp │ │ ├── test_bounds.cpp │ │ ├── test_filedialog.cpp │ │ └── test_systems.cpp │ └── ui.md ├── volume │ ├── CMakeLists.txt │ ├── examples │ │ ├── CMakeLists.txt │ │ ├── fill_with_spheres.cpp │ │ └── voxelize_mesh.cpp │ ├── include │ │ └── lagrange │ │ │ └── volume │ │ │ ├── GridTypes.h │ │ │ ├── api.h │ │ │ ├── fill_with_spheres.h │ │ │ ├── legacy │ │ │ ├── mesh_to_volume.h │ │ │ └── volume_to_mesh.h │ │ │ ├── mesh_to_volume.h │ │ │ ├── types.h │ │ │ └── volume_to_mesh.h │ ├── src │ │ ├── mesh_to_volume.cpp │ │ └── volume_to_mesh.cpp │ └── tests │ │ ├── CMakeLists.txt │ │ ├── test_fill_with_spheres.cpp │ │ ├── test_volume_to_mesh.cpp │ │ └── test_voxelization.cpp └── winding │ ├── CMakeLists.txt │ ├── examples │ ├── CMakeLists.txt │ ├── fix_orientation.cpp │ └── sample_points_in_mesh.cpp │ ├── include │ └── lagrange │ │ └── winding │ │ ├── FastWindingNumber.h │ │ └── api.h │ ├── src │ └── FastWindingNumber.cpp │ └── tests │ ├── CMakeLists.txt │ └── test_fast_winding_number.cpp └── pyproject.toml /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ### Expected Behaviour 5 | 6 | ### Actual Behaviour 7 | 8 | ### Reproduce Scenario (including but not limited to) 9 | 10 | #### Steps to Reproduce 11 | 12 | #### Platform and Version 13 | 14 | #### Sample Code that illustrates the problem 15 | 16 | #### Logs taken while reproducing problem 17 | -------------------------------------------------------------------------------- /.github/tsan.suppressions.ini: -------------------------------------------------------------------------------- 1 | # TSAN suppression for known issues. 2 | # Possibly related to https://github.com/boostorg/lockfree/issues/78 3 | race:^boost::lockfree::stack 4 | # Apparently libfive has its own stack of data-race issues... We'll need to fix that at some point 5 | race:^libfive::WorkerPool 6 | race:^libfive::DCTree 7 | race:^void libfive::Dual 8 | # See https://github.com/AcademySoftwareFoundation/openvdb/issues/1601 9 | race:openvdb::*::tools::mesh_to_volume_internal::ComputeIntersectingVoxelSign 10 | # See https://github.com/AcademySoftwareFoundation/openvdb/issues/1739 11 | race:openvdb::*::tools::v2s_internal::UpdatePoints 12 | # See https://github.com/embree/embree/issues/469 13 | race_top:embree::parallel_any_of 14 | # Well... this one isn't gonna fix itself. 15 | race:^triangleinit 16 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 6.34.0 2 | -------------------------------------------------------------------------------- /cmake/lagrange/lagrangeConfig.cmake.in: -------------------------------------------------------------------------------- 1 | set(config_targets_file @config_targets_file@) 2 | 3 | include(${CMAKE_CURRENT_LIST_DIR}/AnorigamiSDKConfig.cmake) 4 | 5 | include("${CMAKE_CURRENT_LIST_DIR}/${config_targets_file}") 6 | -------------------------------------------------------------------------------- /cmake/lagrange/lagrangeMklModules.txt: -------------------------------------------------------------------------------- 1 | anorigami;baking;contouring;decal;deformers;filtering;meshproc;quadrangulation 2 | -------------------------------------------------------------------------------- /cmake/lagrange/lagrange_add_performance.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | function(lagrange_add_performance name) 13 | include(lagrange_add_executable) 14 | lagrange_add_executable(${name} ${ARGN}) 15 | 16 | # Folder in IDE 17 | set_target_properties(${name} PROPERTIES FOLDER "${LAGRANGE_IDE_PREFIX}Lagrange//Performance") 18 | 19 | # Output directory on disk 20 | set_target_properties(${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/performance") 21 | endfunction() 22 | -------------------------------------------------------------------------------- /cmake/lagrange/lagrange_alias_target.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2021 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | 13 | # Create an ALIAS for a given target. If the target is already an ALIAS, references the original target instead. 14 | function(lagrange_alias_target name target) 15 | get_target_property(_aliased ${target} ALIASED_TARGET) 16 | if(_aliased) 17 | message(STATUS "Creating '${name}' as a new ALIAS target for '${_aliased}'.") 18 | add_library(${name} ALIAS ${_aliased}) 19 | else() 20 | add_library(${name} ALIAS ${target}) 21 | endif() 22 | endfunction() 23 | -------------------------------------------------------------------------------- /cmake/lagrange/lagrange_cpm_cache.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2021 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | 13 | if(DEFINED ENV{CPM_SOURCE_CACHE}) 14 | set(CPM_SOURCE_CACHE_DEFAULT $ENV{CPM_SOURCE_CACHE}) 15 | else() 16 | # Set CPM cache folder if unset 17 | file(REAL_PATH "~/.cache/CPM" CPM_SOURCE_CACHE_DEFAULT EXPAND_TILDE) 18 | endif() 19 | 20 | set(CPM_SOURCE_CACHE 21 | ${CPM_SOURCE_CACHE_DEFAULT} 22 | CACHE PATH "Directory to download CPM dependencies" 23 | ) 24 | message(STATUS "Using CPM cache folder: ${CPM_SOURCE_CACHE}") 25 | -------------------------------------------------------------------------------- /cmake/lagrange/lagrange_filter_flags.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2021 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | function(lagrange_filter_flags flags) 13 | include(CheckCXXCompilerFlag) 14 | set(output_flags) 15 | foreach(FLAG IN ITEMS ${${flags}}) 16 | string(REPLACE "=" "-" FLAG_VAR "${FLAG}") 17 | if(NOT DEFINED IS_SUPPORTED_${FLAG_VAR}) 18 | check_cxx_compiler_flag("${FLAG}" IS_SUPPORTED_${FLAG_VAR}) 19 | endif() 20 | if(IS_SUPPORTED_${FLAG_VAR}) 21 | list(APPEND output_flags $<$:${FLAG}>) 22 | endif() 23 | endforeach() 24 | set(${flags} ${output_flags} PARENT_SCOPE) 25 | endfunction() 26 | -------------------------------------------------------------------------------- /cmake/recipes/external/Boost.wasm.patch: -------------------------------------------------------------------------------- 1 | Submodule libs/config contains modified content 2 | diff --git i/libs/config/include/boost/config/platform/wasm.hpp w/libs/config/include/boost/config/platform/wasm.hpp 3 | index 682b8485..4fa96cf6 100644 4 | --- i/libs/config/include/boost/config/platform/wasm.hpp 5 | +++ w/libs/config/include/boost/config/platform/wasm.hpp 6 | @@ -20,4 +20,4 @@ 7 | // 8 | // fenv lacks the C++11 macros: 9 | // 10 | -#define BOOST_NO_FENV_H 11 | +// #define BOOST_NO_FENV_H 12 | -------------------------------------------------------------------------------- /cmake/recipes/external/assimp.patch: -------------------------------------------------------------------------------- 1 | diff --git i/CMakeLists.txt w/CMakeLists.txt 2 | index 517a957f4..0f8594369 100644 3 | --- i/CMakeLists.txt 4 | +++ w/CMakeLists.txt 5 | @@ -339,7 +339,6 @@ ELSEIF(MSVC) 6 | ENDIF() 7 | # supress warning for double to float conversion if Double precision is activated 8 | ADD_COMPILE_OPTIONS(/wd4244) 9 | - SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_DEBUG /Zi /Od") 10 | # Allow user to disable PDBs 11 | if(ASSIMP_INSTALL_PDB) 12 | SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi") 13 | -------------------------------------------------------------------------------- /cmake/recipes/external/blas.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | if(TARGET BLAS::BLAS) 13 | return() 14 | endif() 15 | 16 | message(STATUS "Third-party (external): creating target 'BLAS::BLAS'") 17 | 18 | if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" OR "arm64" IN_LIST CMAKE_OSX_ARCHITECTURES) 19 | # Use Accelerate on macOS M1 20 | set(BLA_VENDOR Apple) 21 | find_package(BLAS REQUIRED) 22 | else() 23 | # Use MKL on other platforms 24 | lagrange_find_package(MKL CONFIG REQUIRED GLOBAL) 25 | add_library(BLAS::BLAS ALIAS MKL::MKL) 26 | endif() 27 | -------------------------------------------------------------------------------- /cmake/recipes/external/cli11.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | if(TARGET CLI11::CLI11) 13 | return() 14 | endif() 15 | 16 | message(STATUS "Third-party (external): creating target 'CLI11::CLI11'") 17 | 18 | include(CPM) 19 | CPMAddPackage( 20 | NAME cli11 21 | GITHUB_REPOSITORY CLIUtils/CLI11 22 | GIT_TAG v2.4.2 23 | ) 24 | 25 | set_target_properties(CLI11 PROPERTIES FOLDER third_party) 26 | -------------------------------------------------------------------------------- /cmake/recipes/external/cpptrace.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2025 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | 13 | if(TARGET cpptrace::cpptrace) 14 | return() 15 | endif() 16 | 17 | message(STATUS "Third-party (external): creating target 'cpptrace::cpptrace'") 18 | 19 | include(CPM) 20 | CPMAddPackage( 21 | NAME cpptrace 22 | GIT_REPOSITORY https://github.com/jeremy-rifkin/cpptrace.git 23 | GIT_TAG v0.8.3 24 | ) 25 | -------------------------------------------------------------------------------- /cmake/recipes/external/entt.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2021 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | 13 | if(TARGET EnTT::EnTT) 14 | return() 15 | endif() 16 | 17 | message(STATUS "Third-party (external): creating target 'EnTT::EnTT'") 18 | 19 | include(CPM) 20 | CPMAddPackage( 21 | NAME entt 22 | GITHUB_REPOSITORY skypjack/entt 23 | GIT_TAG v3.13.2 24 | ) 25 | -------------------------------------------------------------------------------- /cmake/recipes/external/filesystem.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | if(TARGET ghcFilesystem::ghc_filesystem) 13 | return() 14 | endif() 15 | 16 | message(STATUS "Third-party (external): creating target 'ghcFilesystem::ghc_filesystem'") 17 | 18 | include(CPM) 19 | CPMAddPackage( 20 | NAME filesystem 21 | GITHUB_REPOSITORY gulrak/filesystem 22 | GIT_TAG v1.5.4 23 | ) 24 | 25 | target_compile_definitions(ghc_filesystem INTERFACE GHC_WIN_WSTRING_STRING_TYPE) 26 | -------------------------------------------------------------------------------- /cmake/recipes/external/gl3w.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2019 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | if(TARGET gl3w::gl3w) 13 | return() 14 | endif() 15 | 16 | message(STATUS "Third-party (external): creating target 'gl3w::gl3w'") 17 | 18 | block() 19 | set(BUILD_SHARED_LIBS OFF) 20 | include(CPM) 21 | CPMAddPackage( 22 | NAME gl3w 23 | GITHUB_REPOSITORY adobe/lagrange-gl3w 24 | GIT_TAG a9e41479e30266cecb72df413f4f6d71b0228a71 25 | ) 26 | endblock() 27 | 28 | add_library(gl3w::gl3w ALIAS gl3w) 29 | 30 | set_target_properties(gl3w PROPERTIES POSITION_INDEPENDENT_CODE ON) 31 | set_target_properties(gl3w PROPERTIES FOLDER third_party) 32 | -------------------------------------------------------------------------------- /cmake/recipes/external/glad.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | if(TARGET glad::glad) 13 | return() 14 | endif() 15 | 16 | message(STATUS "Third-party: creating target 'glad::glad'") 17 | 18 | block() 19 | set(BUILD_SHARED_LIBS OFF) 20 | include(CPM) 21 | CPMAddPackage( 22 | NAME glad 23 | GIT_REPOSITORY https://github.com/libigl/libigl-glad.git 24 | GIT_TAG 3b1d0005d1c4a07c0a3d23a0c3b38c7eedf027e0 25 | ) 26 | endblock() 27 | 28 | add_library(glad::glad ALIAS glad) 29 | 30 | set_target_properties(glad PROPERTIES FOLDER third_party) 31 | -------------------------------------------------------------------------------- /cmake/recipes/external/lagrange-assets.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | if(TARGET lagrange::assets) 13 | return() 14 | endif() 15 | 16 | message(STATUS "Lagrange: creating target 'lagrange::assets'") 17 | 18 | include(CPM) 19 | CPMAddPackage( 20 | NAME lagrange-assets 21 | GITHUB_REPOSITORY adobe/lagrange-assets 22 | GIT_TAG f3407b0eb8266111c720b28577050e9a8f7901a5 23 | ) 24 | 25 | add_library(lagrange::assets INTERFACE IMPORTED GLOBAL) 26 | target_include_directories(lagrange::assets INTERFACE "${lagrange-assets_SOURCE_DIR}") 27 | -------------------------------------------------------------------------------- /cmake/recipes/external/lapack.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | if(TARGET LAPACK::LAPACK) 13 | return() 14 | endif() 15 | 16 | message(STATUS "Third-party (external): creating target 'LAPACK::LAPACK'") 17 | 18 | if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" OR "arm64" IN_LIST CMAKE_OSX_ARCHITECTURES) 19 | # Use Accelerate on macOS M1 20 | set(BLA_VENDOR Apple) 21 | find_package(LAPACK REQUIRED) 22 | else() 23 | # Use MKL on other platforms 24 | lagrange_find_package(MKL CONFIG REQUIRED GLOBAL) 25 | add_library(LAPACK::LAPACK ALIAS MKL::MKL) 26 | endif() 27 | -------------------------------------------------------------------------------- /cmake/recipes/external/libigl.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2019 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | if(TARGET igl::core) 13 | return() 14 | endif() 15 | 16 | message(STATUS "Third-party (external): creating target 'igl::core'") 17 | 18 | lagrange_find_package(Eigen3 REQUIRED) 19 | option(LIBIGL_INSTALL "Enable installation of libigl targets" ON) 20 | 21 | include(CPM) 22 | CPMAddPackage( 23 | NAME libigl 24 | GITHUB_REPOSITORY libigl/libigl 25 | GIT_TAG 89267b4a80b1904de3f6f2812a2053e5e9332b7e 26 | ) 27 | 28 | set_target_properties(igl_core PROPERTIES FOLDER third_party/libigl) 29 | -------------------------------------------------------------------------------- /cmake/recipes/external/mshio.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | if(TARGET mshio::mshio) 13 | return() 14 | endif() 15 | 16 | message(STATUS "Third-party (external): creating target 'mshio::mshio'") 17 | 18 | include(CPM) 19 | CPMAddPackage( 20 | NAME mshio 21 | GITHUB_REPOSITORY qnzhou/MshIO 22 | GIT_TAG 2a897f96ee76497d90dd8560325c232278aaea9d 23 | ) 24 | 25 | set_target_properties(mshio PROPERTIES FOLDER third_party) 26 | set_target_properties(mshio PROPERTIES POSITION_INDEPENDENT_CODE ON) 27 | -------------------------------------------------------------------------------- /cmake/recipes/external/python.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | if(TARGET Python::Module) 13 | return() 14 | endif() 15 | 16 | set(Python_FIND_VIRTUALENV FIRST) 17 | find_package(Python 3.9 COMPONENTS Interpreter Development.Module REQUIRED) 18 | -------------------------------------------------------------------------------- /cmake/recipes/external/span-lite.natvis: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | empty 7 | [{size_}] (span) 8 | 9 | size_ 10 | 11 | size_ 12 | data_ 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /cmake/recipes/external/tinyad.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | 13 | if(TARGET tinyad::tinyad) 14 | return() 15 | endif() 16 | 17 | message(STATUS "Third-party (external): creating target 'tinyad::tinyad'") 18 | 19 | include(CPM) 20 | CPMAddPackage( 21 | NAME tinyad 22 | GITHUB_REPOSITORY patr-schm/TinyAD 23 | GIT_TAG 29417031c185b6dc27b6d4b684550d844459b735 24 | DOWNLOAD_ONLY ON 25 | ) 26 | 27 | add_library(tinyad INTERFACE) 28 | add_library(tinyad::tinyad ALIAS tinyad) 29 | 30 | target_include_directories(tinyad 31 | INTERFACE 32 | ${tinyad_SOURCE_DIR}/include 33 | ) -------------------------------------------------------------------------------- /cmake/recipes/external/tracy.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2021 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | if(TARGET Tracy::TracyClient) 13 | return() 14 | endif() 15 | 16 | message(STATUS "Third-party (external): creating target 'tracy::client'") 17 | 18 | include(CPM) 19 | CPMAddPackage( 20 | NAME tracy 21 | GITHUB_REPOSITORY wolfpld/tracy 22 | GIT_TAG v0.10 23 | ) 24 | -------------------------------------------------------------------------------- /cmake/recipes/external/winding_number.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2021 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | if(TARGET WindingNumber::WindingNumber) 13 | return() 14 | endif() 15 | 16 | message(STATUS "Third-party (external): creating target 'WindingNumber::WindingNumber'") 17 | 18 | lagrange_find_package(TBB CONFIG REQUIRED) 19 | include(simde) 20 | 21 | include(CPM) 22 | CPMAddPackage( 23 | NAME WindingNumber 24 | GITHUB_REPOSITORY jdumas/WindingNumber 25 | GIT_TAG a48b8f555b490afe7aab9159c7daaf83fa2cdf8e 26 | ) 27 | 28 | set_target_properties(WindingNumber PROPERTIES FOLDER third_party) 29 | -------------------------------------------------------------------------------- /docs/python/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /docs/python/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/python/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | 13 | %SPHINXBUILD% >NUL 2>NUL 14 | if errorlevel 9009 ( 15 | echo. 16 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 17 | echo.installed, then set the SPHINXBUILD environment variable to point 18 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 19 | echo.may add the Sphinx directory to PATH. 20 | echo. 21 | echo.If you don't have Sphinx installed, grab it from 22 | echo.https://www.sphinx-doc.org/ 23 | exit /b 1 24 | ) 25 | 26 | if "%1" == "" goto help 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/python/source/_static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/lagrange/b3f4080cf039c043d7024a78b0a3e42ea1379dec/docs/python/source/_static/.gitkeep -------------------------------------------------------------------------------- /docs/python/source/_templates/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/lagrange/b3f4080cf039c043d7024a78b0a3e42ea1379dec/docs/python/source/_templates/.gitkeep -------------------------------------------------------------------------------- /docs/python/source/index.rst: -------------------------------------------------------------------------------- 1 | .. Lagrange documentation master file, created by 2 | sphinx-quickstart on Wed Nov 22 10:14:32 2023. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to Lagrange's documentation! 7 | ==================================== 8 | 9 | .. toctree:: 10 | :maxdepth: 2 11 | :caption: Contents: 12 | 13 | 14 | Indices and tables 15 | ================== 16 | 17 | * :ref:`genindex` 18 | * :ref:`modindex` 19 | * :ref:`search` 20 | -------------------------------------------------------------------------------- /modules/bvh/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | # 1. define module 13 | lagrange_add_module(INTERFACE) 14 | 15 | # 2. dependencies 16 | lagrange_find_package(nanoflann REQUIRED) 17 | include(libigl) 18 | target_link_libraries(lagrange_bvh INTERFACE 19 | lagrange::core 20 | nanoflann::nanoflann 21 | igl::core 22 | ) 23 | 24 | # 3. unit tests and examples 25 | if(LAGRANGE_UNIT_TESTS) 26 | add_subdirectory(tests) 27 | endif() 28 | 29 | if(LAGRANGE_EXAMPLES) 30 | add_subdirectory(examples) 31 | endif() 32 | -------------------------------------------------------------------------------- /modules/bvh/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | include(cli11) 13 | lagrange_include_modules(io) 14 | 15 | lagrange_add_example(weld_vertices weld_vertices.cpp) 16 | target_link_libraries(weld_vertices lagrange::bvh lagrange::io CLI11::CLI11) 17 | -------------------------------------------------------------------------------- /modules/bvh/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_test() 13 | -------------------------------------------------------------------------------- /modules/core/core.md: -------------------------------------------------------------------------------- 1 | Core Module 2 | ============ 3 | 4 | @namespace lagrange 5 | @brief Main namespace for Lagrange. 6 | 7 | @defgroup module-core Core Module 8 | @brief Core module for Lagrange. 9 | 10 | ### Quick links 11 | 12 | - [SurfaceMesh](@ref group-surfacemesh) 13 | - [Mesh](@ref lagrange::Mesh) [deprecated] 14 | -------------------------------------------------------------------------------- /modules/core/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | include(cli11) 13 | lagrange_include_modules(io) 14 | 15 | lagrange_add_example(mesh_cleanup mesh_cleanup.cpp) 16 | target_link_libraries(mesh_cleanup lagrange::core lagrange::io CLI11::CLI11) 17 | 18 | lagrange_add_example(fix_nonmanifold fix_nonmanifold.cpp) 19 | target_link_libraries(fix_nonmanifold lagrange::core lagrange::io CLI11::CLI11) 20 | 21 | include(polyscope) 22 | lagrange_add_example(mesh_viewer mesh_viewer.cpp) 23 | target_link_libraries(mesh_viewer lagrange::core lagrange::io CLI11::CLI11 polyscope::polyscope) 24 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/Components.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | #include 16 | #endif 17 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/DisjointSets.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | 13 | #pragma once 14 | #pragma message( \ 15 | "DisjointSets.h has been moved lagrange/utils/DisjointSets.h, please update #include lines.") 16 | #include 17 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/MeshTopology.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | // Use `topology.h` instead. 16 | #include 17 | #endif 18 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/attributes/attribute_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | // Please use lagrange::map_attribute instead. 16 | #include 17 | #endif 18 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/attributes/condense_indexed_attribute.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | // Please use lagrange::weld_indexed_attribute instead. 16 | #include 17 | #endif 18 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/attributes/eval_as_attribute.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | #include 16 | #endif 17 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/attributes/map_attributes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | // Please use lagrange::internal::map_attributes instead. 16 | #include 17 | #endif 18 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/attributes/map_corner_attributes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | // Please use lagrange::internal::map_attributes instead. 16 | #include 17 | #endif 18 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/attributes/map_facet_attributes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | // Please use lagrange::internal::map_attributes instead. 16 | #include 17 | #endif 18 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/attributes/map_indexed_attributes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | // Please use lagrange::internal::map_attributes instead. 16 | #include 17 | #endif 18 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/attributes/map_vertex_attributes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | // Please use lagrange::internal::map_attributes instead. 16 | #include 17 | #endif 18 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/attributes/rename_attribute.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | // Please use lagrange::SurfaceMesh::rename_attribute instead. 16 | #include 17 | #endif 18 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/attributes/unify_corner_indices.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | #include 16 | #endif 17 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/attributes/unify_index_buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | // Please use lagrange::unify_index_buffer instead. 16 | #include 17 | #endif 18 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/chain_edges.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | #include 16 | #endif 17 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/chain_edges_into_simple_loops.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | #include 16 | #endif 17 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/combine_mesh_list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | #include 16 | #endif 17 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/compute_bordered_components.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | // Replaced by compute_components.h 16 | #include 17 | #endif 18 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/compute_corner_normal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | #include 16 | #endif 17 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/compute_euler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | // Use `topology.h` instead. 16 | #include 17 | #endif 18 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/compute_facet_area.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | 13 | #pragma once 14 | 15 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 16 | // Replaced by compute_area.h. 17 | #include 18 | #endif 19 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/compute_mesh_centroid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | 13 | #pragma once 14 | 15 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 16 | // Replaced by compute_centroid.h. 17 | #include 18 | #endif 19 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/compute_triangle_normal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | #include 16 | #endif 17 | 18 | // For SurfaceMesh class, please refer to compute_facet_normal.h 19 | 20 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/internal/string_from_scalar.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | 16 | namespace lagrange::internal { 17 | 18 | /// 19 | /// Returns a human-readable string from any supported attribute value type. 20 | /// 21 | /// @tparam Scalar Can be any supported attribute value type. 22 | /// 23 | /// @return A human-readable string view of the type name. 24 | /// 25 | template 26 | std::string_view string_from_scalar(); 27 | 28 | } // namespace lagrange::internal 29 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/legacy/inline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | #define LAGRANGE_LEGACY_INLINE inline 16 | #else 17 | #define LAGRANGE_LEGACY_INLINE 18 | #endif 19 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/marching_triangles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | 13 | #pragma once 14 | 15 | #include 16 | 17 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 18 | #pragma message( \ 19 | "This header is deprecated. Use `trim_by_isoline` or `extract_isoline` from `` instead.") 20 | #include 21 | #endif 22 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/mesh_cleanup/detect_degenerate_triangles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 14 | #include 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/mesh_cleanup/is_vertex_manifold.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | // Use `topology.h` instead. 16 | #include 17 | #endif 18 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/mesh_cleanup/remove_degenerate_triangles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 14 | #include 15 | #endif 16 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/mesh_cleanup/remove_null_area_triangles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 14 | #include 15 | #endif 16 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/mesh_cleanup/remove_topologically_degenerate_triangles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 14 | #include 15 | #endif 16 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/mesh_cleanup/split_triangle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | #include 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/point_on_segment.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #pragma message(" has been moved to ") 15 | #include 16 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/point_segment_squared_distance.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #pragma message(" has been moved to " \ 15 | "") 16 | #include 17 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/point_triangle_squared_distance.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #pragma message(" has been moved to " \ 15 | "") 16 | #include 17 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/quad_to_tri.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 15 | // Please consider using `triangulate_polygoanl_facets`. 16 | #include 17 | #endif 18 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/reorder_mesh_vertices.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | 13 | #pragma once 14 | 15 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 16 | // Please use remap_vertices.h instead. 17 | #include 18 | #endif 19 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/types/ConnectivityType.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | namespace lagrange { 15 | 16 | /// 17 | /// This type defines the condition when two facets are considered as "connected". 18 | /// 19 | enum class ConnectivityType { 20 | Vertex, ///< Two facets are considered connected if they share a vertex. 21 | Edge ///< Two facets are considered connected if they share an edge. 22 | }; 23 | 24 | } // namespace lagrange 25 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/types/MappingPolicy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | 13 | #pragma once 14 | 15 | namespace lagrange { 16 | 17 | /// 18 | /// Mapping policy control the behavior when two or more elements are mapped into the same output 19 | /// element. 20 | /// 21 | enum class MappingPolicy { 22 | Average, ///< Take the average of all involved elements. 23 | KeepFirst, ///< Keep the value of the first elements. 24 | Error, ///< Throw an error if collision is detected. 25 | }; 26 | 27 | } // namespace lagrange 28 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/utils/SmallSet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #pragma message("SmallSet has been renamed StackSet. Please update your code accordingly.") 15 | 16 | #include 17 | 18 | namespace lagrange { 19 | 20 | /// @cond LA_INTERNAL_DOCS 21 | 22 | // Has been renamed. Please use the new type name instead. 23 | [[deprecated]] template 24 | using SmallSet = StackSet; 25 | 26 | /// @endcond 27 | 28 | } // namespace lagrange 29 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/utils/fpe.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | 16 | namespace lagrange { 17 | 18 | /// @addtogroup group-utils-misc 19 | /// @{ 20 | 21 | /// 22 | /// Enable floating-point exceptions (useful for debugging).. 23 | /// 24 | LA_CORE_API void enable_fpe(); 25 | 26 | /// 27 | /// Disable previously-enabled fpe.. 28 | /// 29 | LA_CORE_API void disable_fpe(); 30 | 31 | /// @} 32 | 33 | } // namespace lagrange 34 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/utils/span.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | 16 | namespace lagrange { 17 | 18 | /// @addtogroup group-utils-misc 19 | /// @{ 20 | 21 | /// 22 | /// A bounds-safe view for sequences of objects. 23 | /// 24 | /// @note The current implementation is intended to be compatible with C++20's std::span<>. 25 | /// 26 | template 27 | using span = ::nonstd::span; 28 | 29 | /// Span extent type. 30 | using extent_t = span_CONFIG_EXTENT_TYPE; 31 | 32 | /// @} 33 | 34 | } // namespace lagrange 35 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/utils/tracy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #ifdef TRACY_ENABLE 15 | #include 16 | 17 | // Alias Tracy macros used in Lagrange 18 | #define LAGRANGE_ZONE_SCOPED ZoneScoped 19 | #define LAGRANGE_FRAME_MARK FrameMark 20 | 21 | #else 22 | 23 | // Empty placeholders when Tracy is disabled 24 | #define LAGRANGE_ZONE_SCOPED do {} while (false) 25 | #define LAGRANGE_FRAME_MARK do {} while (false) 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /modules/core/include/lagrange/utils/warnon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #if defined(__GNUC__) 13 | #pragma GCC diagnostic pop 14 | #elif defined(__clang__) 15 | #pragma clang diagnostic pop 16 | #elif defined(_MSC_VER) 17 | #pragma warning(pop) 18 | #endif 19 | -------------------------------------------------------------------------------- /modules/core/python/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_python_binding() 13 | -------------------------------------------------------------------------------- /modules/core/python/include/lagrange/python/core.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | // clang-format off 15 | #include 16 | #include 17 | #include 18 | // clang-format on 19 | 20 | namespace lagrange::python { 21 | void populate_core_module(nanobind::module_& m); 22 | } 23 | -------------------------------------------------------------------------------- /modules/core/python/src/bind_enum.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | // clang-format off 15 | #include 16 | #include 17 | #include 18 | // clang-format on 19 | 20 | namespace lagrange::python { 21 | void bind_enum(nanobind::module_& m); 22 | } 23 | -------------------------------------------------------------------------------- /modules/core/python/src/logging.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | namespace lagrange::python { 15 | 16 | /// 17 | /// Registers a Python logging sink for lagrange::Logger. 18 | /// 19 | void register_python_logger(); 20 | 21 | } // namespace lagrange::python 22 | -------------------------------------------------------------------------------- /modules/core/python/tests/test_compute_seam_edges.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | import lagrange 13 | 14 | import numpy as np 15 | import pytest 16 | 17 | from .assets import cube_with_uv, cube 18 | 19 | 20 | class TestComputeCentroid: 21 | def test_cube(self, cube_with_uv): 22 | mesh = cube_with_uv 23 | seam_id = lagrange.compute_seam_edges(mesh, mesh.get_attribute_id("uv")) 24 | assert np.count_nonzero(mesh.attribute(seam_id).data) == 7 25 | -------------------------------------------------------------------------------- /modules/core/python/tests/test_detect_degenerate_facets.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | import lagrange 13 | from .assets import cube 14 | 15 | import numpy as np 16 | 17 | 18 | class TestDetectDegenerateFacets: 19 | def test_cube(self, cube): 20 | mesh = cube 21 | r = lagrange.detect_degenerate_facets(mesh) 22 | assert len(r) == 0 23 | 24 | def test_degenerate_cube(self, cube): 25 | mesh = cube 26 | lagrange.triangulate_polygonal_facets(mesh) 27 | vertices = mesh.vertices 28 | vertices[0:4] = np.zeros((4, 3)) 29 | r = lagrange.detect_degenerate_facets(mesh) 30 | assert len(r) == 6 31 | -------------------------------------------------------------------------------- /modules/core/python/tests/test_orient_outward.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | import lagrange 13 | from .assets import cube 14 | 15 | import numpy as np 16 | import pytest 17 | 18 | 19 | class TestOrientOutward: 20 | def test_cube(self, cube): 21 | mesh1 = cube.clone() 22 | lagrange.orient_outward(mesh1) 23 | mesh2 = cube.clone() 24 | lagrange.orient_outward(mesh2, positive=False) 25 | 26 | assert not np.allclose(mesh1.facets, mesh2.facets) 27 | -------------------------------------------------------------------------------- /modules/core/python/tests/test_select_facets_by_normal_similarity.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | import lagrange 13 | import numpy as np 14 | import pytest 15 | 16 | from .assets import * 17 | 18 | 19 | class TestSelectFacetsByNormalSimilarity: 20 | def test_cube(self, single_triangle): 21 | mesh = single_triangle 22 | lagrange.select_facets_by_normal_similarity(mesh, 0, output_attribute_name="is_selected") 23 | is_selected = mesh.attribute("is_selected") 24 | assert is_selected.data[0] == 1 25 | -------------------------------------------------------------------------------- /modules/core/python/tests/utils.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | def assert_sharing_raw_data(buf1, buf2): 13 | assert buf1.__array_interface__["data"][0] == buf2.__array_interface__["data"][0] 14 | 15 | 16 | def address(buf): 17 | return hex(buf.__array_interface__["data"][0]) 18 | -------------------------------------------------------------------------------- /modules/core/src/Mesh.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | 13 | #include 14 | 15 | namespace lagrange { 16 | 17 | template class Mesh; 18 | template class Mesh; 19 | template class Mesh; 20 | template class Mesh; 21 | template class Mesh; 22 | template class Mesh; 23 | template class Mesh; 24 | template class Mesh; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /modules/core/src/eigen.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #include 13 | 14 | #if !EIGEN_VERSION_AT_LEAST(3,4,0) 15 | #error "Lagrange requires Eigen version to be >= 3.4.0" 16 | #endif 17 | -------------------------------------------------------------------------------- /modules/core/src/foreach_attribute.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | 13 | #include 14 | 15 | // clang-format off 16 | #include 17 | #include 18 | #include 19 | // clang-format on 20 | 21 | namespace lagrange::details { 22 | 23 | void par_foreach_attribute_id(span ids, function_ref cb) 24 | { 25 | tbb::parallel_for(size_t(0), ids.size(), [&](size_t i) { cb(ids[i]); }); 26 | } 27 | 28 | } // namespace lagrange::details 29 | -------------------------------------------------------------------------------- /modules/core/src/internal/string_from_scalar.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #include 13 | 14 | #include 15 | 16 | namespace lagrange::internal { 17 | 18 | #define LA_X_string_from_scalar(_, ValueType) \ 19 | template <> \ 20 | LA_CORE_API std::string_view string_from_scalar() \ 21 | { \ 22 | return #ValueType; \ 23 | } 24 | LA_ATTRIBUTE_X(string_from_scalar, 0) 25 | 26 | } // namespace lagrange::internal 27 | -------------------------------------------------------------------------------- /modules/core/src/utils/Error.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #include 13 | 14 | namespace lagrange { 15 | 16 | Error::~Error() = default; 17 | 18 | BadCastError::~BadCastError() = default; 19 | 20 | ParsingError::~ParsingError() = default; 21 | 22 | } // namespace lagrange 23 | -------------------------------------------------------------------------------- /modules/core/tests/compile_errors/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_compile_test(test_assert.cpp) 13 | lagrange_add_compile_test(test_attribute_type.cpp) 14 | lagrange_add_compile_test(test_mesh_attribute.cpp) 15 | lagrange_add_compile_test(test_mesh_convert1.cpp) 16 | lagrange_add_compile_test(test_mesh_convert2.cpp) 17 | lagrange_add_compile_test(test_mesh_type.cpp) 18 | lagrange_add_compile_test(test_pimpl.cpp) 19 | lagrange_add_compile_test(test_safe_cast.cpp) 20 | -------------------------------------------------------------------------------- /modules/core/tests/compile_errors/test_assert.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #include 13 | 14 | void test_assert() 15 | { 16 | // We want to prevent the macro from taking 3+ arguments: 17 | la_runtime_assert(true, "This should not compile", 0); 18 | } 19 | -------------------------------------------------------------------------------- /modules/core/tests/compile_errors/test_attribute_type.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #include 13 | 14 | void test_mesh_type() 15 | { 16 | lagrange::Attribute attr( 17 | lagrange::AttributeElement::Vertex, 18 | lagrange::AttributeUsage::Vector, 19 | 1); 20 | } 21 | -------------------------------------------------------------------------------- /modules/core/tests/compile_errors/test_mesh_attribute.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #include 13 | 14 | void test_to_surface_mesh() 15 | { 16 | lagrange::SurfaceMesh32f mesh; 17 | 18 | // Prevent implicit copies of the attribute object 19 | auto attr = mesh.get_attribute("foo"); 20 | } 21 | -------------------------------------------------------------------------------- /modules/core/tests/compile_errors/test_mesh_convert1.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #include 13 | 14 | void test_to_surface_mesh() 15 | { 16 | using Scalar = double; 17 | using Index = uint32_t; 18 | 19 | // Trying to wrap a mesh with column-major storage should not compile 20 | lagrange::Mesh> mesh; 21 | auto res = lagrange::to_surface_mesh_wrap(mesh); 22 | } 23 | -------------------------------------------------------------------------------- /modules/core/tests/compile_errors/test_mesh_convert2.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #include 13 | #include 14 | 15 | void test_to_surface_mesh() 16 | { 17 | using Scalar = double; 18 | using Index = uint32_t; 19 | using Triangles32 = Eigen::Matrix; 20 | using TriangleMesh3D32 = lagrange::Mesh; 21 | using MeshType = TriangleMesh3D32; 22 | 23 | // Trying to wrap a temporary should not compile 24 | auto res = lagrange::to_surface_mesh_wrap(MeshType()); 25 | } 26 | -------------------------------------------------------------------------------- /modules/core/tests/compile_errors/test_mesh_type.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #include 13 | 14 | void test_mesh_type() 15 | { 16 | lagrange::SurfaceMesh mesh; 17 | } 18 | -------------------------------------------------------------------------------- /modules/core/tests/compile_errors/test_pimpl.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #include 13 | 14 | void test_pimpl() 15 | { 16 | const lagrange::value_ptr pimpl_ptr = lagrange::value_ptr(10); 17 | 18 | // This should not compile because our value_ptr respects const-ness 19 | *pimpl_ptr = 30; 20 | } 21 | -------------------------------------------------------------------------------- /modules/core/tests/compile_errors/test_safe_cast.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #include 13 | 14 | test_safe_cast() 15 | { 16 | using lagrange::safe_cast_enum; 17 | enum AnimalFr { cheval = 0, ane, singe, chien }; 18 | enum class AnimalEn : std::uint32_t { horse, donkey, monkey, dog }; 19 | enum class AnimalFa : std::int32_t { asb, khar, meimoon, sag }; 20 | 21 | // This should not compile 22 | safe_cast_enum(AnimalEn::horse); 23 | } 24 | -------------------------------------------------------------------------------- /modules/core/tests/test_utils_utils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #include 13 | 14 | #include 15 | 16 | TEST_CASE("utils-utils") 17 | { 18 | using namespace lagrange; 19 | 20 | REQUIRE(to_degrees(0.0) == 0.0); 21 | REQUIRE(to_degrees(M_PI) == 180.0); 22 | 23 | REQUIRE(to_radians(0.0) == 0.0); 24 | REQUIRE(to_radians(180.0) == M_PI); 25 | 26 | REQUIRE(sign(20) == 1); 27 | REQUIRE(sign(-3) == -1); 28 | REQUIRE(sign(0) == 0); 29 | } 30 | -------------------------------------------------------------------------------- /modules/filtering/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2025 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | 13 | lagrange_include_modules(io) 14 | 15 | lagrange_add_example(mesh_smoothing mesh_smoothing.cpp) 16 | target_link_libraries(mesh_smoothing lagrange::filtering CLI11::CLI11 lagrange::io) 17 | -------------------------------------------------------------------------------- /modules/filtering/filtering.md: -------------------------------------------------------------------------------- 1 | Filtering Module 2 | ============ 3 | 4 | @namespace lagrange::filtering 5 | 6 | @defgroup module-filtering Filtering Module 7 | @brief Mesh filtering utilities. 8 | -------------------------------------------------------------------------------- /modules/filtering/python/include/lagrange/python/filtering.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | // clang-format off 15 | #include 16 | #include 17 | #include 18 | // clang-format on 19 | 20 | namespace lagrange::python { 21 | void populate_filtering_module(nanobind::module_& m); 22 | } 23 | -------------------------------------------------------------------------------- /modules/filtering/python/include/lagrange/python/setup_mkl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | namespace lagrange::python { 15 | 16 | void setup_mkl(); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /modules/filtering/python/src/setup_mkl.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #include 13 | 14 | #if LAGRANGE_USE_MKL_SDL 15 | 16 | #include 17 | 18 | namespace lagrange::python { 19 | 20 | void setup_mkl() 21 | { 22 | mkl_set_threading_layer(MKL_THREADING_TBB); 23 | } 24 | 25 | } // namespace lagrange::python 26 | 27 | #else 28 | 29 | namespace lagrange::python { 30 | void setup_mkl() {} 31 | } // namespace lagrange::python 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /modules/filtering/python/tests/test_mesh_smoothing.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2025 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | import lagrange 13 | 14 | import math 15 | import pytest 16 | import numpy as np 17 | import logging 18 | 19 | from .assets import cube 20 | 21 | class TestMeshSmoothing: 22 | def test_cube(self, cube): 23 | assert cube.num_vertices == 8 24 | assert cube.num_facets == 6 25 | lagrange.filtering.mesh_smoothing(cube) 26 | assert cube.num_vertices == 8 27 | assert cube.num_facets == 6 28 | -------------------------------------------------------------------------------- /modules/filtering/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2025 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_test() 13 | -------------------------------------------------------------------------------- /modules/fs/fs.md: -------------------------------------------------------------------------------- 1 | Filesystem Module 2 | ============ 3 | 4 | @namespace lagrange::fs 5 | 6 | @defgroup module-fs FS Module 7 | @brief Filesystem utilities. 8 | 9 | This module exists as an alias towards one of the following backend: 10 | 1. [gulrak/filesystem](https://github.com/gulrak/filesystem), for C++11/C++14 compatibility. 11 | 2. [Boost.Filesystem](https://github.com/boostorg/filesystem), for systems using Boost. 12 | 3. [std::filesystem](https://en.cppreference.com/w/cpp/filesystem), for C++17. 13 | -------------------------------------------------------------------------------- /modules/fs/src/filesystem.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #include 13 | 14 | #if defined(LAGRANGE_USE_GHC_FS) 15 | #include 16 | #endif 17 | -------------------------------------------------------------------------------- /modules/fs/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_test() 13 | 14 | target_compile_definitions(test_lagrange_fs PRIVATE TEST_APP_PATH="$") 15 | target_compile_definitions(test_lagrange_fs PRIVATE TEST_WORK_DIR="${CMAKE_CURRENT_BINARY_DIR}") 16 | -------------------------------------------------------------------------------- /modules/image/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | 13 | # 1. define module 14 | lagrange_add_module() 15 | target_compile_features(lagrange_image PUBLIC cxx_std_17) 16 | 17 | # 2. dependencies 18 | lagrange_include_modules(core) 19 | target_link_libraries(lagrange_image PUBLIC 20 | lagrange::core 21 | ) 22 | 23 | # 3. unit tests and examples 24 | if(LAGRANGE_UNIT_TESTS) 25 | add_subdirectory(tests) 26 | endif() 27 | 28 | if(LAGRANGE_EXAMPLES) 29 | add_subdirectory(examples) 30 | endif() 31 | 32 | if(LAGRANGE_MODULE_PYTHON) 33 | add_subdirectory(python) 34 | endif() 35 | -------------------------------------------------------------------------------- /modules/image/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_include_modules(io image_io) 13 | 14 | lagrange_add_example(texture_sampling_demo texture_sampling_demo.cpp) 15 | target_link_libraries(texture_sampling_demo lagrange::image lagrange::io lagrange::image_io CLI11::CLI11) 16 | -------------------------------------------------------------------------------- /modules/image/image.md: -------------------------------------------------------------------------------- 1 | Image Module 2 | ============ 3 | 4 | @namespace lagrange::image 5 | @brief Basic image data structure. 6 | 7 | @defgroup module-image Image Module 8 | @brief Basic image data structure. 9 | 10 | ### Quick links 11 | -------------------------------------------------------------------------------- /modules/image/python/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_python_binding() 13 | -------------------------------------------------------------------------------- /modules/image/python/include/lagrange/python/image.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | // clang-format off 15 | #include 16 | #include 17 | #include 18 | // clang-format on 19 | 20 | namespace lagrange::python { 21 | void populate_image_module(nanobind::module_& m); 22 | } 23 | -------------------------------------------------------------------------------- /modules/image/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_test() 13 | -------------------------------------------------------------------------------- /modules/image_io/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | 13 | # 1. define module 14 | lagrange_add_module() 15 | 16 | # 2. dependencies 17 | include(tinyexr) 18 | include(stb) 19 | lagrange_include_modules(image fs) 20 | target_link_libraries(lagrange_image_io 21 | PUBLIC 22 | lagrange::image 23 | lagrange::fs 24 | PRIVATE 25 | stb::image 26 | stb::image_write 27 | tinyexr::tinyexr 28 | ) 29 | 30 | # 3. unit tests and examples 31 | if(LAGRANGE_UNIT_TESTS) 32 | add_subdirectory(tests) 33 | endif() 34 | 35 | if(LAGRANGE_EXAMPLES) 36 | add_subdirectory(examples) 37 | endif() 38 | -------------------------------------------------------------------------------- /modules/image_io/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_example(mesh_to_svg mesh_to_svg.cpp) 13 | target_link_libraries(mesh_to_svg lagrange::io lagrange::image_io CLI11::CLI11) 14 | -------------------------------------------------------------------------------- /modules/image_io/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_test() 13 | 14 | target_link_libraries(test_lagrange_image_io PRIVATE lagrange::image_io) 15 | -------------------------------------------------------------------------------- /modules/io/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | include(cli11) 13 | 14 | lagrange_add_example(mesh_convert mesh_convert.cpp) 15 | target_link_libraries(mesh_convert lagrange::core lagrange::io CLI11::CLI11) 16 | 17 | lagrange_add_example(scene_io scene_io.cpp) 18 | target_link_libraries(scene_io lagrange::core lagrange::io CLI11::CLI11) 19 | -------------------------------------------------------------------------------- /modules/io/include/lagrange/io/internal/detect_file_format.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | 16 | #include 17 | 18 | namespace lagrange::io::internal { 19 | 20 | /// 21 | /// Automatically detect file format based on the contents of the stream. 22 | /// 23 | /// @param input_stream The input stream. 24 | /// 25 | /// @return The detected file format. 26 | /// 27 | lagrange::io::FileFormat detect_file_format(std::istream& input_stream); 28 | 29 | } // namespace lagrange::io::internal 30 | -------------------------------------------------------------------------------- /modules/io/include/lagrange/io/load_mesh.impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | // remove this file when we drop support for legacy mesh 15 | 16 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 17 | #include 18 | #endif 19 | -------------------------------------------------------------------------------- /modules/io/include/lagrange/io/load_mesh_ext.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | // remove this file when we drop support for legacy mesh 15 | 16 | #ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS 17 | #include 18 | #endif 19 | -------------------------------------------------------------------------------- /modules/io/io.md: -------------------------------------------------------------------------------- 1 | I/O Module 2 | ============ 3 | 4 | @namespace lagrange::io 5 | @brief Mesh input/output. 6 | 7 | @defgroup module-io IO Module 8 | @brief Mesh input/output. 9 | 10 | ### Quick links 11 | 12 | - [load_mesh](@ref lagrange::io::load_mesh) 13 | - [load_mesh_ext](@ref lagrange::io::load_mesh_ext) (for .obj) 14 | - [load_mesh_ply](@ref lagrange::io::load_mesh_ply) 15 | - [save_mesh](@ref lagrange::io::save_mesh) 16 | - [save_mesh_ply](@ref lagrange::io::save_mesh_ply) 17 | -------------------------------------------------------------------------------- /modules/io/python/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_python_binding() 13 | -------------------------------------------------------------------------------- /modules/io/python/include/lagrange/python/io.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | // clang-format off 15 | #include 16 | #include 17 | #include 18 | // clang-format on 19 | 20 | namespace lagrange::python { 21 | void populate_io_module(nanobind::module_& m); 22 | } 23 | -------------------------------------------------------------------------------- /modules/io/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_test() 13 | 14 | if(LAGRANGE_TOPLEVEL_PROJECT) 15 | set_target_properties(test_lagrange_io PROPERTIES COMPILE_WARNING_AS_ERROR ON) 16 | endif() 17 | 18 | # link to stb to make sure the tinygltf dependency does not cause a conflict 19 | include(stb) 20 | target_link_libraries(test_lagrange_io PRIVATE 21 | stb::image 22 | stb::image_write 23 | ) -------------------------------------------------------------------------------- /modules/io/tests/test_load_simple_scene.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | -------------------------------------------------------------------------------- /modules/main.md: -------------------------------------------------------------------------------- 1 | Lagrange Reference Documentation {#mainpage} 2 | ============ 3 | 4 | Reference documentation for Lagrange. 5 | 6 | ### Quick links 7 | 8 | - [SurfaceMesh](@ref group-surfacemesh) 9 | - [Mesh](@ref lagrange::Mesh) [deprecated] 10 | -------------------------------------------------------------------------------- /modules/partitioning/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | # 1. define module 13 | lagrange_add_module() 14 | 15 | # 2. dependencies 16 | include(metis) 17 | target_link_libraries(lagrange_partitioning 18 | PUBLIC 19 | lagrange::core 20 | PRIVATE 21 | metis::metis 22 | ) 23 | 24 | # 3. unit tests and examples 25 | if(LAGRANGE_UNIT_TESTS) 26 | add_subdirectory(tests) 27 | endif() 28 | 29 | if(LAGRANGE_EXAMPLES) 30 | add_subdirectory(examples) 31 | endif() 32 | -------------------------------------------------------------------------------- /modules/partitioning/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_include_modules(io) 13 | 14 | lagrange_add_example(partition_mesh_vertices partition_mesh_vertices.cpp) 15 | target_link_libraries(partition_mesh_vertices lagrange::partitioning lagrange::io CLI11::CLI11) 16 | -------------------------------------------------------------------------------- /modules/partitioning/include/lagrange/partitioning/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | 16 | namespace lagrange { 17 | namespace partitioning { 18 | 19 | /// Index type used by METIS 20 | using index_t = int32_t; 21 | 22 | } // namespace partitioning 23 | } // namespace lagrange 24 | -------------------------------------------------------------------------------- /modules/partitioning/partitioning.md: -------------------------------------------------------------------------------- 1 | Partitioning Module 2 | ============ 3 | 4 | @namespace lagrange::partitioning 5 | @brief Mesh partitioning using METIS. 6 | 7 | @defgroup module-partitioning Partitioning Module 8 | @brief Mesh partitioning using METIS. 9 | 10 | ### Quick links 11 | 12 | - [partition_mesh_vertices ](@ref lagrange::partitioning::partition_mesh_vertices ) 13 | -------------------------------------------------------------------------------- /modules/partitioning/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_test() 13 | -------------------------------------------------------------------------------- /modules/poisson/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | 13 | lagrange_include_modules(io) 14 | 15 | lagrange_add_example(poisson_reconstruction poisson_reconstruction.cpp) 16 | target_link_libraries(poisson_reconstruction lagrange::poisson CLI11::CLI11 lagrange::io) 17 | -------------------------------------------------------------------------------- /modules/poisson/python/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_python_binding() 13 | -------------------------------------------------------------------------------- /modules/poisson/python/include/lagrange/python/poisson.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | // clang-format off 15 | #include 16 | #include 17 | #include 18 | // clang-format on 19 | 20 | namespace lagrange::python { 21 | void populate_poisson_module(nanobind::module_& m); 22 | } 23 | -------------------------------------------------------------------------------- /modules/poisson/src/octree_depth.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | 13 | #include 14 | 15 | namespace lagrange::poisson { 16 | namespace { 17 | 18 | unsigned int ensure_octree_depth(unsigned int depth, size_t num_points) 19 | { 20 | if (depth == 0) { 21 | depth = std::min( 22 | 8, 23 | static_cast(std::ceil(std::log(num_points) / std::log(4.)))); 24 | logger().debug("Setting depth from point count: {} -> {}", num_points, depth); 25 | } 26 | return depth; 27 | } 28 | 29 | } // namespace 30 | } // namespace lagrange::poisson 31 | -------------------------------------------------------------------------------- /modules/poisson/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_test() 13 | -------------------------------------------------------------------------------- /modules/python/lagrange/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/lagrange/b3f4080cf039c043d7024a78b0a3e42ea1379dec/modules/python/lagrange/py.typed -------------------------------------------------------------------------------- /modules/raycasting/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_include_modules(raycasting io) 13 | 14 | lagrange_add_example(project_attributes project.cpp) 15 | target_link_libraries(project_attributes lagrange::raycasting lagrange::io CLI11::CLI11) 16 | 17 | lagrange_add_example(uv_image uv_image.cpp) 18 | target_link_libraries(uv_image lagrange::raycasting lagrange::io lagrange::image_io CLI11::CLI11) 19 | -------------------------------------------------------------------------------- /modules/raycasting/include/lagrange/raycasting/EmbreeHelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | namespace lagrange { 18 | namespace raycasting { 19 | namespace EmbreeHelper { 20 | 21 | LA_RAYCASTING_API 22 | void ensure_no_errors(const RTCDevice& device); 23 | 24 | } // namespace EmbreeHelper 25 | } // namespace raycasting 26 | } // namespace lagrange 27 | -------------------------------------------------------------------------------- /modules/raycasting/performance/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_performance(ray_cast ray_casting.cpp) 13 | target_link_libraries(ray_cast lagrange::raycasting) 14 | -------------------------------------------------------------------------------- /modules/raycasting/raycasting.md: -------------------------------------------------------------------------------- 1 | Raycasting Module 2 | ============ 3 | 4 | @namespace lagrange::raycasting 5 | @brief Raycasting operations. 6 | 7 | @defgroup module-raycasting Raycasting Module 8 | @brief Raycasting operations. 9 | 10 | ### Quick links 11 | 12 | - [create_ray_caster](@ref lagrange::raycasting::create_ray_caster) 13 | - [RayCaster](@ref lagrange::raycasting::RayCaster) 14 | - [EmbreeRayCaster](@ref lagrange::raycasting::EmbreeRayCaster) 15 | - [project_attributes](@ref lagrange::raycasting::project_attributes) 16 | - [project_attributes_closest_point](@ref lagrange::raycasting::project_attributes_closest_point) 17 | - [project_attributes_directional](@ref lagrange::raycasting::project_attributes_directional) 18 | - [project_attributes_closest_vertex](@ref lagrange::bvh::project_attributes_closest_vertex) 19 | -------------------------------------------------------------------------------- /modules/raycasting/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_test() 13 | -------------------------------------------------------------------------------- /modules/scene/python/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_python_binding() 13 | -------------------------------------------------------------------------------- /modules/scene/python/include/lagrange/python/scene.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | // clang-format off 15 | #include 16 | #include 17 | #include 18 | // clang-format on 19 | 20 | namespace lagrange::python { 21 | void populate_scene_module(nanobind::module_& m); 22 | } 23 | -------------------------------------------------------------------------------- /modules/scene/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_test() 13 | if(LAGRANGE_TOPLEVEL_PROJECT) 14 | set_target_properties(test_lagrange_scene PROPERTIES COMPILE_WARNING_AS_ERROR ON) 15 | endif() 16 | -------------------------------------------------------------------------------- /modules/subdivision/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | include(cli11) 13 | lagrange_include_modules(io) 14 | 15 | lagrange_add_example(mesh_subdivision mesh_subdivision.cpp) 16 | target_link_libraries(mesh_subdivision lagrange::subdivision lagrange::io CLI11::CLI11) 17 | -------------------------------------------------------------------------------- /modules/subdivision/python/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_python_binding() 13 | -------------------------------------------------------------------------------- /modules/subdivision/python/include/lagrange/python/subdivision.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | // clang-format off 15 | #include 16 | #include 17 | #include 18 | // clang-format on 19 | 20 | namespace lagrange::python { 21 | void populate_subdivision_module(nanobind::module_& m); 22 | } 23 | -------------------------------------------------------------------------------- /modules/subdivision/subdivision.md: -------------------------------------------------------------------------------- 1 | Subdivision Module 2 | ============ 3 | 4 | @namespace lagrange::subdivision 5 | @brief Subdivision surfaces. 6 | 7 | @defgroup module-subdivision Subdivision Module 8 | @brief Subdivision surfaces. 9 | -------------------------------------------------------------------------------- /modules/subdivision/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_test() 13 | -------------------------------------------------------------------------------- /modules/testing/src/detect_fp_behavior.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #include 13 | 14 | #include "detect_fp_behavior_helper.h" 15 | 16 | namespace lagrange::testing { 17 | 18 | FloatPointBehavior detect_fp_behavior() 19 | { 20 | return internal::detect_fp_behavior_helper(0x1.634cd6p-13, -0x1.1b4ec4p-15, 0x1.9e87c6p-12); 21 | } 22 | 23 | } // namespace lagrange::testing 24 | -------------------------------------------------------------------------------- /modules/testing/src/detect_fp_behavior_helper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | 16 | namespace lagrange::testing::internal { 17 | 18 | // Call this function with the following arguments (implemented in a separate compilation unit to 19 | // prevent compile-time optimization from the compiler): 20 | // 21 | // d00 = 0x1.634cd6p-13 22 | // d01 = -0x1.1b4ec4p-15 23 | // d11 = 0x1.9e87c6p-12 24 | FloatPointBehavior detect_fp_behavior_helper(float d00, float d01, float d11); 25 | 26 | } // namespace lagrange::testing::internal 27 | -------------------------------------------------------------------------------- /modules/ui/examples/101_Viewer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | 13 | #include 14 | namespace ui = lagrange::ui; 15 | 16 | int main(int argc, char** argv) 17 | { 18 | // Instantiate viewer 19 | ui::Viewer viewer(argc, argv); 20 | 21 | // Run the viewer until user exits 22 | viewer.run(); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /modules/ui/examples/ui_callbacks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | include(cli11) 13 | lagrange_include_modules(io) 14 | 15 | lagrange_add_example(ui_callbacks WITH_UI 16 | main.cpp 17 | ) 18 | 19 | target_link_libraries(ui_callbacks lagrange::ui lagrange::io CLI11::CLI11) 20 | -------------------------------------------------------------------------------- /modules/ui/examples/ui_dynamic_mesh/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | include(cli11) 13 | lagrange_include_modules(io) 14 | 15 | lagrange_add_example(ui_dynamic_mesh WITH_UI 16 | main.cpp 17 | ) 18 | 19 | target_link_libraries(ui_dynamic_mesh lagrange::ui lagrange::io CLI11::CLI11) 20 | -------------------------------------------------------------------------------- /modules/ui/examples/ui_playground/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | include(cli11) 13 | lagrange_include_modules(io) 14 | 15 | lagrange_add_example(ui_playground WITH_UI 16 | main.cpp 17 | ) 18 | 19 | target_link_libraries(ui_playground lagrange::ui lagrange::io CLI11::CLI11) 20 | -------------------------------------------------------------------------------- /modules/ui/examples/ui_scene/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | include(cli11) 13 | lagrange_include_modules(io) 14 | 15 | lagrange_add_example(ui_scene WITH_UI 16 | main.cpp 17 | ) 18 | 19 | target_link_libraries(ui_scene lagrange::ui lagrange::io CLI11::CLI11) 20 | -------------------------------------------------------------------------------- /modules/ui/examples/ui_show_attribute/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | include(cli11) 13 | lagrange_include_modules(io) 14 | 15 | lagrange_add_example(ui_show_attribute WITH_UI 16 | main.cpp 17 | ) 18 | 19 | target_link_libraries(ui_show_attribute lagrange::ui lagrange::io CLI11::CLI11) 20 | -------------------------------------------------------------------------------- /modules/ui/examples/ui_treenode/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | include(cli11) 13 | lagrange_include_modules(io) 14 | 15 | lagrange_add_example(ui_treenode WITH_UI 16 | main.cpp 17 | ) 18 | 19 | target_link_libraries(ui_treenode lagrange::ui lagrange::io CLI11::CLI11) 20 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/components/AcceleratedPicking.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | 16 | // clang-format off 17 | #include 18 | #include 19 | #include 20 | // clang-format on 21 | 22 | namespace lagrange { 23 | namespace ui { 24 | 25 | 26 | struct AcceleratedPicking 27 | { 28 | igl::AABB root; 29 | RowMajorMatrixXf V; 30 | RowMajorMatrixXi F; 31 | }; 32 | 33 | } // namespace ui 34 | } // namespace lagrange 35 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/components/AttributeRender.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | 16 | namespace lagrange { 17 | namespace ui { 18 | 19 | enum class Glyph { Surface, Line, Wire, Arrow, Point }; 20 | 21 | struct AttributeRender 22 | { 23 | /// Type of the attribute 24 | IndexingMode attribute_type; 25 | 26 | /// Name of the attribute 27 | std::string source_attribute; 28 | bool dirty = true; 29 | }; 30 | 31 | } // namespace ui 32 | } // namespace lagrange -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/components/Bounds.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | namespace lagrange { 18 | namespace ui { 19 | 20 | /// Extent in 3D defined by Axis Aligned Bounding Box 21 | struct Bounds 22 | { 23 | /// Bounds of the entity itself (e.g. of the mesh) 24 | AABB local; 25 | 26 | /// Bounds of the entity in world space 27 | AABB global; 28 | 29 | /// Bounds of the entity AND its children in world space 30 | AABB bvh_node; 31 | }; 32 | 33 | } // namespace ui 34 | } // namespace lagrange 35 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/components/ElementSelection.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | 16 | namespace lagrange { 17 | namespace ui { 18 | 19 | template 20 | struct SubSelection 21 | { 22 | std::unordered_set indices; 23 | }; 24 | 25 | 26 | } // namespace ui 27 | } // namespace lagrange 28 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/components/EventEmitter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | namespace lagrange { 18 | namespace ui { 19 | 20 | struct EventEmitter : public entt::emitter 21 | { 22 | }; 23 | 24 | 25 | } // namespace ui 26 | } // namespace lagrange -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/components/MeshData.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | #include 14 | #include 15 | 16 | 17 | namespace lagrange { 18 | namespace ui { 19 | 20 | struct MeshData 21 | { 22 | std::shared_ptr mesh; 23 | entt::type_info type = entt::type_id(); 24 | }; 25 | 26 | struct MeshDataDirty 27 | { 28 | bool vertices = false; 29 | bool normals = false; 30 | bool all = false; 31 | }; 32 | 33 | } // namespace ui 34 | } // namespace lagrange -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/components/MeshGeometry.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | #include 14 | 15 | 16 | namespace lagrange { 17 | namespace ui { 18 | 19 | struct MeshGeometry 20 | { 21 | Entity entity = NullEntity; 22 | entt::id_type submesh_index = entt::null; 23 | }; 24 | 25 | 26 | } // namespace ui 27 | } // namespace lagrange -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/components/ObjectIDViewport.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | namespace lagrange { 18 | namespace ui { 19 | 20 | // Global compontent 21 | struct ObjectIDViewport 22 | { 23 | Entity viewport_entity; 24 | }; 25 | 26 | } // namespace ui 27 | } // namespace lagrange -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/components/Selection.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | 15 | namespace lagrange { 16 | namespace ui { 17 | 18 | struct Selected 19 | { 20 | bool _dummy; 21 | }; 22 | 23 | struct Hovered 24 | { 25 | bool _dummy; 26 | }; 27 | 28 | 29 | } // namespace ui 30 | } // namespace lagrange -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/components/SelectionViewport.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | namespace lagrange { 18 | namespace ui { 19 | 20 | // Global compontent 21 | struct SelectionViewport 22 | { 23 | Entity viewport_entity; 24 | }; 25 | 26 | } // namespace ui 27 | } // namespace lagrange -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/components/TreeNode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | 16 | namespace lagrange { 17 | namespace ui { 18 | 19 | // Reference: 20 | //https://skypjack.github.io/2019-06-25-ecs-baf-part-4/ 21 | 22 | struct TreeNode 23 | { 24 | Entity parent = NullEntity; 25 | Entity first_child = NullEntity; 26 | Entity next_sibling = NullEntity; 27 | Entity prev_sibling = NullEntity; 28 | size_t num_children = 0; 29 | }; 30 | 31 | 32 | } // namespace ui 33 | } // namespace lagrange -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/default_ibls.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | namespace lagrange { 18 | namespace ui { 19 | 20 | /// 21 | /// Creates pre-packaged IBL 22 | /// 23 | /// 24 | /// Source: 25 | /// 26 | /// https://www.deviantart.com/zbyg/art/HDRi-Pack-1-97402522 27 | /// 28 | /// CC 3.0 License 29 | LA_UI_API IBL generate_default_ibl(size_t resolution = 256); 30 | 31 | } // namespace ui 32 | } // namespace lagrange 33 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/panels/ComponentPanel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | namespace lagrange { 18 | namespace ui { 19 | 20 | 21 | LA_UI_API Entity add_component_panel(Registry& r, const std::string& name = "Components"); 22 | 23 | 24 | } // namespace ui 25 | } // namespace lagrange 26 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/panels/KeybindsPanel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | namespace lagrange { 18 | namespace ui { 19 | 20 | LA_UI_API Entity add_keybinds_panel(Registry& r, const std::string& name = "Keybinds"); 21 | 22 | } // namespace ui 23 | } // namespace lagrange 24 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/panels/LoggerPanel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | namespace lagrange { 19 | namespace ui { 20 | 21 | LA_UI_API Entity add_logger_panel(Registry& r, const std::string& name = "Logger"); 22 | 23 | LA_UI_API std::shared_ptr get_logger_sink(Registry& r); 24 | 25 | } // namespace ui 26 | } // namespace lagrange 27 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/panels/RendererPanel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | namespace lagrange { 18 | namespace ui { 19 | 20 | LA_UI_API Entity add_renderer_panel(Registry& r, const std::string& name = "Renderer"); 21 | 22 | } // namespace ui 23 | } // namespace lagrange 24 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/panels/ToolbarPanel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | namespace lagrange { 18 | namespace ui { 19 | 20 | struct ToolbarPanel 21 | { 22 | static constexpr float toolbar_width = 45.0f; 23 | 24 | bool _dummy; 25 | }; 26 | 27 | 28 | LA_UI_API Entity add_toolbar_panel(Registry& r, const std::string& name = "Toolbar"); 29 | 30 | 31 | } // namespace ui 32 | } // namespace lagrange 33 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/systems/camera_turntable.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | namespace lagrange { 18 | namespace ui { 19 | 20 | 21 | } // namespace ui 22 | } // namespace lagrange 23 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/systems/render_background.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | namespace lagrange { 18 | namespace ui { 19 | 20 | 21 | LA_UI_API void render_background(Registry& registry); 22 | 23 | 24 | } // namespace ui 25 | } // namespace lagrange 26 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/systems/render_geometry.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | namespace lagrange { 18 | namespace ui { 19 | 20 | 21 | LA_UI_API void setup_vertex_data(Registry& registry); 22 | LA_UI_API void render_geometry(Registry& registry); 23 | 24 | 25 | // Todo move to its own file 26 | LA_UI_API void render_post_process(Registry& registry); 27 | 28 | } // namespace ui 29 | } // namespace lagrange 30 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/systems/render_shadowmaps.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | namespace lagrange { 18 | namespace ui { 19 | 20 | 21 | LA_UI_API void render_shadowmaps(Registry& registry); 22 | 23 | 24 | } // namespace ui 25 | } // namespace lagrange 26 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/systems/render_viewports.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | namespace lagrange { 18 | namespace ui { 19 | 20 | 21 | /// @brief Render viewport 22 | /// Renders all geometry visible in this viewport into the viewport's framebuffer 23 | LA_UI_API void render_viewport(Registry& registry, Entity e); 24 | 25 | 26 | /// @brief Render all enabled viewports 27 | /// @param registry 28 | LA_UI_API void render_viewports(Registry& registry); 29 | 30 | 31 | } // namespace ui 32 | } // namespace lagrange 33 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/systems/update_accelerated_picking.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | namespace lagrange { 18 | namespace ui { 19 | 20 | LA_UI_API void update_accelerated_picking(Registry& r); 21 | 22 | } // namespace ui 23 | } // namespace lagrange 24 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/systems/update_lights.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | namespace lagrange { 18 | namespace ui { 19 | 20 | 21 | /* 22 | Updates lights and their visualization 23 | */ 24 | LA_UI_API void update_lights_system(Registry& registry); 25 | 26 | 27 | } // namespace ui 28 | } // namespace lagrange 29 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/systems/update_mesh_bounds.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | namespace lagrange { 18 | namespace ui { 19 | 20 | 21 | /* 22 | Updates AABB of every entity having 23 | */ 24 | LA_UI_API void update_mesh_bounds_system(Registry& ctx); 25 | 26 | 27 | } // namespace ui 28 | } // namespace lagrange 29 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/systems/update_mesh_buffers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | namespace lagrange { 18 | namespace ui { 19 | 20 | /* 21 | Creates mesh buffers for 22 | Output: Resource component on MeshGeometry entity 23 | */ 24 | LA_UI_API void update_mesh_buffers_system(Registry& ctx); 25 | 26 | 27 | } // namespace ui 28 | } // namespace lagrange 29 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/systems/update_mesh_elements_hovered.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | namespace lagrange { 18 | namespace ui { 19 | 20 | LA_UI_API void update_mesh_elements_hovered(Registry& r); 21 | 22 | } // namespace ui 23 | } // namespace lagrange 24 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/systems/update_mesh_hovered.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | namespace lagrange { 18 | namespace ui { 19 | 20 | /// Sets component if the mesh is hovered a ViewportPanel. 21 | /// See SelectionContext and default_tools for details 22 | LA_UI_API void update_mesh_hovered(Registry& ctx); 23 | 24 | } // namespace ui 25 | } // namespace lagrange 26 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/systems/update_scene_bounds.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | namespace lagrange { 19 | namespace ui { 20 | 21 | 22 | /// Sets context variable 23 | LA_UI_API void update_scene_bounds_system(Registry& ctx); 24 | 25 | 26 | } // namespace ui 27 | } // namespace lagrange 28 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/systems/update_transform_hierarchy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | namespace lagrange { 18 | namespace ui { 19 | 20 | // Todo expose outside api callback 21 | LA_UI_API void update_transform_hierarchy(Registry& registry); 22 | 23 | } // namespace ui 24 | } // namespace lagrange 25 | -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/types/RayFacetHit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | namespace lagrange { 14 | namespace ui { 15 | 16 | struct RayFacetHit 17 | { 18 | int facet_id; 19 | float t; 20 | Eigen::Vector3f barycentric; 21 | }; 22 | 23 | 24 | } // namespace ui 25 | } // namespace lagrange -------------------------------------------------------------------------------- /modules/ui/include/lagrange/ui/utils/pair_hash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #pragma once 13 | 14 | #include 15 | 16 | namespace lagrange { 17 | namespace ui { 18 | 19 | namespace utils { 20 | 21 | 22 | struct pair_hash 23 | { 24 | template 25 | std::size_t operator()(const std::pair& key) const 26 | { 27 | return std::hash()(key.first) ^ 28 | std::hash()(key.second); 29 | } 30 | }; 31 | 32 | } // namespace utils 33 | 34 | } // namespace ui 35 | } // namespace lagrange 36 | -------------------------------------------------------------------------------- /modules/ui/src/adobe_mdl/annotations.mdl: -------------------------------------------------------------------------------- 1 | R"( 2 | mdl 1.3; 3 | 4 | export annotation shader_usage(string name); 5 | export annotation ui_position(int position); 6 | )" 7 | -------------------------------------------------------------------------------- /modules/ui/src/adobe_mdl/convert.mdl: -------------------------------------------------------------------------------- 1 | R"( 2 | mdl 1.3; 3 | 4 | import ::math::*; 5 | 6 | export float linear_to_srgb( uniform float v ) uniform { 7 | if (v <= 0.0031308) 8 | return v * 12.92; 9 | else 10 | return 1.055 * ::math::pow(v, 1.0 / 2.4) - 0.055; 11 | } 12 | 13 | export color linear_to_srgb( uniform float r, uniform float g, uniform float b ) uniform { 14 | return color( linear_to_srgb(r), linear_to_srgb(g), linear_to_srgb(b) ); 15 | } 16 | 17 | export float srgb_to_linear( uniform float v ) uniform { 18 | if (v <= 0.04045) 19 | return v / 12.92; 20 | else 21 | return ::math::pow((v + 0.055) / 1.055, 2.4); 22 | } 23 | 24 | export color srgb_to_linear( uniform float r, uniform float g, uniform float b ) uniform { 25 | return color( srgb_to_linear(r), srgb_to_linear(g), srgb_to_linear(b) ); 26 | } 27 | )" 28 | -------------------------------------------------------------------------------- /modules/ui/src/default_ibls.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #include 13 | #include 14 | #include 15 | 16 | 17 | #include "ibls/studio011.h" 18 | 19 | 20 | namespace lagrange { 21 | namespace ui { 22 | 23 | IBL generate_default_ibl(size_t resolution) 24 | { 25 | Texture::Params p = Texture::Params::rgb(); 26 | p.sRGB = false; 27 | auto ibl = 28 | generate_ibl(std::make_shared(ibl_studio011, ibl_studio011_len, p), resolution); 29 | ibl.blur = 2.0f; 30 | return ibl; 31 | } 32 | 33 | 34 | } // namespace ui 35 | } // namespace lagrange 36 | -------------------------------------------------------------------------------- /modules/ui/src/shaders/cubemap/to_cube.shader: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #include "uniforms/common.glsl" 13 | 14 | #pragma VERTEX 15 | #include "util/default.vertex" 16 | 17 | 18 | #pragma FRAGMENT 19 | #include "layout/default_fragment_layout.glsl" 20 | 21 | uniform sampler2D texRectangular; 22 | 23 | void main(){ 24 | 25 | vec3 p = normalize(vs_out_pos); 26 | 27 | vec2 UV = vec2(atan(p.z,p.x),asin(p.y)); 28 | UV *= vec2(0.1591,0.3183); 29 | UV += vec2(0.5); 30 | 31 | fragColor.xyz = texture(texRectangular, UV).rgb; 32 | 33 | } 34 | 35 | -------------------------------------------------------------------------------- /modules/ui/src/shaders/depth/to_texture.shader: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #include "uniforms/common.glsl" 13 | 14 | #pragma VERTEX 15 | #include "util/default.vertex" 16 | 17 | #pragma FRAGMENT 18 | #include "layout/default_fragment_layout.glsl" 19 | 20 | void main(){ 21 | 22 | } 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /modules/ui/src/shaders/layout/default_fragment_layout.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | layout(location = 0) out vec4 fragColor; 13 | 14 | /*in VARYING { 15 | vec3 pos; 16 | vec3 normal; 17 | vec2 uv; 18 | vec4 color; 19 | vec3 tangent; 20 | vec3 bitangent; 21 | } fs_in;*/ 22 | 23 | 24 | in vec3 vs_out_pos; 25 | in vec3 vs_out_normal; 26 | in vec2 vs_out_uv; 27 | in vec4 vs_out_color; 28 | in vec3 vs_out_tangent; 29 | in vec3 vs_out_bitangent; 30 | 31 | 32 | -------------------------------------------------------------------------------- /modules/ui/src/shaders/surface/flat.frag: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #include "layout/default_fragment_layout.glsl" 13 | 14 | void main(){ 15 | fragColor = fs_in.color; 16 | fragColor.a *= alpha_multiplier; 17 | } -------------------------------------------------------------------------------- /modules/ui/src/shaders/surface/objectid.shader: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #include "uniforms/common.glsl" 13 | 14 | #pragma VERTEX 15 | #include "util/default.vertex" 16 | 17 | #pragma FRAGMENT 18 | #include "layout/default_fragment_layout.glsl" 19 | 20 | vec4 index_to_color(int i){ 21 | int r = (i & 0x000000FF); 22 | int g = (i & 0x0000FF00) >> 8; 23 | int b = (i & 0x00FF0000) >> 16; 24 | return vec4(float(r) / 255.0, float(g) / 255.0, float(b) / 255.0, 1.0); 25 | } 26 | 27 | void main(){ 28 | fragColor = index_to_color(object_id); 29 | } 30 | -------------------------------------------------------------------------------- /modules/ui/src/shaders/surface/pbr.frag: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | 13 | #include "layout/default_fragment_layout.glsl" 14 | #include "util/pbr_shading.glsl" 15 | 16 | void main(){ 17 | fragColor = pbr(vs_out_pos, vs_out_normal, vs_out_uv, vs_out_color, vs_out_tangent, vs_out_bitangent); 18 | fragColor.a *= alpha_multiplier; 19 | } -------------------------------------------------------------------------------- /modules/ui/src/shaders/surface/simple.shader: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | #include "uniforms/common.glsl" 13 | 14 | #pragma VERTEX 15 | #include "util/default.vertex" 16 | 17 | #pragma FRAGMENT 18 | #include "layout/default_fragment_layout.glsl" 19 | 20 | #pragma property opacity "Opacity" float(1,0,1) 21 | 22 | void main(){ 23 | 24 | fragColor = vs_out_color; 25 | fragColor.a *= opacity; 26 | } 27 | -------------------------------------------------------------------------------- /modules/ui/src/shaders/surface/surface.shader: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | 13 | #include "uniforms/common.glsl" 14 | 15 | 16 | #pragma VERTEX 17 | #include "util/default.vertex" 18 | 19 | #pragma FRAGMENT 20 | 21 | #ifdef SHADING_FLAT 22 | #include "surface/flat.frag" 23 | #endif 24 | 25 | #ifdef SHADING_PHONG 26 | #include "surface/phong.frag" 27 | #endif 28 | 29 | #ifdef SHADING_PBR 30 | #include "surface/pbr.frag" 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /modules/ui/src/shaders/uniforms/common.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | 13 | /* 14 | Transformation / Projection 15 | */ 16 | 17 | //Global 18 | uniform mat4 PV; 19 | uniform vec3 cameraPos; 20 | uniform mat4 PVinv; 21 | 22 | //Model 23 | uniform mat4 M; 24 | uniform mat4 NMat; 25 | 26 | uniform int object_id; 27 | 28 | 29 | /* 30 | Target properties 31 | */ 32 | uniform vec2 screen_size; 33 | 34 | /* 35 | Compositing 36 | */ 37 | uniform float alpha_multiplier; -------------------------------------------------------------------------------- /modules/ui/src/shaders/uniforms/ibl.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | 13 | uniform samplerCube ibl_diffuse; 14 | uniform samplerCube ibl_specular; 15 | uniform sampler2D ibl_brdf_lut; 16 | 17 | 18 | uniform bool has_ibl; // System property 19 | #pragma property ibl_specular_levels "IBLSpecularLevels" int(1,1,16) 20 | 21 | 22 | -------------------------------------------------------------------------------- /modules/ui/src/shaders/util/multisample.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Adobe. All rights reserved. 3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. You may obtain a copy 5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * Unless required by applicable law or agreed to in writing, software distributed under 8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | * OF ANY KIND, either express or implied. See the License for the specific language 10 | * governing permissions and limitations under the License. 11 | */ 12 | 13 | #pragma property num_samples "MultisampleNumSamples" int(4,1,32) 14 | 15 | vec4 multisample(sampler2DMS s, vec2 uv) 16 | { 17 | ivec2 texel = ivec2(floor(textureSize(s) * uv)); 18 | 19 | vec4 color = vec4(0.0); 20 | for (int i = 0; i < num_samples; i++) 21 | { 22 | color += texelFetch(s, texel, i); 23 | } 24 | 25 | color /= float(num_samples); 26 | 27 | return color; 28 | } 29 | -------------------------------------------------------------------------------- /modules/ui/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_test(CUSTOM_MAIN) 13 | 14 | if(LAGRANGE_UI_OPENGL_TESTS) 15 | target_compile_definitions(test_lagrange_ui PRIVATE LAGRANGE_UI_OPENGL_TESTS) 16 | endif() 17 | -------------------------------------------------------------------------------- /modules/ui/ui.md: -------------------------------------------------------------------------------- 1 | UI Module 2 | ============ 3 | 4 | @namespace lagrange::ui 5 | @brief Lagrange UI Viewer and mini 3D engine 6 | 7 | @defgroup module-ui UI Module 8 | @brief Lagrange UI Viewer and mini 3D engine 9 | -------------------------------------------------------------------------------- /modules/volume/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2021 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | # 1. define module 13 | lagrange_add_module(NO_INSTALL) 14 | 15 | # 2. dependencies 16 | lagrange_include_modules(core winding) 17 | lagrange_find_package(OpenVDB CONFIG REQUIRED GLOBAL COMPONENTS openvdb) 18 | target_link_libraries(lagrange_volume PUBLIC 19 | lagrange::core 20 | lagrange::winding 21 | OpenVDB::openvdb 22 | ) 23 | 24 | # 3. unit tests and examples 25 | if(LAGRANGE_UNIT_TESTS) 26 | add_subdirectory(tests) 27 | endif() 28 | 29 | if(LAGRANGE_EXAMPLES) 30 | add_subdirectory(examples) 31 | endif() 32 | -------------------------------------------------------------------------------- /modules/volume/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2021 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | include(cli11) 13 | lagrange_include_modules(io) 14 | 15 | lagrange_add_example(voxelize_mesh voxelize_mesh.cpp) 16 | target_link_libraries(voxelize_mesh lagrange::volume lagrange::io CLI11::CLI11) 17 | 18 | lagrange_add_example(fill_with_spheres fill_with_spheres.cpp) 19 | target_link_libraries(fill_with_spheres lagrange::volume lagrange::io CLI11::CLI11) 20 | -------------------------------------------------------------------------------- /modules/volume/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2021 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_test() 13 | -------------------------------------------------------------------------------- /modules/winding/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | # 1. define module 13 | lagrange_add_module(NO_INSTALL) 14 | 15 | # 2. dependencies 16 | lagrange_include_modules(core) 17 | include(winding_number) 18 | target_link_libraries(lagrange_winding 19 | PUBLIC 20 | lagrange::core 21 | PRIVATE 22 | WindingNumber::WindingNumber 23 | ) 24 | 25 | # 3. unit tests and examples 26 | if(LAGRANGE_UNIT_TESTS) 27 | add_subdirectory(tests) 28 | endif() 29 | 30 | if(LAGRANGE_EXAMPLES) 31 | add_subdirectory(examples) 32 | endif() 33 | -------------------------------------------------------------------------------- /modules/winding/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | include(cli11) 13 | include(nlohmann_json) 14 | lagrange_include_modules(io) 15 | 16 | lagrange_add_example(sample_points_in_mesh sample_points_in_mesh.cpp) 17 | target_link_libraries(sample_points_in_mesh lagrange::winding lagrange::io CLI11::CLI11) 18 | 19 | lagrange_add_example(fix_orientation fix_orientation.cpp) 20 | target_link_libraries(fix_orientation lagrange::winding nlohmann_json::nlohmann_json lagrange::io CLI11::CLI11) 21 | -------------------------------------------------------------------------------- /modules/winding/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023 Adobe. All rights reserved. 3 | # This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. You may obtain a copy 5 | # of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software distributed under 8 | # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | # OF ANY KIND, either express or implied. See the License for the specific language 10 | # governing permissions and limitations under the License. 11 | # 12 | lagrange_add_test() 13 | target_link_libraries(test_lagrange_winding PUBLIC WindingNumber::WindingNumber) 14 | --------------------------------------------------------------------------------