├── .clang-format ├── .clang-tidy ├── .gitattributes ├── .github ├── FUNDING.yml └── workflows │ ├── deploy.yml │ ├── manual_release.yml │ ├── merge_request.yml │ ├── pr_update.yml │ ├── prepare_deploy.yml │ ├── schedule.yml │ ├── test.yml │ └── test_pr.yml ├── .gitignore ├── .releaserc ├── .vscode └── settings.json ├── .zenodo.json ├── CMakeLists.txt ├── COPYLEFT ├── LICENSE ├── README.md ├── bindings └── python │ ├── CMakeLists.txt │ ├── basic.py │ ├── geometry.py │ ├── image.py │ ├── mesh.py │ ├── model.py │ ├── requirements.in │ ├── src │ ├── CMakeLists.txt │ ├── basic │ │ ├── CMakeLists.txt │ │ ├── attribute.cpp │ │ ├── attribute_manager.cpp │ │ ├── basic.cpp │ │ ├── cell_array.cpp │ │ ├── factory.hpp │ │ ├── identifier.cpp │ │ ├── identifier_builder.cpp │ │ ├── input.hpp │ │ ├── mapping.cpp │ │ └── uuid.cpp │ ├── common.hpp │ ├── geometry │ │ ├── CMakeLists.txt │ │ ├── angle.cpp │ │ ├── barycentric_coordinates.cpp │ │ ├── basic_objects.cpp │ │ ├── bounding_box.cpp │ │ ├── coordinate_system.cpp │ │ ├── distance.cpp │ │ ├── frame.cpp │ │ ├── geometry.cpp │ │ ├── intersection.cpp │ │ ├── intersection_detection.cpp │ │ ├── mensuration.cpp │ │ ├── nn_search.cpp │ │ ├── perpendicular.cpp │ │ ├── point.cpp │ │ ├── points_sort.cpp │ │ ├── position.cpp │ │ ├── projection.cpp │ │ ├── rotation.cpp │ │ ├── sign.cpp │ │ └── vector.cpp │ ├── image │ │ ├── CMakeLists.txt │ │ ├── core │ │ │ ├── greyscale_color.cpp │ │ │ ├── raster_image.cpp │ │ │ └── rgb_color.cpp │ │ ├── image.cpp │ │ └── io │ │ │ └── raster_image.cpp │ ├── mesh │ │ ├── CMakeLists.txt │ │ ├── builder │ │ │ ├── crs_manager_builder.cpp │ │ │ ├── crs_managers_builder.cpp │ │ │ ├── edged_curve_builder.cpp │ │ │ ├── graph_builder.cpp │ │ │ ├── hybrid_solid_builder.cpp │ │ │ ├── point_set_builder.cpp │ │ │ ├── polygonal_surface_builder.cpp │ │ │ ├── polyhedral_solid_builder.cpp │ │ │ ├── regular_grid_builder.cpp │ │ │ ├── solid_edges_builder.cpp │ │ │ ├── solid_facets_builder.cpp │ │ │ ├── solid_mesh_builder.cpp │ │ │ ├── surface_edges_builder.cpp │ │ │ ├── surface_mesh_builder.cpp │ │ │ ├── tetrahedral_solid_builder.cpp │ │ │ ├── triangulated_surface_builder.cpp │ │ │ └── vertex_set_builder.cpp │ │ ├── core │ │ │ ├── crs.cpp │ │ │ ├── crs_manager.cpp │ │ │ ├── crs_managers.cpp │ │ │ ├── edged_curve.cpp │ │ │ ├── graph.cpp │ │ │ ├── grid.cpp │ │ │ ├── hybrid_solid.cpp │ │ │ ├── light_regular_grid.cpp │ │ │ ├── point_set.cpp │ │ │ ├── polygonal_surface.cpp │ │ │ ├── polyhedral_solid.cpp │ │ │ ├── regular_grid.cpp │ │ │ ├── solid_edges.cpp │ │ │ ├── solid_facets.cpp │ │ │ ├── solid_mesh.cpp │ │ │ ├── surface_edges.cpp │ │ │ ├── surface_mesh.cpp │ │ │ ├── tetrahedral_solid.cpp │ │ │ ├── texture.cpp │ │ │ ├── texture_manager.cpp │ │ │ ├── triangulated_surface.cpp │ │ │ └── vertex_set.cpp │ │ ├── helpers │ │ │ ├── convert_edged_curve.cpp │ │ │ ├── convert_point_set.cpp │ │ │ ├── convert_solid_mesh.cpp │ │ │ ├── convert_surface_mesh.cpp │ │ │ ├── crs_helper.cpp │ │ │ ├── euclidean_distance_transform.cpp │ │ │ ├── geometrical_operations_on_mesh.cpp │ │ │ ├── gradient_computation.cpp │ │ │ ├── rasterize.cpp │ │ │ └── repair_polygon_orientations.cpp │ │ ├── io │ │ │ ├── edged_curve.cpp │ │ │ ├── graph.cpp │ │ │ ├── hybrid_solid.cpp │ │ │ ├── light_regular_grid.cpp │ │ │ ├── point_set.cpp │ │ │ ├── polygonal_surface.cpp │ │ │ ├── polyhedral_solid.cpp │ │ │ ├── regular_grid.cpp │ │ │ ├── tetrahedral_solid.cpp │ │ │ ├── triangulated_surface.cpp │ │ │ └── vertex_set.cpp │ │ └── mesh.cpp │ └── model │ │ ├── CMakeLists.txt │ │ ├── helpers │ │ ├── component_mesh_polygons.cpp │ │ ├── convert_brep_section.cpp │ │ ├── convert_model_meshes.cpp │ │ ├── convert_to_mesh.cpp │ │ ├── model_component_filter.cpp │ │ ├── model_concatener.cpp │ │ ├── model_crs.cpp │ │ └── ray_tracing.cpp │ │ ├── mixin │ │ ├── builder │ │ │ ├── block_collections_builder.cpp │ │ │ ├── blocks_builder.cpp │ │ │ ├── component_registry_builder.cpp │ │ │ ├── corner_collections_builder.cpp │ │ │ ├── corners_builder.cpp │ │ │ ├── line_collections_builder.cpp │ │ │ ├── lines_builder.cpp │ │ │ ├── model_boundaries_builder.cpp │ │ │ ├── relationships_builder.cpp │ │ │ ├── surface_collections_builder.cpp │ │ │ ├── surfaces_builder.cpp │ │ │ ├── topology_builder.cpp │ │ │ └── vertex_identifier_builder.cpp │ │ └── core │ │ │ ├── block.cpp │ │ │ ├── block_collection.cpp │ │ │ ├── block_collections.cpp │ │ │ ├── blocks.cpp │ │ │ ├── component.cpp │ │ │ ├── component_mesh_element.cpp │ │ │ ├── component_registry.cpp │ │ │ ├── component_type.cpp │ │ │ ├── corner.cpp │ │ │ ├── corner_collection.cpp │ │ │ ├── corner_collections.cpp │ │ │ ├── corners.cpp │ │ │ ├── line.cpp │ │ │ ├── line_collection.cpp │ │ │ ├── line_collections.cpp │ │ │ ├── lines.cpp │ │ │ ├── model_boundaries.cpp │ │ │ ├── model_boundary.cpp │ │ │ ├── relationships.cpp │ │ │ ├── surface.cpp │ │ │ ├── surface_collection.cpp │ │ │ ├── surface_collections.cpp │ │ │ ├── surfaces.cpp │ │ │ ├── topology.cpp │ │ │ └── vertex_identifier.cpp │ │ ├── model.cpp │ │ └── representation │ │ ├── builder │ │ ├── brep_builder.cpp │ │ └── section_builder.cpp │ │ ├── core │ │ ├── brep.cpp │ │ ├── mapping.cpp │ │ └── section.cpp │ │ └── io │ │ ├── brep.cpp │ │ └── section.cpp │ └── tests │ ├── CMakeLists.txt │ ├── basic │ ├── CMakeLists.txt │ ├── test-py-attribute.py │ └── test-py-uuid.py │ ├── geometry │ ├── CMakeLists.txt │ ├── test-py-angle.py │ ├── test-py-barycentric-coordinates.py │ ├── test-py-bounding-box.py │ ├── test-py-distance.py │ ├── test-py-intersection-detection.py │ ├── test-py-intersection.py │ ├── test-py-mensuration.py │ ├── test-py-nnsearch.py │ ├── test-py-perpendicular.py │ ├── test-py-point.py │ ├── test-py-points_sort.py │ ├── test-py-position.py │ ├── test-py-projection.py │ ├── test-py-rotation.py │ ├── test-py-sign.py │ └── test-py-vector.py │ ├── image │ ├── CMakeLists.txt │ ├── test-py-colors.py │ └── test-py-raster-image.py │ ├── mesh │ ├── CMakeLists.txt │ ├── test-py-edged-curve.py │ ├── test-py-euclidean-distance-transform.py │ ├── test-py-geometrical-opeations-on-mesh.py │ ├── test-py-gradient-computation.py │ ├── test-py-graph.py │ ├── test-py-light-regular-grid.py │ ├── test-py-point-set.py │ ├── test-py-polygonal-surface.py │ ├── test-py-polyhedral-solid.py │ ├── test-py-regular-grid.py │ ├── test-py-tetrahedral-solid.py │ ├── test-py-triangulated-surface.py │ └── test-py-vertex-set.py │ └── model │ ├── CMakeLists.txt │ ├── test-py-brep.py │ ├── test-py-component-mesh-polygons.py │ ├── test-py-convert-brep.py │ ├── test-py-convert-model-meshes.py │ ├── test-py-convert-to-mesh.py │ ├── test-py-model-component-filter.py │ ├── test-py-model-concatener.py │ ├── test-py-model-crs.py │ └── test-py-section.py ├── cmake ├── CompilerWarnings.cmake ├── ConfigureAbseil.cmake ├── ConfigureAsync++.cmake ├── ConfigureBitsery.cmake ├── ConfigureEarcut.cmake ├── ConfigureGDAL.cmake ├── ConfigureMinizip.cmake ├── ConfigureNanoflann.cmake ├── ConfigureOpenGeode.cmake ├── ConfigurePROJ.cmake ├── ConfigurePybind11.cmake ├── ConfigureSQLite.cmake ├── ConfigureSpdlog.cmake ├── CppTargets.cmake ├── Doxyfile.in ├── GlobalOptions.cmake ├── OpenGeode.cmake ├── OpenGeodeConfig.cmake.in ├── ProjectOptions.cmake ├── PythonTargets.cmake ├── Sanitizers.cmake ├── SuperBuild.cmake ├── pyproject.toml.in ├── setup.py.in └── version.rc.in ├── examples ├── images │ └── layers.png └── layer_cake.ipynb ├── include └── geode │ ├── basic │ ├── algorithm.hpp │ ├── assert.hpp │ ├── attribute.hpp │ ├── attribute_manager.hpp │ ├── attribute_utils.hpp │ ├── bitsery_archive.hpp │ ├── bitsery_attribute.hpp │ ├── cached_value.hpp │ ├── cell_array.hpp │ ├── chronometer.hpp │ ├── common.hpp │ ├── console_logger_client.hpp │ ├── console_progress_logger_client.hpp │ ├── constant_attribute.hpp │ ├── detail │ │ ├── bitsery_archive.hpp │ │ ├── count_range_elements.hpp │ │ ├── disable_debug_logger.hpp │ │ ├── enable_debug_logger.hpp │ │ ├── geode_input_impl.hpp │ │ ├── geode_output_impl.hpp │ │ └── mapping_after_deletion.hpp │ ├── factory.hpp │ ├── file.hpp │ ├── filename.hpp │ ├── growable.hpp │ ├── identifier.hpp │ ├── identifier_builder.hpp │ ├── input.hpp │ ├── internal │ │ └── array_impl.hpp │ ├── io.hpp │ ├── library.hpp │ ├── logger.hpp │ ├── logger_client.hpp │ ├── logger_manager.hpp │ ├── mapping.hpp │ ├── named_type.hpp │ ├── output.hpp │ ├── passkey.hpp │ ├── permutation.hpp │ ├── pimpl.hpp │ ├── pimpl_impl.hpp │ ├── progress_logger.hpp │ ├── progress_logger_client.hpp │ ├── progress_logger_manager.hpp │ ├── range.hpp │ ├── singleton.hpp │ ├── small_set.hpp │ ├── sparse_attribute.hpp │ ├── string.hpp │ ├── timer.hpp │ ├── types.hpp │ ├── uuid.hpp │ ├── variable_attribute.hpp │ └── zip_file.hpp │ ├── geometry │ ├── aabb.hpp │ ├── angle.hpp │ ├── barycentric_coordinates.hpp │ ├── basic_objects │ │ ├── circle.hpp │ │ ├── cylinder.hpp │ │ ├── ellipse.hpp │ │ ├── infinite_line.hpp │ │ ├── plane.hpp │ │ ├── polygon.hpp │ │ ├── segment.hpp │ │ ├── sphere.hpp │ │ ├── tetrahedron.hpp │ │ └── triangle.hpp │ ├── bitsery_archive.hpp │ ├── bounding_box.hpp │ ├── common.hpp │ ├── coordinate_system.hpp │ ├── detail │ │ ├── aabb_impl.hpp │ │ ├── bitsery_archive.hpp │ │ └── point_operators.hpp │ ├── distance.hpp │ ├── dynamic_nn_search.hpp │ ├── frame.hpp │ ├── frame_transform.hpp │ ├── information.hpp │ ├── internal │ │ ├── intersection_from_sides.hpp │ │ ├── position_from_sides.hpp │ │ └── predicates.hpp │ ├── intersection.hpp │ ├── intersection_detection.hpp │ ├── mensuration.hpp │ ├── nn_search.hpp │ ├── normal_frame_transform.hpp │ ├── perpendicular.hpp │ ├── point.hpp │ ├── points_sort.hpp │ ├── position.hpp │ ├── projection.hpp │ ├── quality.hpp │ ├── radial_sort.hpp │ ├── rotation.hpp │ ├── sign.hpp │ ├── square_matrix.hpp │ └── vector.hpp │ ├── image │ ├── common.hpp │ ├── core │ │ ├── bitsery_archive.hpp │ │ ├── greyscale_color.hpp │ │ ├── raster_image.hpp │ │ └── rgb_color.hpp │ └── io │ │ ├── geode │ │ ├── geode_bitsery_raster_input.hpp │ │ └── geode_bitsery_raster_output.hpp │ │ ├── raster_image_input.hpp │ │ └── raster_image_output.hpp │ ├── mesh │ ├── builder │ │ ├── coordinate_reference_system_manager_builder.hpp │ │ ├── coordinate_reference_system_managers_builder.hpp │ │ ├── edged_curve_builder.hpp │ │ ├── geode │ │ │ ├── geode_edged_curve_builder.hpp │ │ │ ├── geode_graph_builder.hpp │ │ │ ├── geode_hybrid_solid_builder.hpp │ │ │ ├── geode_point_set_builder.hpp │ │ │ ├── geode_polygonal_surface_builder.hpp │ │ │ ├── geode_polyhedral_solid_builder.hpp │ │ │ ├── geode_regular_grid_solid_builder.hpp │ │ │ ├── geode_regular_grid_surface_builder.hpp │ │ │ ├── geode_tetrahedral_solid_builder.hpp │ │ │ ├── geode_triangulated_surface_builder.hpp │ │ │ ├── geode_vertex_set_builder.hpp │ │ │ └── register_builder.hpp │ │ ├── graph_builder.hpp │ │ ├── grid_builder.hpp │ │ ├── hybrid_solid_builder.hpp │ │ ├── mesh_builder_factory.hpp │ │ ├── point_set_builder.hpp │ │ ├── polygonal_surface_builder.hpp │ │ ├── polyhedral_solid_builder.hpp │ │ ├── regular_grid_solid_builder.hpp │ │ ├── regular_grid_surface_builder.hpp │ │ ├── solid_edges_builder.hpp │ │ ├── solid_facets_builder.hpp │ │ ├── solid_mesh_builder.hpp │ │ ├── surface_edges_builder.hpp │ │ ├── surface_mesh_builder.hpp │ │ ├── tetrahedral_solid_builder.hpp │ │ ├── triangulated_surface_builder.hpp │ │ └── vertex_set_builder.hpp │ ├── common.hpp │ ├── core │ │ ├── attribute_coordinate_reference_system.hpp │ │ ├── bitsery_archive.hpp │ │ ├── coordinate_reference_system.hpp │ │ ├── coordinate_reference_system_manager.hpp │ │ ├── coordinate_reference_system_managers.hpp │ │ ├── detail │ │ │ ├── facet_storage.hpp │ │ │ ├── geode_elements.hpp │ │ │ └── vertex_cycle.hpp │ │ ├── edged_curve.hpp │ │ ├── geode │ │ │ ├── geode_edged_curve.hpp │ │ │ ├── geode_graph.hpp │ │ │ ├── geode_hybrid_solid.hpp │ │ │ ├── geode_point_set.hpp │ │ │ ├── geode_polygonal_surface.hpp │ │ │ ├── geode_polyhedral_solid.hpp │ │ │ ├── geode_regular_grid_solid.hpp │ │ │ ├── geode_regular_grid_surface.hpp │ │ │ ├── geode_tetrahedral_solid.hpp │ │ │ ├── geode_triangulated_surface.hpp │ │ │ ├── geode_vertex_set.hpp │ │ │ └── register_mesh.hpp │ │ ├── graph.hpp │ │ ├── grid.hpp │ │ ├── hybrid_solid.hpp │ │ ├── internal │ │ │ ├── edges_impl.hpp │ │ │ ├── facet_edges_impl.hpp │ │ │ ├── grid_impl.hpp │ │ │ ├── points_impl.hpp │ │ │ ├── solid_mesh_impl.hpp │ │ │ ├── surface_mesh_impl.hpp │ │ │ └── texture_impl.hpp │ │ ├── light_regular_grid.hpp │ │ ├── mesh_element.hpp │ │ ├── mesh_factory.hpp │ │ ├── mesh_id.hpp │ │ ├── meshes_mapping.hpp │ │ ├── point_set.hpp │ │ ├── polygonal_surface.hpp │ │ ├── polyhedral_solid.hpp │ │ ├── regular_grid_solid.hpp │ │ ├── regular_grid_surface.hpp │ │ ├── solid_edges.hpp │ │ ├── solid_facets.hpp │ │ ├── solid_mesh.hpp │ │ ├── surface_edges.hpp │ │ ├── surface_mesh.hpp │ │ ├── tetrahedral_solid.hpp │ │ ├── texture1d.hpp │ │ ├── texture2d.hpp │ │ ├── texture3d.hpp │ │ ├── texture_manager.hpp │ │ ├── texture_storage.hpp │ │ ├── triangulated_surface.hpp │ │ └── vertex_set.hpp │ ├── helpers │ │ ├── aabb_edged_curve_helpers.hpp │ │ ├── aabb_solid_helpers.hpp │ │ ├── aabb_surface_helpers.hpp │ │ ├── build_grid.hpp │ │ ├── convert_edged_curve.hpp │ │ ├── convert_point_set.hpp │ │ ├── convert_solid_mesh.hpp │ │ ├── convert_surface_mesh.hpp │ │ ├── create_coordinate_system.hpp │ │ ├── detail │ │ │ ├── component_identifier.hpp │ │ │ ├── create_mesh.hpp │ │ │ ├── curve_merger.hpp │ │ │ ├── debug.hpp │ │ │ ├── element_identifier.hpp │ │ │ ├── mesh_intersection_detection.hpp │ │ │ ├── point_set_merger.hpp │ │ │ ├── solid_merger.hpp │ │ │ ├── split_along_solid_facets.hpp │ │ │ ├── surface_merger.hpp │ │ │ └── vertex_merger.hpp │ │ ├── euclidean_distance_transform.hpp │ │ ├── generic_edged_curve_accessor.hpp │ │ ├── generic_grid_accessor.hpp │ │ ├── generic_solid_accessor.hpp │ │ ├── generic_surface_accessor.hpp │ │ ├── geometrical_operations_on_mesh.hpp │ │ ├── gradient_computation.hpp │ │ ├── grid_point_function.hpp │ │ ├── grid_scalar_function.hpp │ │ ├── hausdorff_distance.hpp │ │ ├── internal │ │ │ ├── copy.hpp │ │ │ └── grid_shape_function.hpp │ │ ├── nnsearch_mesh.hpp │ │ ├── rasterize.hpp │ │ ├── ray_tracing.hpp │ │ ├── remove_vertex_duplication.hpp │ │ ├── repair_polygon_orientations.hpp │ │ ├── tetrahedral_solid_point_function.hpp │ │ ├── tetrahedral_solid_scalar_function.hpp │ │ ├── triangulated_surface_point_function.hpp │ │ └── triangulated_surface_scalar_function.hpp │ └── io │ │ ├── edged_curve_input.hpp │ │ ├── edged_curve_output.hpp │ │ ├── geode │ │ ├── geode_bitsery_mesh_input.hpp │ │ ├── geode_bitsery_mesh_output.hpp │ │ ├── geode_edged_curve_input.hpp │ │ ├── geode_edged_curve_output.hpp │ │ ├── geode_graph_input.hpp │ │ ├── geode_graph_output.hpp │ │ ├── geode_hybrid_solid_input.hpp │ │ ├── geode_hybrid_solid_output.hpp │ │ ├── geode_point_set_input.hpp │ │ ├── geode_point_set_output.hpp │ │ ├── geode_polygonal_surface_input.hpp │ │ ├── geode_polygonal_surface_output.hpp │ │ ├── geode_polyhedral_solid_input.hpp │ │ ├── geode_polyhedral_solid_output.hpp │ │ ├── geode_regular_grid_input.hpp │ │ ├── geode_regular_grid_output.hpp │ │ ├── geode_tetrahedral_solid_input.hpp │ │ ├── geode_tetrahedral_solid_output.hpp │ │ ├── geode_triangulated_surface_input.hpp │ │ ├── geode_triangulated_surface_output.hpp │ │ ├── geode_vertex_set_input.hpp │ │ ├── geode_vertex_set_output.hpp │ │ ├── register_input.hpp │ │ └── register_output.hpp │ │ ├── graph_input.hpp │ │ ├── graph_output.hpp │ │ ├── hybrid_solid_input.hpp │ │ ├── hybrid_solid_output.hpp │ │ ├── light_regular_grid_input.hpp │ │ ├── light_regular_grid_output.hpp │ │ ├── point_set_input.hpp │ │ ├── point_set_output.hpp │ │ ├── polygonal_surface_input.hpp │ │ ├── polygonal_surface_output.hpp │ │ ├── polyhedral_solid_input.hpp │ │ ├── polyhedral_solid_output.hpp │ │ ├── regular_grid_input.hpp │ │ ├── regular_grid_output.hpp │ │ ├── tetrahedral_solid_input.hpp │ │ ├── tetrahedral_solid_output.hpp │ │ ├── triangulated_surface_input.hpp │ │ ├── triangulated_surface_output.hpp │ │ ├── vertex_set_input.hpp │ │ └── vertex_set_output.hpp │ └── model │ ├── common.hpp │ ├── helpers │ ├── aabb_model_helpers.hpp │ ├── component_mensurations.hpp │ ├── component_mesh_edges.hpp │ ├── component_mesh_polygons.hpp │ ├── component_mesh_polyhedra.hpp │ ├── component_mesh_vertices.hpp │ ├── convert_brep_section.hpp │ ├── convert_model_meshes.hpp │ ├── convert_to_mesh.hpp │ ├── create_coordinate_system.hpp │ ├── detail │ │ ├── build_model_boundaries.hpp │ │ ├── mappings_merger.hpp │ │ ├── split_along_block_mesh_borders.hpp │ │ ├── split_along_surface_mesh_borders.hpp │ │ └── surface_mesh_validity_fix.hpp │ ├── internal │ │ └── simplicial_model_creator.hpp │ ├── model_component_filter.hpp │ ├── model_concatener.hpp │ ├── model_coordinate_reference_system.hpp │ ├── ray_tracing.hpp │ ├── simplicial_brep_creator.hpp │ ├── simplicial_creator_definitions.hpp │ ├── simplicial_section_creator.hpp │ └── surface_radial_sort.hpp │ ├── mixin │ ├── builder │ │ ├── block_collections_builder.hpp │ │ ├── blocks_builder.hpp │ │ ├── component_registry_builder.hpp │ │ ├── corner_collections_builder.hpp │ │ ├── corners_builder.hpp │ │ ├── line_collections_builder.hpp │ │ ├── lines_builder.hpp │ │ ├── model_boundaries_builder.hpp │ │ ├── relationships_builder.hpp │ │ ├── surface_collections_builder.hpp │ │ ├── surfaces_builder.hpp │ │ ├── topology_builder.hpp │ │ └── vertex_identifier_builder.hpp │ └── core │ │ ├── bitsery_archive.hpp │ │ ├── block.hpp │ │ ├── block_collection.hpp │ │ ├── block_collections.hpp │ │ ├── blocks.hpp │ │ ├── component.hpp │ │ ├── component_mesh_element.hpp │ │ ├── component_registry.hpp │ │ ├── component_type.hpp │ │ ├── corner.hpp │ │ ├── corner_collection.hpp │ │ ├── corner_collections.hpp │ │ ├── corners.hpp │ │ ├── detail │ │ ├── bitsery_archive.hpp │ │ ├── components_storage.hpp │ │ ├── mesh_storage.hpp │ │ ├── relationships_impl.hpp │ │ └── uuid_to_index.hpp │ │ ├── line.hpp │ │ ├── line_collection.hpp │ │ ├── line_collections.hpp │ │ ├── lines.hpp │ │ ├── model_boundaries.hpp │ │ ├── model_boundary.hpp │ │ ├── relationships.hpp │ │ ├── surface.hpp │ │ ├── surface_collection.hpp │ │ ├── surface_collections.hpp │ │ ├── surfaces.hpp │ │ ├── topology.hpp │ │ └── vertex_identifier.hpp │ └── representation │ ├── builder │ ├── brep_builder.hpp │ ├── detail │ │ ├── copy.hpp │ │ ├── filter.hpp │ │ └── register.hpp │ └── section_builder.hpp │ ├── core │ ├── brep.hpp │ ├── detail │ │ ├── clone.hpp │ │ ├── transfer_collections.hpp │ │ └── transfer_metadata.hpp │ ├── internal │ │ └── helpers.hpp │ ├── mapping.hpp │ └── section.hpp │ └── io │ ├── brep_input.hpp │ ├── brep_output.hpp │ ├── geode │ ├── geode_brep_input.hpp │ ├── geode_brep_output.hpp │ ├── geode_section_input.hpp │ └── geode_section_output.hpp │ ├── section_input.hpp │ └── section_output.hpp ├── log ├── src └── geode │ ├── CMakeLists.txt │ ├── basic │ ├── CMakeLists.txt │ ├── assert.cpp │ ├── attribute_manager.cpp │ ├── bitsery_archive.cpp │ ├── bitsery_input.cpp │ ├── bitsery_output.cpp │ ├── cell_array.cpp │ ├── chronometer.cpp │ ├── common.cpp │ ├── console_logger_client.cpp │ ├── console_progress_logger_client.cpp │ ├── file.cpp │ ├── filename.cpp │ ├── identifier.cpp │ ├── identifier_builder.cpp │ ├── library.cpp │ ├── logger.cpp │ ├── logger_manager.cpp │ ├── permutation.cpp │ ├── progress_logger.cpp │ ├── progress_logger_manager.cpp │ ├── singleton.cpp │ ├── string.cpp │ ├── timer.cpp │ ├── uuid.cpp │ └── zip_file.cpp │ ├── geometry │ ├── CMakeLists.txt │ ├── aabb.cpp │ ├── angle.cpp │ ├── barycentric_coordinates.cpp │ ├── basic_objects │ │ ├── circle.cpp │ │ ├── cylinder.cpp │ │ ├── ellipse.cpp │ │ ├── infinite_line.cpp │ │ ├── plane.cpp │ │ ├── polygon.cpp │ │ ├── segment.cpp │ │ ├── sphere.cpp │ │ ├── tetrahedron.cpp │ │ └── triangle.cpp │ ├── bitsery_input.cpp │ ├── bitsery_output.cpp │ ├── bounding_box.cpp │ ├── common.cpp │ ├── coordinate_system.cpp │ ├── distance.cpp │ ├── dynamic_nn_search.cpp │ ├── frame.cpp │ ├── frame_transform.cpp │ ├── information.cpp │ ├── internal │ │ └── predicates.cpp │ ├── intersection.cpp │ ├── intersection_detection.cpp │ ├── mensuration.cpp │ ├── nn_search.cpp │ ├── normal_frame_transform.cpp │ ├── perpendicular.cpp │ ├── point.cpp │ ├── points_sort.cpp │ ├── position.cpp │ ├── projection.cpp │ ├── quality.cpp │ ├── radial_sort.cpp │ ├── rotation.cpp │ ├── sign.cpp │ └── square_matrix.cpp │ ├── image │ ├── CMakeLists.txt │ ├── common.cpp │ ├── core │ │ ├── bitsery_archive.cpp │ │ ├── greyscale_color.cpp │ │ ├── raster_image.cpp │ │ └── rgb_color.cpp │ └── io │ │ ├── raster_image_input.cpp │ │ └── raster_image_output.cpp │ ├── mesh │ ├── CMakeLists.txt │ ├── builder │ │ ├── coordinate_reference_system_manager_builder.cpp │ │ ├── coordinate_reference_system_managers_builder.cpp │ │ ├── edged_curve_builder.cpp │ │ ├── geode │ │ │ ├── geode_edged_curve_builder.cpp │ │ │ ├── geode_graph_builder.cpp │ │ │ ├── geode_hybrid_solid_builder.cpp │ │ │ ├── geode_point_set_builder.cpp │ │ │ ├── geode_polygonal_surface_builder.cpp │ │ │ ├── geode_polyhedral_solid_builder.cpp │ │ │ ├── geode_regular_grid_solid_builder.cpp │ │ │ ├── geode_regular_grid_surface_builder.cpp │ │ │ ├── geode_tetrahedral_solid_builder.cpp │ │ │ ├── geode_triangulated_surface_builder.cpp │ │ │ └── geode_vertex_set_builder.cpp │ │ ├── graph_builder.cpp │ │ ├── grid_builder.cpp │ │ ├── hybrid_solid_builder.cpp │ │ ├── point_set_builder.cpp │ │ ├── polygonal_surface_builder.cpp │ │ ├── polyhedral_solid_builder.cpp │ │ ├── register_builder.cpp │ │ ├── regular_grid_solid_builder.cpp │ │ ├── regular_grid_surface_builder.cpp │ │ ├── solid_edges_builder.cpp │ │ ├── solid_facets_builder.cpp │ │ ├── solid_mesh_builder.cpp │ │ ├── surface_edges_builder.cpp │ │ ├── surface_mesh_builder.cpp │ │ ├── tetrahedral_solid_builder.cpp │ │ ├── triangulated_surface_builder.cpp │ │ └── vertex_set_builder.cpp │ ├── common.cpp │ ├── core │ │ ├── attribute_coordinate_reference_system.cpp │ │ ├── bitsery_archive.cpp │ │ ├── coordinate_reference_system.cpp │ │ ├── coordinate_reference_system_manager.cpp │ │ ├── coordinate_reference_system_managers.cpp │ │ ├── edged_curve.cpp │ │ ├── geode │ │ │ ├── geode_edged_curve.cpp │ │ │ ├── geode_graph.cpp │ │ │ ├── geode_hybrid_solid.cpp │ │ │ ├── geode_point_set.cpp │ │ │ ├── geode_polygonal_surface.cpp │ │ │ ├── geode_polyhedral_solid.cpp │ │ │ ├── geode_regular_grid_solid.cpp │ │ │ ├── geode_regular_grid_surface.cpp │ │ │ ├── geode_tetrahedral_solid.cpp │ │ │ └── geode_triangulated_surface.cpp │ │ ├── graph.cpp │ │ ├── grid.cpp │ │ ├── hybrid_solid.cpp │ │ ├── light_regular_grid.cpp │ │ ├── mesh_element.cpp │ │ ├── mesh_factory.cpp │ │ ├── mesh_id.cpp │ │ ├── point_set.cpp │ │ ├── polygonal_surface.cpp │ │ ├── polyhedral_solid.cpp │ │ ├── register_mesh.cpp │ │ ├── regular_grid_solid.cpp │ │ ├── regular_grid_surface.cpp │ │ ├── solid_edges.cpp │ │ ├── solid_facets.cpp │ │ ├── solid_mesh.cpp │ │ ├── surface_edges.cpp │ │ ├── surface_mesh.cpp │ │ ├── tetrahedral_solid.cpp │ │ ├── texture1d.cpp │ │ ├── texture2d.cpp │ │ ├── texture3d.cpp │ │ ├── texture_manager.cpp │ │ ├── texture_storage.cpp │ │ ├── triangulated_surface.cpp │ │ └── vertex_set.cpp │ ├── helpers │ │ ├── aabb_edged_curve_helpers.cpp │ │ ├── aabb_solid_helpers.cpp │ │ ├── aabb_surface_helpers.cpp │ │ ├── build_grid.cpp │ │ ├── convert_edged_curve.cpp │ │ ├── convert_point_set.cpp │ │ ├── convert_solid_mesh.cpp │ │ ├── convert_surface_mesh.cpp │ │ ├── create_coordinate_system.cpp │ │ ├── detail │ │ │ ├── component_identifier.cpp │ │ │ ├── create_mesh.cpp │ │ │ ├── curve_merger.cpp │ │ │ ├── debug.cpp │ │ │ ├── element_identifier.cpp │ │ │ ├── mesh_intersection_detection.cpp │ │ │ ├── point_set_merger.cpp │ │ │ ├── solid_merger.cpp │ │ │ ├── split_along_solid_facets.cpp │ │ │ ├── surface_merger.cpp │ │ │ └── vertex_merger.cpp │ │ ├── euclidean_distance_transform.cpp │ │ ├── gradient_computation.cpp │ │ ├── grid_point_function.cpp │ │ ├── grid_scalar_function.cpp │ │ ├── hausdorff_distance.cpp │ │ ├── internal │ │ │ ├── copy.cpp │ │ │ └── grid_shape_function.cpp │ │ ├── rasterize.cpp │ │ ├── ray_tracing.cpp │ │ ├── remove_vertex_duplication.cpp │ │ ├── repair_polygon_orientations.cpp │ │ ├── tetrahedral_solid_point_function.cpp │ │ ├── tetrahedral_solid_scalar_function.cpp │ │ ├── triangulated_surface_point_function.cpp │ │ └── triangulated_surface_scalar_function.cpp │ └── io │ │ ├── edged_curve_input.cpp │ │ ├── edged_curve_output.cpp │ │ ├── graph_input.cpp │ │ ├── graph_output.cpp │ │ ├── hybrid_solid_input.cpp │ │ ├── hybrid_solid_output.cpp │ │ ├── light_regular_grid_input.cpp │ │ ├── light_regular_grid_output.cpp │ │ ├── point_set_input.cpp │ │ ├── point_set_output.cpp │ │ ├── polygonal_surface_input.cpp │ │ ├── polygonal_surface_output.cpp │ │ ├── polyhedral_solid_input.cpp │ │ ├── polyhedral_solid_output.cpp │ │ ├── register_input.cpp │ │ ├── register_output.cpp │ │ ├── regular_grid_input.cpp │ │ ├── regular_grid_output.cpp │ │ ├── tetrahedral_solid_input.cpp │ │ ├── tetrahedral_solid_output.cpp │ │ ├── triangulated_surface_input.cpp │ │ ├── triangulated_surface_output.cpp │ │ ├── vertex_set_input.cpp │ │ └── vertex_set_output.cpp │ └── model │ ├── CMakeLists.txt │ ├── common.cpp │ ├── helpers │ ├── aabb_model_helpers.cpp │ ├── component_mensurations.cpp │ ├── component_mesh_edges.cpp │ ├── component_mesh_polygons.cpp │ ├── component_mesh_polyhedra.cpp │ ├── component_mesh_vertices.cpp │ ├── convert_brep_section.cpp │ ├── convert_model_meshes.cpp │ ├── convert_to_mesh.cpp │ ├── create_coordinate_system.cpp │ ├── detail │ │ ├── build_model_boundaries.cpp │ │ ├── mappings_merger.cpp │ │ ├── split_along_block_mesh_borders.cpp │ │ ├── split_along_surface_mesh_borders.cpp │ │ └── surface_mesh_validity_fix.cpp │ ├── model_component_filter.cpp │ ├── model_concatener.cpp │ ├── model_coordinate_reference_system.cpp │ ├── ray_tracing.cpp │ ├── simplicial_brep_creator.cpp │ ├── simplicial_section_creator.cpp │ └── surface_radial_sort.cpp │ ├── mixin │ ├── builder │ │ ├── block_collections_builder.cpp │ │ ├── blocks_builder.cpp │ │ ├── component_registry_builder.cpp │ │ ├── corner_collections_builder.cpp │ │ ├── corners_builder.cpp │ │ ├── line_collections_builder.cpp │ │ ├── lines_builder.cpp │ │ ├── model_boundaries_builder.cpp │ │ ├── relationships_builder.cpp │ │ ├── surface_collections_builder.cpp │ │ ├── surfaces_builder.cpp │ │ └── vertex_identifier_builder.cpp │ └── core │ │ ├── bitsery_archive.cpp │ │ ├── block.cpp │ │ ├── block_collection.cpp │ │ ├── block_collections.cpp │ │ ├── blocks.cpp │ │ ├── component.cpp │ │ ├── component_mesh_element.cpp │ │ ├── component_registry.cpp │ │ ├── component_type.cpp │ │ ├── corner.cpp │ │ ├── corner_collection.cpp │ │ ├── corner_collections.cpp │ │ ├── corners.cpp │ │ ├── detail │ │ └── relationships_impl.cpp │ │ ├── line.cpp │ │ ├── line_collection.cpp │ │ ├── line_collections.cpp │ │ ├── lines.cpp │ │ ├── model_boundaries.cpp │ │ ├── model_boundary.cpp │ │ ├── relationships.cpp │ │ ├── surface.cpp │ │ ├── surface_collection.cpp │ │ ├── surface_collections.cpp │ │ ├── surfaces.cpp │ │ └── vertex_identifier.cpp │ └── representation │ ├── builder │ ├── brep_builder.cpp │ └── section_builder.cpp │ ├── core │ ├── brep.cpp │ ├── detail │ │ ├── clone.cpp │ │ ├── transfer_collections.cpp │ │ └── transfer_metadata.cpp │ └── section.cpp │ └── io │ ├── brep_input.cpp │ ├── brep_output.cpp │ ├── geode │ ├── geode_brep_input.cpp │ ├── geode_brep_output.cpp │ ├── geode_section_input.cpp │ └── geode_section_output.cpp │ ├── section_input.cpp │ └── section_output.cpp ├── tests ├── CMakeLists.txt ├── basic │ ├── CMakeLists.txt │ ├── test-algorithm.cpp │ ├── test-assert.cpp │ ├── test-attribute.cpp │ ├── test-cached-value.cpp │ ├── test-factory.cpp │ ├── test-filename.cpp │ ├── test-growable.cpp │ ├── test-logger.cpp │ ├── test-mappings.cpp │ ├── test-permutation.cpp │ ├── test-progress-logger.cpp │ ├── test-range.cpp │ ├── test-small-set.cpp │ ├── test-uuid.cpp │ └── test-zip-file.cpp ├── common.hpp.in ├── data │ ├── 3patches.og_tsf2d │ ├── Armadillo.og_tsf3d │ ├── box_brep.og_brep │ ├── dangling.og_brep │ ├── fractures.og_sctn │ ├── layers.og_brep │ ├── modified_Armadillo.og_tsf3d │ ├── old_regular_grid.og_rgd2d │ ├── old_regular_grid.og_rgd3d │ ├── prism_curve.og_brep │ ├── quad.og_sctn │ ├── random_dfn.og_brep │ ├── relationships_v12 │ │ └── relationships │ ├── structural_model.og_brep │ ├── surface_degen.og_tsf3d │ ├── test_mesh3.og_brep │ ├── test_v12.og_edc3d │ ├── test_v12.og_psf3d │ ├── test_v12.og_pso3d │ ├── test_v12.og_rgd3d │ ├── test_v7.og_grp │ ├── test_v7.og_psf3d │ ├── test_v7.og_pso3d │ └── triangle.og_tsf3d ├── geometry │ ├── CMakeLists.txt │ ├── test-aabb.cpp │ ├── test-angle.cpp │ ├── test-barycentric-coordinates.cpp │ ├── test-basic-objects.cpp │ ├── test-bounding-box.cpp │ ├── test-coordinate-system.cpp │ ├── test-distance.cpp │ ├── test-dynamic-nnsearch.cpp │ ├── test-intersection-detection.cpp │ ├── test-intersection.cpp │ ├── test-mensuration.cpp │ ├── test-nnsearch.cpp │ ├── test-normal-frame-transform.cpp │ ├── test-perpendicular.cpp │ ├── test-point.cpp │ ├── test-points-sort.cpp │ ├── test-position.cpp │ ├── test-projection.cpp │ ├── test-quality.cpp │ ├── test-radial-sort.cpp │ ├── test-rotation.cpp │ ├── test-sign.cpp │ ├── test-square-matrix.cpp │ ├── test-triangle.cpp │ └── test-vector.cpp ├── image │ ├── CMakeLists.txt │ ├── test-colors.cpp │ └── test-raster-image.cpp ├── mesh │ ├── CMakeLists.txt │ ├── test-aabb-edged-curve-helpers.cpp │ ├── test-aabb-tetrahedral-solid-helpers.cpp │ ├── test-aabb-triangulated-surface-helpers.cpp │ ├── test-build-grid.cpp │ ├── test-convert-solid.cpp │ ├── test-convert-surface.cpp │ ├── test-coordinate-reference-system.cpp │ ├── test-edged-curve.cpp │ ├── test-euclidean-distance-transform.cpp │ ├── test-generic-mesh-accessor.cpp │ ├── test-geometrical-operations-on-mesh.cpp │ ├── test-gradient-computation.cpp │ ├── test-graph.cpp │ ├── test-hausdorff-distance.cpp │ ├── test-hybrid-solid.cpp │ ├── test-light-regular-grid.cpp │ ├── test-merge-curve.cpp │ ├── test-merge-solid.cpp │ ├── test-merge-surface.cpp │ ├── test-mesh-factory.cpp │ ├── test-nnsearch-point-set.cpp │ ├── test-point-set.cpp │ ├── test-polygonal-surface.cpp │ ├── test-polyhedral-solid.cpp │ ├── test-rasterize.cpp │ ├── test-ray-tracing.cpp │ ├── test-register-builder.cpp │ ├── test-register-input.cpp │ ├── test-register-mesh.cpp │ ├── test-register-output.cpp │ ├── test-regular-grid-function.cpp │ ├── test-regular-grid.cpp │ ├── test-remove-vertex-duplication.cpp │ ├── test-repair-polygon-orientations.cpp │ ├── test-tetrahedral-solid-function.cpp │ ├── test-tetrahedral-solid.cpp │ ├── test-texture-manager.cpp │ ├── test-triangulated-surface-function.cpp │ ├── test-triangulated-surface.cpp │ ├── test-vertex-cycle.cpp │ └── test-vertex-set.cpp └── model │ ├── CMakeLists.txt │ ├── test-brep.cpp │ ├── test-component-mesh-edges.cpp │ ├── test-component-mesh-polygons.cpp │ ├── test-component-mesh-polyhedra.cpp │ ├── test-convert-brep.cpp │ ├── test-convert-model-meshes.cpp │ ├── test-convert-to-mesh.cpp │ ├── test-model-component-filter.cpp │ ├── test-model-concatener.cpp │ ├── test-model-creator.cpp │ ├── test-model-crs.cpp │ ├── test-model-mapping.cpp │ ├── test-ray-tracing-helpers.cpp │ ├── test-relationships.cpp │ ├── test-section.cpp │ ├── test-surface-radial-sort.cpp │ └── test-vertex-identifier.cpp └── upgrade-guide.md /.gitattributes: -------------------------------------------------------------------------------- 1 | tests/** linguist-vendored 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: Geode-solutions -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | deploy: 8 | uses: Geode-solutions/actions/.github/workflows/cpp-deploy.yml@master 9 | with: 10 | name: OPENGEODE 11 | directory: opengeode 12 | secrets: inherit 13 | -------------------------------------------------------------------------------- /.github/workflows/manual_release.yml: -------------------------------------------------------------------------------- 1 | name: Manual release 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | release: 8 | uses: Geode-solutions/actions/.github/workflows/trigger-release.yml@master 9 | with: 10 | branch: next 11 | secrets: inherit -------------------------------------------------------------------------------- /.github/workflows/merge_request.yml: -------------------------------------------------------------------------------- 1 | name: Merge request 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | release: 8 | uses: Geode-solutions/actions/.github/workflows/cpp-merge-request.yml@master 9 | secrets: inherit 10 | -------------------------------------------------------------------------------- /.github/workflows/pr_update.yml: -------------------------------------------------------------------------------- 1 | name: Pull request 2 | 3 | on: 4 | pull_request: 5 | types: [opened, reopened] 6 | branches: 7 | - master 8 | 9 | jobs: 10 | update-branch: 11 | uses: Geode-solutions/actions/.github/workflows/update-branch.yml@master 12 | -------------------------------------------------------------------------------- /.github/workflows/prepare_deploy.yml: -------------------------------------------------------------------------------- 1 | name: Prepare deploy 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | prepare: 8 | uses: Geode-solutions/actions/.github/workflows/cpp-prepare-deploy.yml@master 9 | secrets: inherit 10 | -------------------------------------------------------------------------------- /.github/workflows/schedule.yml: -------------------------------------------------------------------------------- 1 | name: Schedule 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | branch: 7 | type: string 8 | default: "next" 9 | schedule: 10 | - cron: 0 23 * * * 11 | 12 | jobs: 13 | schedule: 14 | uses: Geode-solutions/actions/.github/workflows/cpp-schedule.yml@master 15 | with: 16 | name: OPENGEODE 17 | directory: opengeode 18 | branch: ${{ inputs.branch || 'next' }} 19 | secrets: 20 | TOKEN: ${{ secrets.TOKEN }} 21 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} 22 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | 3 | on: 4 | push: 5 | branches-ignore: 6 | - master 7 | - next 8 | 9 | jobs: 10 | test: 11 | uses: Geode-solutions/actions/.github/workflows/cpp-test.yml@master 12 | with: 13 | name: OPENGEODE 14 | directory: opengeode 15 | secrets: inherit 16 | -------------------------------------------------------------------------------- /.github/workflows/test_pr.yml: -------------------------------------------------------------------------------- 1 | name: Test PR 2 | 3 | on: 4 | pull_request: 5 | types: [opened, synchronize, reopened, ready_for_review] 6 | 7 | jobs: 8 | test: 9 | uses: Geode-solutions/actions/.github/workflows/cpp-test-pr.yml@master 10 | with: 11 | name: OPENGEODE 12 | directory: opengeode 13 | secrets: inherit 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | .settings 3 | .vscode/ipch 4 | examples/.ipynb* 5 | bindings/python/requirements.txt -------------------------------------------------------------------------------- /.releaserc: -------------------------------------------------------------------------------- 1 | { 2 | branches: [ 3 | { name: "master" }, 4 | { name: "next", channel: "next", prerelease: "rc" } 5 | ], 6 | plugins: [ 7 | '@semantic-release/commit-analyzer', 8 | '@semantic-release/release-notes-generator', 9 | '@semantic-release/github' 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "C_Cpp.default.cppStandard": "c++17", 3 | "C_Cpp.default.includePath": [ 4 | "${workspaceFolder}/include", 5 | "${workspaceFolder}/build/opengeode", 6 | "${workspaceFolder}/build/third_party/abseil/install/include", 7 | "${workspaceFolder}/build/third_party/asyncplusplus/install/include", 8 | "${workspaceFolder}/build/third_party/earcut/install/include", 9 | "${workspaceFolder}/build/third_party/bitsery/install/include", 10 | "${workspaceFolder}/build/third_party/minizip/install/include", 11 | "${workspaceFolder}/build/third_party/nanoflann/install/include", 12 | "${workspaceFolder}/build/third_party/pybind11/install/include", 13 | "${workspaceFolder}/build/third_party/spdlog/install/include" 14 | ], 15 | "files.watcherExclude": { 16 | "${workspaceFolder}/build/**": true 17 | } 18 | } -------------------------------------------------------------------------------- /.zenodo.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Open source framework for representing and manipulating geometric models", 3 | "title": "OpenGeode framework", 4 | "license": "MIT", 5 | "creators": [{"name": "Geode-solutions"}] 6 | } 7 | -------------------------------------------------------------------------------- /COPYLEFT: -------------------------------------------------------------------------------- 1 | ## Dependencies 2 | 3 | Abseil: Apache-2.0 4 | Copyright 2017 The Abseil Authors. 5 | 6 | Async++: MIT 7 | Copyright (c) 2015 Amanieu d'Antras. 8 | 9 | Bitsery: MIT 10 | Copyright (c) 2018 Mindaugas Vinkelis. 11 | 12 | Filesystem: BSD-3-Clause 13 | Copyright (c) 2018, Steffen Schümann . All rights reserved. 14 | 15 | Minizip: Zlib 16 | Copyright (C) 2010-2019 Nathan Moinvaziri. 17 | 18 | Nanoflann: BSD 19 | Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 20 | Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 21 | Copyright 2011 Jose L. Blanco (joseluisblancoc@gmail.com). All rights reserved. 22 | 23 | PCK: BSD 24 | Copyright (c) 2022, Bruno Levy. All rights reserved. 25 | 26 | Spdlog: MIT 27 | Copyright (c) 2016 Gabi Melman. 28 | 29 | ## Bindings 30 | 31 | Pybind11: BSD-3-Clause 32 | Copyright (c) 2016 The Pybind Development Team, All rights reserved. 33 | 34 | ## Legacy 35 | 36 | RINGMesh: BSD-3-Clause 37 | Copyright (c) 2012-2018, Association Scientifique pour la Geologie et ses 38 | Applications (ASGA). All rights reserved. 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 - 2025 Geode-solutions 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /bindings/python/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 - 2025 Geode-solutions 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | # SOFTWARE. 20 | 21 | set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH} ${SQLITE_INSTALL_PREFIX} ${PROJ_INSTALL_PREFIX}") 22 | find_package(GDAL REQUIRED CONFIG NO_DEFAULT_PATH PATHS ${GDAL_INSTALL_PREFIX}) 23 | 24 | add_subdirectory(src) 25 | 26 | if(OPENGEODE_WITH_TESTS) 27 | add_subdirectory(tests) 28 | endif() 29 | 30 | add_geode_python_wheel( 31 | NAME "OpenGeode-core" 32 | DESCRIPTION 33 | "Open source framework for representing and manipulating geometric models" 34 | MODULES 35 | "basic.py" 36 | "geometry.py" 37 | "image.py" 38 | "mesh.py" 39 | "model.py" 40 | SUPERBUILD 41 | LICENSE "MIT" 42 | ) 43 | -------------------------------------------------------------------------------- /bindings/python/basic.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 - 2025 Geode-solutions 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | # SOFTWARE. 20 | 21 | from opengeode_py_basic import * 22 | OpenGeodeBasicLibrary.initialize() 23 | -------------------------------------------------------------------------------- /bindings/python/geometry.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 - 2025 Geode-solutions 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | # SOFTWARE. 20 | 21 | from opengeode_py_geometry import * 22 | OpenGeodeGeometryLibrary.initialize() 23 | -------------------------------------------------------------------------------- /bindings/python/image.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 - 2025 Geode-solutions 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | # SOFTWARE. 20 | 21 | from opengeode_py_image import * 22 | OpenGeodeImageLibrary.initialize() 23 | -------------------------------------------------------------------------------- /bindings/python/mesh.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 - 2025 Geode-solutions 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | # SOFTWARE. 20 | 21 | from opengeode_py_mesh import * 22 | OpenGeodeMeshLibrary.initialize() 23 | -------------------------------------------------------------------------------- /bindings/python/model.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 - 2025 Geode-solutions 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | # SOFTWARE. 20 | 21 | from opengeode_py_model import * 22 | OpenGeodeModelLibrary.initialize() 23 | -------------------------------------------------------------------------------- /bindings/python/requirements.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/bindings/python/requirements.in -------------------------------------------------------------------------------- /bindings/python/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 - 2025 Geode-solutions 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | # SOFTWARE. 20 | 21 | add_subdirectory(basic) 22 | add_subdirectory(geometry) 23 | add_subdirectory(image) 24 | add_subdirectory(mesh) 25 | add_subdirectory(model) 26 | -------------------------------------------------------------------------------- /bindings/python/src/basic/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 - 2025 Geode-solutions 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | # SOFTWARE. 20 | 21 | add_geode_python_binding( 22 | NAME "py_basic" 23 | SOURCES 24 | "basic.cpp" 25 | "attribute.cpp" 26 | "attribute_manager.cpp" 27 | "cell_array.cpp" 28 | "identifier.cpp" 29 | "identifier_builder.cpp" 30 | "mapping.cpp" 31 | "uuid.cpp" 32 | DEPENDENCIES 33 | ${PROJECT_NAME}::basic 34 | ) -------------------------------------------------------------------------------- /bindings/python/src/basic/factory.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include 25 | 26 | #define PYTHON_FACTORY_CLASS( type ) \ 27 | pybind11::class_< type >( module, #type ) \ 28 | .def( "list_creators", &type::list_creators ) \ 29 | .def( "has_creator", &type::has_creator ) 30 | -------------------------------------------------------------------------------- /bindings/python/src/basic/identifier.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include "../common.hpp" 25 | 26 | #include 27 | #include 28 | 29 | namespace geode 30 | { 31 | void define_identifier( pybind11::module& module ) 32 | { 33 | pybind11::class_< Identifier >( module, "Identifier" ) 34 | .def( "id", &Identifier::id ) 35 | .def( "name", &Identifier::name ); 36 | } 37 | } // namespace geode 38 | -------------------------------------------------------------------------------- /bindings/python/src/basic/identifier_builder.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include "../common.hpp" 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | namespace geode 31 | { 32 | void define_identifier_builder( pybind11::module& module ) 33 | { 34 | pybind11::class_< IdentifierBuilder >( module, "IdentifierBuilder" ) 35 | .def( pybind11::init< Identifier& >() ) 36 | .def( "set_id", &IdentifierBuilder::set_id ) 37 | .def( "set_name", &IdentifierBuilder::set_name ); 38 | } 39 | } // namespace geode 40 | -------------------------------------------------------------------------------- /bindings/python/src/basic/uuid.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include "../common.hpp" 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | void define_uuid( pybind11::module& module ) 31 | { 32 | pybind11::class_< uuid >( module, "uuid" ) 33 | .def( pybind11::init<>() ) 34 | .def( pybind11::init< std::string_view >() ) 35 | .def( "string", &uuid::string ); 36 | } 37 | } // namespace geode 38 | -------------------------------------------------------------------------------- /bindings/python/src/geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 - 2025 Geode-solutions 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | # SOFTWARE. 20 | 21 | add_geode_python_binding( 22 | NAME "py_geometry" 23 | SOURCES 24 | "geometry.cpp" 25 | "angle.cpp" 26 | "barycentric_coordinates.cpp" 27 | "basic_objects.cpp" 28 | "bounding_box.cpp" 29 | "coordinate_system.cpp" 30 | "distance.cpp" 31 | "frame.cpp" 32 | "intersection.cpp" 33 | "intersection_detection.cpp" 34 | "mensuration.cpp" 35 | "nn_search.cpp" 36 | "perpendicular.cpp" 37 | "point.cpp" 38 | "points_sort.cpp" 39 | "position.cpp" 40 | "projection.cpp" 41 | "rotation.cpp" 42 | "sign.cpp" 43 | "vector.cpp" 44 | DEPENDENCIES 45 | ${PROJECT_NAME}::geometry 46 | ) -------------------------------------------------------------------------------- /bindings/python/src/geometry/perpendicular.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include "../common.hpp" 25 | 26 | #include 27 | #include 28 | 29 | namespace geode 30 | { 31 | void define_perpendicular( pybind11::module& module ) 32 | { 33 | module.def( "perpendicular", &perpendicular ); 34 | module.def( "dot_perpendicular", &dot_perpendicular ); 35 | } 36 | } // namespace geode 37 | -------------------------------------------------------------------------------- /bindings/python/src/geometry/rotation.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include "../common.hpp" 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | void define_rotation( pybind11::module& module ) 31 | { 32 | module.def( "rotate", &rotate ); 33 | } 34 | } // namespace geode 35 | -------------------------------------------------------------------------------- /bindings/python/src/geometry/sign.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include "../common.hpp" 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | namespace geode 32 | { 33 | void define_sign( pybind11::module& module ) 34 | { 35 | module.def( "tetrahedron_volume_sign", &tetrahedron_volume_sign ); 36 | module.def( "triangle_area_sign2D", 37 | static_cast< Sign ( * )( const Triangle2D& ) >( 38 | &triangle_area_sign ) ); 39 | module.def( "triangle_area_sign3D", 40 | static_cast< Sign ( * )( const Triangle3D&, local_index_t ) >( 41 | &triangle_area_sign ) ); 42 | } 43 | } // namespace geode 44 | -------------------------------------------------------------------------------- /bindings/python/src/image/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 - 2025 Geode-solutions 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | # SOFTWARE. 20 | 21 | add_geode_python_binding( 22 | NAME "py_image" 23 | SOURCES 24 | "image.cpp" 25 | "core/greyscale_color.cpp" 26 | "core/raster_image.cpp" 27 | "core/rgb_color.cpp" 28 | "io/raster_image.cpp" 29 | DEPENDENCIES 30 | GDAL::GDAL 31 | ${PROJECT_NAME}::image 32 | ) -------------------------------------------------------------------------------- /bindings/python/src/image/core/greyscale_color.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include "../../common.hpp" 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | void define_greyscale_color( pybind11::module& module ) 31 | { 32 | pybind11::class_< GreyscaleColor >( module, "GreyscaleColor" ) 33 | .def( pybind11::init<>() ) 34 | .def( pybind11::init< local_index_t >() ) 35 | .def( "value", &GreyscaleColor::value ) 36 | .def( "set_value", &GreyscaleColor::set_value ) 37 | .def( "string", &GreyscaleColor::string ) 38 | .def( pybind11::self == pybind11::self ) 39 | .def( pybind11::self != pybind11::self ) 40 | .def( pybind11::self + pybind11::self ) 41 | .def( pybind11::self += pybind11::self ); 42 | } 43 | } // namespace geode 44 | -------------------------------------------------------------------------------- /bindings/python/src/mesh/builder/vertex_set_builder.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include "../../common.hpp" 25 | 26 | #include 27 | #include 28 | 29 | namespace geode 30 | { 31 | void define_vertex_set_builder( pybind11::module& module ) 32 | { 33 | pybind11::class_< VertexSetBuilder, IdentifierBuilder >( 34 | module, "VertexSetBuilder" ) 35 | .def_static( "create", &VertexSetBuilder::create ) 36 | .def( "create_vertex", &VertexSetBuilder::create_vertex ) 37 | .def( "create_vertices", &VertexSetBuilder::create_vertices ) 38 | .def( "delete_vertices", &VertexSetBuilder::delete_vertices ) 39 | .def( "permute_vertices", &VertexSetBuilder::permute_vertices ); 40 | } 41 | } // namespace geode 42 | -------------------------------------------------------------------------------- /bindings/python/src/mesh/helpers/convert_edged_curve.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include "../../common.hpp" 25 | 26 | #include 27 | 28 | #include 29 | 30 | namespace geode 31 | { 32 | void define_convert_edged_curve( pybind11::module& module ) 33 | { 34 | module 35 | .def( "convert_edged_curve3d_into_2d", 36 | &convert_edged_curve3d_into_2d ) 37 | .def( "merge_edged_curves2D", &merge_edged_curves< 2 > ) 38 | .def( "merge_edged_curves3D", &merge_edged_curves< 3 > ); 39 | } 40 | } // namespace geode 41 | -------------------------------------------------------------------------------- /bindings/python/src/mesh/helpers/convert_point_set.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include "../../common.hpp" 25 | 26 | #include 27 | 28 | #include 29 | 30 | namespace geode 31 | { 32 | void define_convert_point_set( pybind11::module& module ) 33 | { 34 | module.def( 35 | "convert_point_set3d_into_2d", &convert_point_set3d_into_2d ); 36 | } 37 | } // namespace geode 38 | -------------------------------------------------------------------------------- /bindings/python/src/mesh/helpers/convert_solid_mesh.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include "../../common.hpp" 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | namespace geode 32 | { 33 | void define_convert_solid_mesh( pybind11::module& module ) 34 | { 35 | module 36 | .def( "convert_solid_mesh_into_tetrahedral_solid", 37 | &convert_solid_mesh_into_tetrahedral_solid ) 38 | .def( "convert_grid_into_tetrahedral_solid", 39 | &convert_grid_into_tetrahedral_solid ) 40 | .def( "merge_solid_meshes", &merge_solid_meshes ); 41 | } 42 | } // namespace geode 43 | -------------------------------------------------------------------------------- /bindings/python/src/mesh/helpers/euclidean_distance_transform.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include "../../common.hpp" 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | void define_euclidean_distance_transform( pybind11::module& module ) 31 | { 32 | module.def( "euclidean_distance_transform2D", 33 | &euclidean_distance_transform< 2 > ); 34 | module.def( "euclidean_distance_transform3D", 35 | &euclidean_distance_transform< 3 > ); 36 | } 37 | } // namespace geode 38 | -------------------------------------------------------------------------------- /bindings/python/src/mesh/helpers/repair_polygon_orientations.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include "../../common.hpp" 25 | 26 | #include 27 | #include 28 | 29 | namespace geode 30 | { 31 | void define_repair_polygon_orientations( pybind11::module& module ) 32 | { 33 | module.def( "repair_polygon_orientations2D", 34 | static_cast< void ( * )( SurfaceMesh< 2 >& ) >( 35 | &repair_polygon_orientations< 2 > ) ); 36 | module.def( "repair_polygon_orientations3D", 37 | static_cast< void ( * )( SurfaceMesh< 3 >& ) >( 38 | &repair_polygon_orientations< 3 > ) ); 39 | } 40 | } // namespace geode 41 | -------------------------------------------------------------------------------- /bindings/python/src/model/helpers/model_component_filter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include "../../common.hpp" 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | namespace geode 31 | { 32 | void define_model_component_filter( pybind11::module& module ) 33 | { 34 | module 35 | .def( "filter_brep_components_with_regards_to_blocks", 36 | &filter_brep_components_with_regards_to_blocks ) 37 | .def( "filter_section_components_with_regards_to_surfaces", 38 | &filter_section_components_with_regards_to_surfaces ); 39 | } 40 | } // namespace geode -------------------------------------------------------------------------------- /bindings/python/src/model/helpers/ray_tracing.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include "../../common.hpp" 25 | 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | namespace geode 32 | { 33 | void define_model_ray_tracing( pybind11::module& module ) 34 | { 35 | module 36 | .def( "find_intersections_with_boundaries", 37 | &find_intersections_with_boundaries ) 38 | .def( "is_point_inside_block", &is_point_inside_block ) 39 | .def( "block_containing_point", &block_containing_point ); 40 | } 41 | } // namespace geode -------------------------------------------------------------------------------- /bindings/python/src/model/mixin/builder/topology_builder.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include "../../../common.hpp" 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | void define_topology_builder( pybind11::module& module ) 31 | { 32 | pybind11::class_< TopologyBuilder, RelationshipsBuilder, 33 | VertexIdentifierBuilder, ComponentRegistryBuilder >( 34 | module, "TopologyBuilder" ); 35 | } 36 | } // namespace geode 37 | -------------------------------------------------------------------------------- /bindings/python/src/model/mixin/core/component.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include "../../../common.hpp" 25 | 26 | #include 27 | 28 | #define PYTHON_COMPONENT( dimension ) \ 29 | const auto name##dimension = \ 30 | "Component" + std::to_string( dimension ) + "D"; \ 31 | pybind11::class_< Component##dimension##D, Identifier >( \ 32 | module, name##dimension.c_str() ) \ 33 | .def( "component_type", &Component##dimension##D::component_type ) 34 | 35 | namespace geode 36 | { 37 | void define_component( pybind11::module& module ) 38 | { 39 | PYTHON_COMPONENT( 2 ); 40 | PYTHON_COMPONENT( 3 ); 41 | } 42 | } // namespace geode 43 | -------------------------------------------------------------------------------- /bindings/python/src/model/mixin/core/component_mesh_element.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include "../../../common.hpp" 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | void define_component_mesh_element( pybind11::module& module ) 31 | { 32 | pybind11::class_< ComponentMeshElement >( 33 | module, "ComponentMeshElement" ) 34 | .def( pybind11::init< ComponentID, index_t >() ) 35 | .def( "string", &ComponentMeshElement::string ); 36 | } 37 | } // namespace geode 38 | -------------------------------------------------------------------------------- /bindings/python/src/model/mixin/core/component_registry.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include "../../../common.hpp" 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | void define_component_registry( pybind11::module& module ) 31 | { 32 | pybind11::class_< ComponentRegistry >( module, "ComponentRegistry" ) 33 | .def( pybind11::init<>() ) 34 | .def( "mesh_components", &ComponentRegistry::mesh_components ) 35 | .def( "collection_components", 36 | &ComponentRegistry::collection_components ); 37 | } 38 | } // namespace geode 39 | -------------------------------------------------------------------------------- /bindings/python/src/model/mixin/core/topology.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include "../../../common.hpp" 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | void define_topology( pybind11::module& module ) 31 | { 32 | pybind11::class_< Topology, Relationships, VertexIdentifier, 33 | ComponentRegistry >( module, "Topology" ); 34 | } 35 | } // namespace geode 36 | -------------------------------------------------------------------------------- /bindings/python/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 - 2025 Geode-solutions 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | # SOFTWARE. 20 | 21 | add_subdirectory(basic) 22 | add_subdirectory(geometry) 23 | add_subdirectory(image) 24 | add_subdirectory(mesh) 25 | add_subdirectory(model) 26 | -------------------------------------------------------------------------------- /bindings/python/tests/basic/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 - 2025 Geode-solutions 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | # SOFTWARE. 20 | 21 | add_geode_python_test( 22 | SOURCE "test-py-attribute.py" 23 | DEPENDENCIES 24 | ${PROJECT_NAME}::py_basic 25 | ) 26 | add_geode_python_test( 27 | SOURCE "test-py-uuid.py" 28 | DEPENDENCIES 29 | ${PROJECT_NAME}::py_basic 30 | ) 31 | -------------------------------------------------------------------------------- /bindings/python/tests/basic/test-py-uuid.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright (c) 2019 - 2025 Geode-solutions 3 | # 4 | # Permission is hereby granted, free of charge, to any person obtaining a copy 5 | # of this software and associated documentation files (the "Software"), to deal 6 | # in the Software without restriction, including without limitation the rights 7 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | # copies of the Software, and to permit persons to whom the Software is 9 | # furnished to do so, subject to the following conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included in 12 | # all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | # SOFTWARE. 21 | 22 | import os 23 | import sys 24 | import platform 25 | if sys.version_info >= (3, 8, 0) and platform.system() == "Windows": 26 | for path in [x.strip() for x in os.environ['PATH'].split(';') if x]: 27 | os.add_dll_directory(path) 28 | 29 | import opengeode_py_basic as basic 30 | 31 | if __name__ == '__main__': 32 | id = basic.uuid() 33 | print(id.string()) 34 | -------------------------------------------------------------------------------- /bindings/python/tests/image/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 - 2025 Geode-solutions 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | # SOFTWARE. 20 | 21 | add_geode_python_test( 22 | SOURCE "test-py-colors.py" 23 | DEPENDENCIES 24 | ${PROJECT_NAME}::py_image 25 | ) 26 | add_geode_python_test( 27 | SOURCE "test-py-raster-image.py" 28 | DEPENDENCIES 29 | ${PROJECT_NAME}::py_image 30 | ) 31 | -------------------------------------------------------------------------------- /bindings/python/tests/image/test-py-colors.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright (c) 2019 - 2025 Geode-solutions 3 | # 4 | # Permission is hereby granted, free of charge, to any person obtaining a copy 5 | # of this software and associated documentation files (the "Software"), to deal 6 | # in the Software without restriction, including without limitation the rights 7 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | # copies of the Software, and to permit persons to whom the Software is 9 | # furnished to do so, subject to the following conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included in 12 | # all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | # SOFTWARE. 21 | 22 | 23 | import os 24 | import sys 25 | import platform 26 | if sys.version_info >= (3, 8, 0) and platform.system() == "Windows": 27 | for path in [x.strip() for x in os.environ['PATH'].split(';') if x]: 28 | os.add_dll_directory(path) 29 | 30 | import opengeode_py_basic 31 | import opengeode_py_image as image 32 | 33 | 34 | def test_comparison(): 35 | color1 = image.RGBColor(3, 254, 68) 36 | color2 = color1 37 | 38 | if color1 != color2: 39 | raise ValueError("[Test] Colors should be the same") 40 | color3 = image.RGBColor(4, 254, 68) 41 | if color1 == color3: 42 | raise ValueError("[Test] Colors should be different") 43 | 44 | 45 | if __name__ == '__main__': 46 | test_comparison() 47 | -------------------------------------------------------------------------------- /cmake/ConfigureBitsery.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 - 2025 Geode-solutions 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | # SOFTWARE. 20 | 21 | set(BITSERY_PATH ${PROJECT_BINARY_DIR}/third_party/bitsery) 22 | set(BITSERY_INSTALL_PREFIX ${BITSERY_PATH}/install) 23 | ExternalProject_Add(bitsery 24 | PREFIX ${BITSERY_PATH} 25 | SOURCE_DIR ${BITSERY_PATH}/src 26 | BINARY_DIR ${BITSERY_PATH}/build 27 | STAMP_DIR ${BITSERY_PATH}/stamp 28 | GIT_REPOSITORY https://github.com/Geode-solutions/bitsery 29 | GIT_TAG 20240711 30 | GIT_SHALLOW ON 31 | GIT_PROGRESS ON 32 | CMAKE_GENERATOR ${CMAKE_GENERATOR} 33 | CMAKE_GENERATOR_PLATFORM ${CMAKE_GENERATOR_PLATFORM} 34 | CMAKE_ARGS 35 | -DCMAKE_INSTALL_MESSAGE=LAZY 36 | -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} 37 | -DCMAKE_POLICY_VERSION_MINIMUM=3.5 38 | CMAKE_CACHE_ARGS 39 | -DCMAKE_INSTALL_PREFIX:PATH=${BITSERY_INSTALL_PREFIX} 40 | ) 41 | 42 | ExternalProject_Add_StepTargets(bitsery download) 43 | -------------------------------------------------------------------------------- /cmake/GlobalOptions.cmake: -------------------------------------------------------------------------------- 1 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 2 | message(STATUS "Setting build type to 'Release' as none was specified.") 3 | set(CMAKE_BUILD_TYPE "Release" CACHE STRING 4 | "Choose the type of build." FORCE) 5 | # Set the possible values of build type for cmake-gui 6 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 7 | "Debug" "Release" "MinSizeRel" "RelWithDebInfo") 8 | endif() 9 | 10 | option(BUILD_SHARED_LIBS "Build using shared libraries" ON) 11 | 12 | include(GNUInstallDirs) 13 | include(GenerateExportHeader) 14 | include(CMakePackageConfigHelpers) 15 | include(InstallRequiredSystemLibraries) 16 | 17 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 18 | set(CMAKE_CXX_EXTENSIONS OFF) 19 | set(CMAKE_COLOR_DIAGNOSTICS ON) 20 | if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.29) 21 | set(CMAKE_LINKER_TYPE "SYSTEM") 22 | endif() 23 | 24 | find_program(CLANG_TIDY "clang-tidy") 25 | if(CLANG_TIDY) 26 | option(USE_CLANG_TIDY "Toggle clang-tidy while compiling" OFF) 27 | if(USE_CLANG_TIDY) 28 | message(STATUS "Using clang-tidy") 29 | set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY};--extra-arg=-std=c++11") 30 | endif() 31 | endif() 32 | 33 | set_property(GLOBAL PROPERTY USE_FOLDERS ON) 34 | get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 35 | 36 | if(NOT BUILD_SHARED_LIBS) 37 | add_link_options( 38 | $<$:/INCREMENTAL:NO> 39 | ) 40 | endif() 41 | 42 | set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL") 43 | set(CMAKE_INSTALL_RPATH "$ORIGIN") 44 | set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON) 45 | set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY ON) 46 | set(CMAKE_BUILD_RPATH_USE_ORIGIN ON) 47 | set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) 48 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON) 49 | set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY ON) 50 | set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE) 51 | set(CPACK_COMPONENTS_ALL public) 52 | 53 | add_custom_target(third_party) 54 | add_custom_target(essential) 55 | -------------------------------------------------------------------------------- /cmake/Sanitizers.cmake: -------------------------------------------------------------------------------- 1 | # Modified from https://github.com/cpp-best-practices/cmake_template/blob/main/cmake/Sanitizers.cmake 2 | 3 | if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") 4 | option(USE_SANITIZER_ADDRESS "Toggle address sanitizer" OFF) 5 | option(USE_SANITIZER_LEAK "Toggle leak sanitizer" OFF) 6 | option(USE_SANITIZER_UNDEFINED_BEHAVIOR "Toggle undefined sanitizer" OFF) 7 | option(USE_SANITIZER_THREAD "Toggle thread sanitizer" OFF) 8 | 9 | set(SANITIZERS "") 10 | if(${USE_SANITIZER_ADDRESS}) 11 | list(APPEND SANITIZERS "address") 12 | endif() 13 | if(${USE_SANITIZER_LEAK}) 14 | list(APPEND SANITIZERS "leak") 15 | endif() 16 | if(${USE_SANITIZER_UNDEFINED_BEHAVIOR}) 17 | list(APPEND SANITIZERS "undefined") 18 | endif() 19 | if(${USE_SANITIZER_THREAD}) 20 | if("address" IN_LIST SANITIZERS OR "leak" IN_LIST SANITIZERS) 21 | message(WARNING "Thread sanitizer does not work with Address and Leak sanitizer enabled") 22 | else() 23 | list(APPEND SANITIZERS "thread") 24 | endif() 25 | endif() 26 | 27 | list(JOIN SANITIZERS "," LIST_OF_SANITIZERS) 28 | if(LIST_OF_SANITIZERS AND NOT "${LIST_OF_SANITIZERS}" STREQUAL "") 29 | add_compile_options(-fsanitize=${LIST_OF_SANITIZERS}) 30 | add_link_options(-fsanitize=${LIST_OF_SANITIZERS}) 31 | endif() 32 | endif() 33 | 34 | -------------------------------------------------------------------------------- /cmake/pyproject.toml.in: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 - 2025 Geode-solutions 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the 'Software'), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | # SOFTWARE. 20 | 21 | [build-system] 22 | requires = ["setuptools", "wheel"] 23 | build-backend = "setuptools.build_meta" 24 | 25 | [project] 26 | name = "${GEODE_WHEEL_NAME}" 27 | version = "${WHEEL_VERSION}" 28 | description = "${GEODE_WHEEL_DESCRIPTION}" 29 | authors = [{name = "Geode-solutions", email = "contact@geode-solutions.com"}] 30 | requires-python = ">=3.9,<3.13" 31 | license = {text = "${GEODE_WHEEL_LICENSE}"} 32 | dynamic = ["dependencies", "readme"] 33 | 34 | [tool.setuptools] 35 | packages = ["${project_name}"] 36 | 37 | [tool.setuptools.dynamic] 38 | dependencies = {file = "requirements.txt"} 39 | readme = {file = "README.md", content-type = "text/markdown"} 40 | 41 | [tool.setuptools.package-data] 42 | "${project_name}" = ["*/*.so", "*/*.so.*", "*/*.dll", "*/*.pyd", "share/*/*.db"] 43 | -------------------------------------------------------------------------------- /cmake/setup.py.in: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 - 2025 Geode-solutions 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the 'Software'), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | # SOFTWARE. 20 | # 21 | # Most project configs are in `pyproject.toml` 22 | # => Prefer to modify `pyproject.toml` over this file if possible. 23 | 24 | from setuptools import setup 25 | from setuptools.dist import Distribution 26 | from setuptools.command.install import install 27 | 28 | 29 | class BinaryDistribution(Distribution): 30 | def has_ext_modules(self): 31 | return True 32 | 33 | def is_pure(self): 34 | return False 35 | 36 | 37 | class InstallPlatlib(install): 38 | def finalize_options(self): 39 | install.finalize_options(self) 40 | self.install_lib = self.install_platlib 41 | 42 | setup( 43 | distclass=BinaryDistribution, 44 | cmdclass={'install': InstallPlatlib} 45 | ) 46 | -------------------------------------------------------------------------------- /cmake/version.rc.in: -------------------------------------------------------------------------------- 1 | #define RC_VERSION 1,0,0,0 2 | 3 | 1 VERSIONINFO 4 | FILEVERSION RC_VERSION 5 | PRODUCTVERSION RC_VERSION 6 | BEGIN 7 | BLOCK "VarFileInfo" 8 | BEGIN 9 | // English language (0x409) and the Windows Unicode codepage (1200) 10 | VALUE "Translation", 0x409, 1200 11 | END 12 | BLOCK "StringFileInfo" 13 | BEGIN 14 | BLOCK "040904b0" 15 | BEGIN 16 | VALUE "FileDescription", "Compiled with @CMAKE_CXX_COMPILER_ID@ @CMAKE_CXX_COMPILER_VERSION@\0" 17 | VALUE "ProductVersion", "@CPACK_PACKAGE_VERSION@\0" 18 | VALUE "FileVersion", "@CPACK_PACKAGE_VERSION@\0" 19 | VALUE "InternalName", "@PROJECT_LIB_NAME@\0" 20 | VALUE "ProductName", "@PROJECT_LIB_NAME@\0" 21 | VALUE "CompanyName", "Geode-solutions SAS\0" 22 | VALUE "LegalCopyright", "Copyright 2019 - 2025 Geode-solutions SAS. All rights reserved.\0" 23 | VALUE "Commentaires", "https://geode-solutions.com\0" 24 | END 25 | END 26 | END 27 | -------------------------------------------------------------------------------- /examples/images/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/examples/images/layers.png -------------------------------------------------------------------------------- /include/geode/basic/chronometer.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | #include 29 | #include 30 | 31 | namespace geode 32 | { 33 | class opengeode_basic_api Chronometer 34 | { 35 | public: 36 | Chronometer(); 37 | Chronometer( Chronometer&& other ) noexcept; 38 | ~Chronometer(); 39 | 40 | void start(); 41 | 42 | void stop(); 43 | 44 | [[nodiscard]] absl::Duration raw_duration() const; 45 | 46 | [[nodiscard]] std::string duration() const; 47 | 48 | void reset(); 49 | 50 | private: 51 | IMPLEMENTATION_MEMBER( impl_ ); 52 | }; 53 | } // namespace geode -------------------------------------------------------------------------------- /include/geode/basic/detail/count_range_elements.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | namespace detail 31 | { 32 | template < typename Range > 33 | [[nodiscard]] index_t count_range_elements( const Range& range ) 34 | { 35 | index_t nb{ 0 }; 36 | for( const auto& unused : range ) 37 | { 38 | geode_unused( unused ); 39 | nb++; 40 | } 41 | return nb; 42 | } 43 | } // namespace detail 44 | } // namespace geode 45 | -------------------------------------------------------------------------------- /include/geode/basic/detail/disable_debug_logger.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #undef DEBUG 25 | #undef SDEBUG 26 | #define DEBUG( a ) geode_unused( a ); 27 | #define SDEBUG( a ) geode_unused( a ); -------------------------------------------------------------------------------- /include/geode/basic/detail/enable_debug_logger.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #undef DEBUG 25 | #undef SDEBUG 26 | #define DEBUG( a ) geode::Logger::debug( #a, " = ", a ) 27 | #define SDEBUG( a ) geode::Logger::debug( #a, " = ", a.string() ) -------------------------------------------------------------------------------- /include/geode/basic/detail/mapping_after_deletion.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | #include 29 | 30 | namespace geode 31 | { 32 | namespace detail 33 | { 34 | [[nodiscard]] inline std::vector< index_t > mapping_after_deletion( 35 | const std::vector< bool >& to_delete ) 36 | { 37 | std::vector< index_t > old2new( to_delete.size(), NO_ID ); 38 | index_t current_id{ 0 }; 39 | for( const auto i : Indices{ to_delete } ) 40 | { 41 | if( !to_delete[i] ) 42 | { 43 | old2new[i] = current_id++; 44 | } 45 | } 46 | return old2new; 47 | } 48 | } // namespace detail 49 | } // namespace geode 50 | -------------------------------------------------------------------------------- /include/geode/basic/identifier_builder.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | class Identifier; 31 | struct uuid; 32 | } // namespace geode 33 | 34 | namespace geode 35 | { 36 | class opengeode_basic_api IdentifierBuilder 37 | { 38 | public: 39 | IdentifierBuilder( Identifier& identifier ); 40 | 41 | void set_id( const uuid& unique_id ); 42 | 43 | void set_name( std::string_view name ); 44 | 45 | void copy_identifier( const Identifier& other ); 46 | 47 | void load_identifier( std::string_view directory ); 48 | 49 | private: 50 | Identifier& identifier_; 51 | }; 52 | } // namespace geode 53 | -------------------------------------------------------------------------------- /include/geode/basic/logger_client.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | class opengeode_basic_api LoggerClient 31 | { 32 | public: 33 | virtual ~LoggerClient() = default; 34 | 35 | virtual void trace( const std::string &message ) = 0; 36 | 37 | virtual void debug( const std::string &message ) = 0; 38 | 39 | virtual void info( const std::string &message ) = 0; 40 | 41 | virtual void warn( const std::string &message ) = 0; 42 | 43 | virtual void error( const std::string &message ) = 0; 44 | 45 | virtual void critical( const std::string &message ) = 0; 46 | 47 | protected: 48 | LoggerClient() = default; 49 | }; 50 | } // namespace geode 51 | -------------------------------------------------------------------------------- /include/geode/basic/output.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | 29 | #include 30 | #include 31 | 32 | namespace geode 33 | { 34 | template < typename Object > 35 | class Output : public IOFile 36 | { 37 | public: 38 | virtual std::vector< std::string > write( 39 | const Object& object ) const = 0; 40 | 41 | [[nodiscard]] virtual bool is_saveable( const Object& /*unused*/ ) const 42 | { 43 | return true; 44 | } 45 | 46 | protected: 47 | explicit Output( std::string_view filename ) : IOFile( filename ) {} 48 | }; 49 | } // namespace geode 50 | -------------------------------------------------------------------------------- /include/geode/basic/string.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | [[nodiscard]] std::vector< std::string_view > 31 | opengeode_basic_api string_split( std::string_view string ); 32 | 33 | [[nodiscard]] bool opengeode_basic_api string_starts_with( 34 | std::string_view string, std::string_view check ); 35 | 36 | [[nodiscard]] index_t opengeode_basic_api string_to_index( 37 | std::string_view string ); 38 | 39 | [[nodiscard]] int opengeode_basic_api string_to_int( 40 | std::string_view string ); 41 | 42 | [[nodiscard]] float opengeode_basic_api string_to_float( 43 | std::string_view string ); 44 | 45 | [[nodiscard]] double opengeode_basic_api string_to_double( 46 | std::string_view string ); 47 | } // namespace geode -------------------------------------------------------------------------------- /include/geode/basic/timer.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | #include 29 | #include 30 | 31 | namespace geode 32 | { 33 | class opengeode_basic_api Timer 34 | { 35 | public: 36 | Timer(); 37 | Timer( Timer&& other ) noexcept; 38 | ~Timer(); 39 | 40 | [[nodiscard]] absl::Duration raw_duration() const; 41 | 42 | [[nodiscard]] std::string duration() const; 43 | 44 | void reset(); 45 | 46 | private: 47 | IMPLEMENTATION_MEMBER( impl_ ); 48 | }; 49 | } // namespace geode -------------------------------------------------------------------------------- /include/geode/geometry/basic_objects/cylinder.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | 29 | namespace geode 30 | { 31 | class opengeode_geometry_api Cylinder 32 | { 33 | public: 34 | Cylinder( Segment3D axis, double radius ); 35 | 36 | Cylinder( const Cylinder& other ); 37 | Cylinder& operator=( const Cylinder& other ); 38 | Cylinder( Cylinder&& other ) noexcept; 39 | Cylinder& operator=( Cylinder&& other ) noexcept; 40 | 41 | [[nodiscard]] const Segment3D& axis() const; 42 | [[nodiscard]] double radius() const; 43 | 44 | private: 45 | Segment3D axis_; 46 | double radius_{ 0 }; 47 | }; 48 | } // namespace geode 49 | -------------------------------------------------------------------------------- /include/geode/geometry/common.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | namespace geode 32 | { 33 | OPENGEODE_LIBRARY( opengeode_geometry_api, OpenGeodeGeometry ); 34 | } // namespace geode -------------------------------------------------------------------------------- /include/geode/geometry/perpendicular.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | FORWARD_DECLARATION_DIMENSION_CLASS( Vector ); 31 | ALIAS_2D( Vector ); 32 | } // namespace geode 33 | 34 | namespace geode 35 | { 36 | /*! 37 | * Return a 2D vector perpendicular to the given one 38 | */ 39 | [[nodiscard]] Vector2D opengeode_geometry_api perpendicular( 40 | const Vector2D& v ); 41 | 42 | /*! 43 | * Compute the dot product between a 2D vector \p v0 and another 2D vector 44 | * perpendicular to \p v1. 45 | */ 46 | [[nodiscard]] double opengeode_geometry_api dot_perpendicular( 47 | const Vector2D& v0, const Vector2D& v1 ); 48 | 49 | } // namespace geode 50 | -------------------------------------------------------------------------------- /include/geode/geometry/points_sort.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | namespace geode 32 | { 33 | FORWARD_DECLARATION_DIMENSION_CLASS( Point ); 34 | } // namespace geode 35 | 36 | namespace geode 37 | { 38 | template < index_t dimension > 39 | [[nodiscard]] std::vector< index_t > lexicographic_mapping( 40 | absl::Span< const Point< dimension > > points ); 41 | 42 | template < index_t dimension > 43 | [[nodiscard]] std::vector< index_t > morton_mapping( 44 | absl::Span< const Point< dimension > > points ); 45 | 46 | template < index_t dimension > 47 | [[nodiscard]] std::vector< index_t > hilbert_mapping( 48 | absl::Span< const Point< dimension > > points ); 49 | } // namespace geode 50 | -------------------------------------------------------------------------------- /include/geode/geometry/quality.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | class Tetrahedron; 31 | } // namespace geode 32 | 33 | namespace geode 34 | { 35 | [[nodiscard]] double opengeode_geometry_api tetrahedron_aspect_ratio( 36 | const Tetrahedron& tetra ); 37 | [[nodiscard]] double opengeode_geometry_api 38 | tetrahedron_volume_to_edge_ratio( const Tetrahedron& tetra ); 39 | 40 | [[nodiscard]] double opengeode_geometry_api 41 | tetrahedron_collapse_aspect_ratio( const Tetrahedron& tetra ); 42 | } // namespace geode 43 | -------------------------------------------------------------------------------- /include/geode/geometry/radial_sort.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | namespace geode 32 | { 33 | FORWARD_DECLARATION_DIMENSION_CLASS( Point ); 34 | FORWARD_DECLARATION_DIMENSION_CLASS( Segment ); 35 | ALIAS_2D_AND_3D( Point ); 36 | ALIAS_2D_AND_3D( Segment ); 37 | } // namespace geode 38 | 39 | namespace geode 40 | { 41 | [[nodiscard]] absl::FixedArray< index_t > 42 | opengeode_geometry_api radial_sort( 43 | const Segment3D& segment, absl::Span< const Point3D > points ); 44 | } // namespace geode 45 | -------------------------------------------------------------------------------- /include/geode/geometry/rotation.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | 29 | namespace geode 30 | { 31 | /*! 32 | * Rotate a Point3D by an angle around an axis 33 | * @param[in] point The point to rotate. 34 | * @param[in] axis Axis for the rotation (not null but not necessary 35 | * normalized). 36 | * @param[in] angle Rotation angle expresses in radians. 37 | */ 38 | [[nodiscard]] Point3D opengeode_geometry_api rotate( 39 | const Point3D& point, const Vector3D& axis, double angle ); 40 | } // namespace geode 41 | -------------------------------------------------------------------------------- /include/geode/image/common.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | namespace geode 32 | { 33 | OPENGEODE_LIBRARY( opengeode_image_api, OpenGeodeImage ); 34 | } // namespace geode -------------------------------------------------------------------------------- /include/geode/mesh/builder/geode/register_builder.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | void opengeode_mesh_api register_geode_builder(); 31 | } // namespace geode -------------------------------------------------------------------------------- /include/geode/mesh/common.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | namespace geode 32 | { 33 | OPENGEODE_LIBRARY( opengeode_mesh_api, OpenGeodeMesh ); 34 | } // namespace geode -------------------------------------------------------------------------------- /include/geode/mesh/core/geode/register_mesh.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | void opengeode_mesh_api register_geode_mesh(); 31 | } // namespace geode -------------------------------------------------------------------------------- /include/geode/mesh/core/meshes_mapping.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | #include 29 | 30 | namespace geode 31 | { 32 | using ElementsMapping = GenericMapping< index_t, index_t >; 33 | 34 | struct MeshesElementsMapping 35 | { 36 | ElementsMapping vertices; 37 | ElementsMapping edges; 38 | ElementsMapping polygons; 39 | ElementsMapping polyhedra; 40 | }; 41 | } // namespace geode -------------------------------------------------------------------------------- /include/geode/mesh/helpers/build_grid.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | 29 | namespace geode 30 | { 31 | FORWARD_DECLARATION_DIMENSION_CLASS( BoundingBox ); 32 | } // namespace geode 33 | 34 | namespace geode 35 | { 36 | template < index_t dimension > 37 | [[nodiscard]] LightRegularGrid< dimension > 38 | build_grid_from_bbox_target_length_and_maximum_cell_number( 39 | const BoundingBox< dimension >& bbox, 40 | double target_cell_length, 41 | index_t max_nb_cells ); 42 | } // namespace geode -------------------------------------------------------------------------------- /include/geode/mesh/helpers/convert_point_set.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | #include 29 | 30 | namespace geode 31 | { 32 | FORWARD_DECLARATION_DIMENSION_CLASS( PointSet ); 33 | ALIAS_2D_AND_3D( PointSet ); 34 | } // namespace geode 35 | 36 | namespace geode 37 | { 38 | [[nodiscard]] std::unique_ptr< PointSet2D > 39 | opengeode_mesh_api convert_point_set3d_into_2d( 40 | const PointSet3D& point_set3d, index_t axis_to_remove ); 41 | 42 | [[nodiscard]] std::unique_ptr< PointSet3D > opengeode_mesh_api 43 | convert_point_set2d_into_3d( const PointSet2D& point_set2d, 44 | index_t axis_to_add, 45 | double axis_coordinate ); 46 | } // namespace geode -------------------------------------------------------------------------------- /include/geode/mesh/helpers/detail/create_mesh.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | #pragma once 24 | 25 | #include 26 | 27 | #include 28 | 29 | #include 30 | 31 | namespace geode 32 | { 33 | namespace detail 34 | { 35 | template < typename Mesh > 36 | [[nodiscard]] std::unique_ptr< Mesh > create_mesh( 37 | absl::Span< const std::reference_wrapper< const Mesh > > meshes ); 38 | } // namespace detail 39 | } // namespace geode -------------------------------------------------------------------------------- /include/geode/mesh/helpers/detail/mesh_intersection_detection.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | 29 | namespace geode 30 | { 31 | namespace detail 32 | { 33 | template < typename Mesh > 34 | bool polygons_intersection_detection( const Mesh& mesh, 35 | const PolygonVertices& polygon, 36 | const PolygonVertices& other_polygon ); 37 | } // namespace detail 38 | } // namespace geode -------------------------------------------------------------------------------- /include/geode/mesh/helpers/hausdorff_distance.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | FORWARD_DECLARATION_DIMENSION_CLASS( TriangulatedSurface ); 31 | ALIAS_3D( TriangulatedSurface ); 32 | } // namespace geode 33 | 34 | namespace geode 35 | { 36 | [[nodiscard]] double opengeode_mesh_api hausdorff_distance( 37 | const TriangulatedSurface3D& mesh_A, 38 | const TriangulatedSurface3D& mesh_B ); 39 | } // namespace geode 40 | -------------------------------------------------------------------------------- /include/geode/mesh/helpers/nnsearch_mesh.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | #include 29 | 30 | namespace geode 31 | { 32 | template < template < index_t > class Mesh, index_t dimension > 33 | [[nodiscard]] NNSearch< dimension > create_nn_search( 34 | const Mesh< dimension >& mesh ) 35 | { 36 | std::vector< Point< dimension > > points; 37 | points.reserve( mesh.nb_vertices() ); 38 | for( const auto v : Range{ mesh.nb_vertices() } ) 39 | { 40 | points.push_back( mesh.point( v ) ); 41 | } 42 | return NNSearch< dimension >{ std::move( points ) }; 43 | } 44 | } // namespace geode -------------------------------------------------------------------------------- /include/geode/mesh/helpers/repair_polygon_orientations.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | FORWARD_DECLARATION_DIMENSION_CLASS( SurfaceMesh ); 31 | FORWARD_DECLARATION_DIMENSION_CLASS( SurfaceMeshBuilder ); 32 | } // namespace geode 33 | 34 | namespace geode 35 | { 36 | template < index_t dimension > 37 | void OPENGEODE_MESH_DEPRECATED repair_polygon_orientations( 38 | SurfaceMesh< dimension >& mesh ); 39 | 40 | template < index_t dimension > 41 | void repair_polygon_orientations( const SurfaceMesh< dimension >& mesh, 42 | SurfaceMeshBuilder< dimension >& builder ); 43 | } // namespace geode 44 | -------------------------------------------------------------------------------- /include/geode/mesh/io/geode/geode_edged_curve_input.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | namespace geode 31 | { 32 | BITSERY_INPUT_MESH_DIMENSION( EdgedCurve ); 33 | } // namespace geode 34 | -------------------------------------------------------------------------------- /include/geode/mesh/io/geode/geode_edged_curve_output.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | namespace geode 31 | { 32 | BITSERY_OUTPUT_MESH_DIMENSION( EdgedCurve ); 33 | } // namespace geode 34 | -------------------------------------------------------------------------------- /include/geode/mesh/io/geode/geode_graph_input.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | namespace geode 31 | { 32 | BITSERY_INPUT_MESH_NO_DIMENSION( Graph ); 33 | } // namespace geode 34 | -------------------------------------------------------------------------------- /include/geode/mesh/io/geode/geode_graph_output.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | namespace geode 31 | { 32 | BITSERY_OUTPUT_MESH_NO_DIMENSION( Graph ); 33 | } // namespace geode -------------------------------------------------------------------------------- /include/geode/mesh/io/geode/geode_hybrid_solid_input.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | namespace geode 31 | { 32 | BITSERY_INPUT_MESH_DIMENSION( HybridSolid ); 33 | } // namespace geode 34 | -------------------------------------------------------------------------------- /include/geode/mesh/io/geode/geode_hybrid_solid_output.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | namespace geode 31 | { 32 | BITSERY_OUTPUT_MESH_DIMENSION( HybridSolid ); 33 | } // namespace geode 34 | -------------------------------------------------------------------------------- /include/geode/mesh/io/geode/geode_point_set_input.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | namespace geode 31 | { 32 | BITSERY_INPUT_MESH_DIMENSION( PointSet ); 33 | } // namespace geode 34 | -------------------------------------------------------------------------------- /include/geode/mesh/io/geode/geode_point_set_output.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | namespace geode 31 | { 32 | BITSERY_OUTPUT_MESH_DIMENSION( PointSet ); 33 | } // namespace geode 34 | -------------------------------------------------------------------------------- /include/geode/mesh/io/geode/geode_polygonal_surface_input.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | namespace geode 31 | { 32 | BITSERY_INPUT_MESH_DIMENSION( PolygonalSurface ); 33 | } // namespace geode 34 | -------------------------------------------------------------------------------- /include/geode/mesh/io/geode/geode_polygonal_surface_output.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | namespace geode 31 | { 32 | BITSERY_OUTPUT_MESH_DIMENSION( PolygonalSurface ); 33 | } // namespace geode 34 | -------------------------------------------------------------------------------- /include/geode/mesh/io/geode/geode_polyhedral_solid_input.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | namespace geode 31 | { 32 | BITSERY_INPUT_MESH_DIMENSION( PolyhedralSolid ); 33 | } // namespace geode 34 | -------------------------------------------------------------------------------- /include/geode/mesh/io/geode/geode_polyhedral_solid_output.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | namespace geode 31 | { 32 | BITSERY_OUTPUT_MESH_DIMENSION( PolyhedralSolid ); 33 | } // namespace geode 34 | -------------------------------------------------------------------------------- /include/geode/mesh/io/geode/geode_regular_grid_input.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | namespace geode 32 | { 33 | BITSERY_INPUT_MESH_DIMENSION( RegularGrid ); 34 | } // namespace geode 35 | -------------------------------------------------------------------------------- /include/geode/mesh/io/geode/geode_regular_grid_output.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | namespace geode 32 | { 33 | BITSERY_OUTPUT_MESH_DIMENSION( RegularGrid ); 34 | } // namespace geode 35 | -------------------------------------------------------------------------------- /include/geode/mesh/io/geode/geode_tetrahedral_solid_input.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | namespace geode 31 | { 32 | BITSERY_INPUT_MESH_DIMENSION( TetrahedralSolid ); 33 | } // namespace geode 34 | -------------------------------------------------------------------------------- /include/geode/mesh/io/geode/geode_tetrahedral_solid_output.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | namespace geode 31 | { 32 | BITSERY_OUTPUT_MESH_DIMENSION( TetrahedralSolid ); 33 | } // namespace geode 34 | -------------------------------------------------------------------------------- /include/geode/mesh/io/geode/geode_triangulated_surface_input.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | namespace geode 31 | { 32 | BITSERY_INPUT_MESH_DIMENSION( TriangulatedSurface ); 33 | } // namespace geode 34 | -------------------------------------------------------------------------------- /include/geode/mesh/io/geode/geode_triangulated_surface_output.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | namespace geode 31 | { 32 | BITSERY_OUTPUT_MESH_DIMENSION( TriangulatedSurface ); 33 | } // namespace geode 34 | -------------------------------------------------------------------------------- /include/geode/mesh/io/geode/geode_vertex_set_input.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | namespace geode 31 | { 32 | BITSERY_INPUT_MESH_NO_DIMENSION( VertexSet ); 33 | } // namespace geode 34 | -------------------------------------------------------------------------------- /include/geode/mesh/io/geode/geode_vertex_set_output.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | namespace geode 31 | { 32 | BITSERY_OUTPUT_MESH_NO_DIMENSION( VertexSet ); 33 | } // namespace geode 34 | -------------------------------------------------------------------------------- /include/geode/mesh/io/geode/register_input.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | void opengeode_mesh_api register_geode_mesh_input(); 31 | } // namespace geode 32 | -------------------------------------------------------------------------------- /include/geode/mesh/io/geode/register_output.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | void opengeode_mesh_api register_geode_mesh_output(); 31 | } // namespace geode 32 | -------------------------------------------------------------------------------- /include/geode/model/common.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | namespace geode 32 | { 33 | OPENGEODE_LIBRARY( opengeode_model_api, OpenGeodeModel ); 34 | } // namespace geode -------------------------------------------------------------------------------- /include/geode/model/helpers/detail/build_model_boundaries.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | class Section; 31 | class SectionBuilder; 32 | class BRep; 33 | class BRepBuilder; 34 | } // namespace geode 35 | 36 | namespace geode 37 | { 38 | namespace detail 39 | { 40 | void opengeode_model_api build_model_boundaries( 41 | const Section& model, SectionBuilder& builder ); 42 | 43 | void opengeode_model_api build_model_boundaries( 44 | const BRep& model, BRepBuilder& builder ); 45 | } // namespace detail 46 | } // namespace geode -------------------------------------------------------------------------------- /include/geode/model/helpers/detail/surface_mesh_validity_fix.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | FORWARD_DECLARATION_DIMENSION_CLASS( Surface ); 31 | } // namespace geode 32 | 33 | namespace geode 34 | { 35 | namespace detail 36 | { 37 | template < typename Model > 38 | void repair_non_manifold_vertices( 39 | Model& model, const Surface< Model::dim >& surface ); 40 | } // namespace detail 41 | } // namespace geode -------------------------------------------------------------------------------- /include/geode/model/helpers/model_component_filter.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | class BRep; 31 | class Section; 32 | class ComponentID; 33 | } // namespace geode 34 | 35 | namespace geode 36 | { 37 | std::vector< ComponentID > opengeode_model_api 38 | filter_brep_components_with_regards_to_blocks( BRep& brep ); 39 | 40 | std::vector< ComponentID > opengeode_model_api 41 | filter_section_components_with_regards_to_surfaces( Section& section ); 42 | } // namespace geode -------------------------------------------------------------------------------- /include/geode/model/helpers/model_concatener.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | #include 29 | 30 | namespace geode 31 | { 32 | class BRep; 33 | class Section; 34 | } // namespace geode 35 | 36 | namespace geode 37 | { 38 | template < typename Model > 39 | class ModelConcatener 40 | { 41 | public: 42 | explicit ModelConcatener( Model& model ); 43 | 44 | ~ModelConcatener(); 45 | 46 | ModelCopyMapping concatenate( const Model& other_model ); 47 | 48 | private: 49 | IMPLEMENTATION_MEMBER( impl_ ); 50 | }; 51 | 52 | using BRepConcatener = ModelConcatener< BRep >; 53 | using SectionConcatener = ModelConcatener< Section >; 54 | } // namespace geode -------------------------------------------------------------------------------- /include/geode/model/representation/core/detail/clone.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | 29 | namespace geode 30 | { 31 | class Section; 32 | class BRep; 33 | } // namespace geode 34 | 35 | namespace geode 36 | { 37 | namespace detail 38 | { 39 | [[nodiscard]] ModelCopyMapping opengeode_model_api 40 | section_clone_mapping( const Section& model ); 41 | 42 | [[nodiscard]] ModelCopyMapping opengeode_model_api brep_clone_mapping( 43 | const BRep& model ); 44 | } // namespace detail 45 | } // namespace geode 46 | -------------------------------------------------------------------------------- /log: -------------------------------------------------------------------------------- 1 | ninja: error: loading 'build.ninja': No such file or directory 2 | -------------------------------------------------------------------------------- /src/geode/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 - 2025 Geode-solutions 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | # SOFTWARE. 20 | 21 | #------------------------------------------------------------------------------------------------ 22 | # Configure the OpenGeode libraries 23 | add_subdirectory(basic) 24 | add_subdirectory(geometry) 25 | add_subdirectory(image) 26 | add_subdirectory(mesh) 27 | add_subdirectory(model) 28 | -------------------------------------------------------------------------------- /src/geode/basic/bitsery_input.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | void register_basic_deserialize_pcontext( PContext& context ) 31 | { 32 | detail::register_basic_pcontext< Deserializer >( context ); 33 | } 34 | } // namespace geode 35 | -------------------------------------------------------------------------------- /src/geode/basic/bitsery_output.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | void register_basic_serialize_pcontext( PContext& context ) 31 | { 32 | detail::register_basic_pcontext< Serializer >( context ); 33 | } 34 | } // namespace geode 35 | -------------------------------------------------------------------------------- /src/geode/basic/permutation.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | /* 25 | * Modified from Geogram 26 | * http://alice.loria.fr/index.php/software/4-library/75-geogram.html 27 | * Copyright (c) 2012-2014, Bruno Levy 28 | */ 29 | 30 | #include 31 | 32 | #include 33 | 34 | namespace geode 35 | { 36 | std::vector< index_t > old2new_permutation( 37 | absl::Span< const index_t > permutation ) 38 | { 39 | std::vector< index_t > old2new( permutation.size() ); 40 | async::parallel_for( async::irange( size_t{ 0 }, permutation.size() ), 41 | [&old2new, &permutation]( size_t index ) { 42 | old2new[permutation[index]] = index; 43 | } ); 44 | return old2new; 45 | } 46 | } // namespace geode 47 | -------------------------------------------------------------------------------- /src/geode/geometry/basic_objects/cylinder.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | Cylinder::Cylinder( Segment3D axis, double radius ) 31 | : axis_( std::move( axis ) ), radius_( radius ) 32 | { 33 | } 34 | 35 | Cylinder::Cylinder( const Cylinder& ) = default; 36 | 37 | Cylinder& Cylinder::operator=( const Cylinder& ) = default; 38 | 39 | Cylinder::Cylinder( Cylinder&& ) noexcept = default; 40 | 41 | Cylinder& Cylinder::operator=( Cylinder&& ) noexcept = default; 42 | 43 | const Segment3D& Cylinder::axis() const 44 | { 45 | return axis_; 46 | } 47 | double Cylinder::radius() const 48 | { 49 | return radius_; 50 | } 51 | } // namespace geode 52 | -------------------------------------------------------------------------------- /src/geode/geometry/bitsery_input.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | void register_geometry_deserialize_pcontext( PContext& context ) 31 | { 32 | detail::register_geometry_pcontext< Deserializer >( context ); 33 | } 34 | } // namespace geode 35 | -------------------------------------------------------------------------------- /src/geode/geometry/bitsery_output.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | void register_geometry_serialize_pcontext( PContext& context ) 31 | { 32 | detail::register_geometry_pcontext< Serializer >( context ); 33 | } 34 | } // namespace geode 35 | -------------------------------------------------------------------------------- /src/geode/geometry/common.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | namespace geode 30 | { 31 | OPENGEODE_LIBRARY_IMPLEMENTATION( OpenGeodeGeometry ) 32 | { 33 | OpenGeodeBasicLibrary::initialize(); 34 | GEO::PCK::initialize(); 35 | BitseryExtensions::register_functions( 36 | register_geometry_serialize_pcontext, 37 | register_geometry_deserialize_pcontext ); 38 | } 39 | } // namespace geode 40 | -------------------------------------------------------------------------------- /src/geode/geometry/perpendicular.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | Vector2D perpendicular( const Vector2D& v ) 31 | { 32 | return Vector2D{ { v.value( 1 ), -v.value( 0 ) } }; 33 | } 34 | 35 | double dot_perpendicular( const Vector2D& v0, const Vector2D& v1 ) 36 | { 37 | return v0.dot( perpendicular( v1 ) ); 38 | } 39 | } // namespace geode 40 | -------------------------------------------------------------------------------- /src/geode/image/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 - 2025 Geode-solutions 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | # SOFTWARE. 20 | 21 | add_geode_library( 22 | NAME image 23 | FOLDER "geode/image" 24 | SOURCES 25 | "common.cpp" 26 | "core/bitsery_archive.cpp" 27 | "core/greyscale_color.cpp" 28 | "core/rgb_color.cpp" 29 | "core/raster_image.cpp" 30 | "io/raster_image_input.cpp" 31 | "io/raster_image_output.cpp" 32 | PUBLIC_HEADERS 33 | "common.hpp" 34 | "core/bitsery_archive.hpp" 35 | "core/greyscale_color.hpp" 36 | "core/raster_image.hpp" 37 | "core/rgb_color.hpp" 38 | "io/raster_image_input.hpp" 39 | "io/raster_image_output.hpp" 40 | "io/geode/geode_bitsery_raster_input.hpp" 41 | "io/geode/geode_bitsery_raster_output.hpp" 42 | PUBLIC_DEPENDENCIES 43 | ${PROJECT_NAME}::basic 44 | ) 45 | -------------------------------------------------------------------------------- /src/geode/mesh/core/coordinate_reference_system.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include 25 | 26 | #include 27 | 28 | namespace std 29 | { 30 | std::size_t hash< geode::CRSType >::operator()( 31 | const geode::CRSType& type ) const 32 | { 33 | return absl::Hash< std::string >{}( type.get() ); 34 | } 35 | } // namespace std 36 | -------------------------------------------------------------------------------- /src/geode/mesh/core/mesh_id.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include 25 | 26 | #include 27 | 28 | #include 29 | 30 | #include 31 | 32 | namespace std 33 | { 34 | std::size_t hash< geode::MeshImpl >::operator()( 35 | const geode::MeshImpl& impl ) const 36 | { 37 | return absl::Hash< std::string >{}( impl.get() ); 38 | } 39 | 40 | std::size_t hash< geode::MeshType >::operator()( 41 | const geode::MeshType& type ) const 42 | { 43 | return absl::Hash< std::string >{}( type.get() ); 44 | } 45 | } // namespace std 46 | -------------------------------------------------------------------------------- /src/geode/mesh/helpers/internal/copy.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include 25 | 26 | #include 27 | 28 | namespace geode 29 | { 30 | namespace internal 31 | { 32 | void copy_attributes( 33 | const AttributeManager& manager_in, AttributeManager& manager_out ) 34 | { 35 | absl::FixedArray< index_t > old2new( manager_in.nb_elements() ); 36 | async::parallel_for( 37 | async::irange( index_t{ 0 }, manager_in.nb_elements() ), 38 | [&old2new]( index_t i ) { 39 | old2new[i] = i; 40 | } ); 41 | manager_out.import( manager_in, old2new ); 42 | } 43 | } // namespace internal 44 | } // namespace geode 45 | -------------------------------------------------------------------------------- /src/geode/model/mixin/core/component_mesh_element.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include 25 | 26 | #include 27 | 28 | namespace std 29 | { 30 | size_t hash< geode::ComponentMeshElement >::operator()( 31 | const geode::ComponentMeshElement& cme ) const 32 | { 33 | return absl::Hash< geode::uuid >()( cme.component_id.id() ) 34 | ^ absl::Hash< geode::index_t >()( cme.element_id ); 35 | } 36 | } // namespace std -------------------------------------------------------------------------------- /src/geode/model/mixin/core/component_type.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include 25 | 26 | #include 27 | 28 | namespace std 29 | { 30 | size_t hash< geode::ComponentType >::operator()( 31 | const geode::ComponentType& type ) const 32 | { 33 | return absl::Hash< string >()( type.get() ); 34 | } 35 | 36 | size_t hash< geode::ComponentID >::operator()( 37 | const geode::ComponentID& id ) const 38 | { 39 | return absl::Hash< geode::uuid >()( id.id() ); 40 | } 41 | } // namespace std -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 - 2025 Geode-solutions 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | # SOFTWARE. 20 | 21 | cmake_minimum_required(VERSION 3.15) 22 | 23 | if(NOT TARGET OpenGeode::basic) 24 | project(OpenGeode CXX) 25 | find_package(OpenGeode REQUIRED CONFIG) 26 | find_package(Async++ REQUIRED CONFIG) 27 | enable_testing() 28 | endif() 29 | 30 | set(DATA_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/data) 31 | set(test_common_file_in ${CMAKE_CURRENT_LIST_DIR}/common.hpp.in) 32 | set(test_common_file ${PROJECT_BINARY_DIR}/geode/tests/common.hpp) 33 | configure_file(${test_common_file_in} ${test_common_file}) 34 | include_directories(${PROJECT_BINARY_DIR}) 35 | 36 | add_subdirectory(basic) 37 | add_subdirectory(geometry) 38 | add_subdirectory(image) 39 | add_subdirectory(mesh) 40 | add_subdirectory(model) 41 | -------------------------------------------------------------------------------- /tests/basic/test-permutation.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | void test() 30 | { 31 | std::vector< double > data{ 0.1, 0.2, 0.3, 0.4, 0.5 }; 32 | std::vector< geode::index_t > permutation{ 2, 4, 3, 0, 1 }; 33 | 34 | geode::permute( data, permutation ); 35 | std::vector< double > data_answer{ 0.3, 0.5, 0.4, 0.1, 0.2 }; 36 | OPENGEODE_EXCEPTION( data == data_answer, "[Test] Wrong permutation data" ); 37 | 38 | const auto old2new = geode::old2new_permutation( permutation ); 39 | std::vector< geode::index_t > answer_permutation{ 3, 4, 0, 2, 1 }; 40 | OPENGEODE_EXCEPTION( 41 | old2new == answer_permutation, "[Test] Wrong permutation old2new" ); 42 | } 43 | 44 | OPENGEODE_TEST( "permutation" ) 45 | -------------------------------------------------------------------------------- /tests/basic/test-uuid.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | 30 | void test() 31 | { 32 | for( const auto i : geode::Range{ 100 } ) 33 | { 34 | geode_unused( i ); 35 | const geode::uuid id; 36 | SDEBUG( id ); 37 | const geode::uuid id2; 38 | OPENGEODE_EXCEPTION( id2 != id, "[Test] UUIDs should be different" ); 39 | OPENGEODE_EXCEPTION( 40 | id2 < id || id < id2, "[Test] UUIDs should be different" ); 41 | const geode::uuid same{ id.string() }; 42 | OPENGEODE_EXCEPTION( id == same, "[Test] UUIDs should be equal" ); 43 | } 44 | } 45 | 46 | OPENGEODE_TEST( "uuid" ) -------------------------------------------------------------------------------- /tests/basic/test-zip-file.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2025 Geode-solutions 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | */ 23 | 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | void test() 32 | { 33 | const auto is_not_a_zip = geode::is_zip_file( 34 | absl::StrCat( geode::DATA_PATH, "triange.og_tsf3d" ) ); 35 | OPENGEODE_EXCEPTION( 36 | !is_not_a_zip, "[Test] Not a zip file detection failed" ); 37 | const auto is_a_zip = geode::is_zip_file( 38 | absl::StrCat( geode::DATA_PATH, "layers.og_brep" ) ); 39 | OPENGEODE_EXCEPTION( is_a_zip, "[Test] zip file detection failed" ); 40 | } 41 | 42 | OPENGEODE_TEST( "zip-file" ) -------------------------------------------------------------------------------- /tests/data/3patches.og_tsf2d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/3patches.og_tsf2d -------------------------------------------------------------------------------- /tests/data/Armadillo.og_tsf3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/Armadillo.og_tsf3d -------------------------------------------------------------------------------- /tests/data/box_brep.og_brep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/box_brep.og_brep -------------------------------------------------------------------------------- /tests/data/dangling.og_brep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/dangling.og_brep -------------------------------------------------------------------------------- /tests/data/fractures.og_sctn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/fractures.og_sctn -------------------------------------------------------------------------------- /tests/data/layers.og_brep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/layers.og_brep -------------------------------------------------------------------------------- /tests/data/modified_Armadillo.og_tsf3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/modified_Armadillo.og_tsf3d -------------------------------------------------------------------------------- /tests/data/old_regular_grid.og_rgd2d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/old_regular_grid.og_rgd2d -------------------------------------------------------------------------------- /tests/data/old_regular_grid.og_rgd3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/old_regular_grid.og_rgd3d -------------------------------------------------------------------------------- /tests/data/prism_curve.og_brep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/prism_curve.og_brep -------------------------------------------------------------------------------- /tests/data/quad.og_sctn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/quad.og_sctn -------------------------------------------------------------------------------- /tests/data/random_dfn.og_brep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/random_dfn.og_brep -------------------------------------------------------------------------------- /tests/data/relationships_v12/relationships: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/relationships_v12/relationships -------------------------------------------------------------------------------- /tests/data/structural_model.og_brep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/structural_model.og_brep -------------------------------------------------------------------------------- /tests/data/surface_degen.og_tsf3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/surface_degen.og_tsf3d -------------------------------------------------------------------------------- /tests/data/test_mesh3.og_brep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/test_mesh3.og_brep -------------------------------------------------------------------------------- /tests/data/test_v12.og_edc3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/test_v12.og_edc3d -------------------------------------------------------------------------------- /tests/data/test_v12.og_psf3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/test_v12.og_psf3d -------------------------------------------------------------------------------- /tests/data/test_v12.og_pso3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/test_v12.og_pso3d -------------------------------------------------------------------------------- /tests/data/test_v12.og_rgd3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/test_v12.og_rgd3d -------------------------------------------------------------------------------- /tests/data/test_v7.og_grp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/test_v7.og_grp -------------------------------------------------------------------------------- /tests/data/test_v7.og_psf3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/test_v7.og_psf3d -------------------------------------------------------------------------------- /tests/data/test_v7.og_pso3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/test_v7.og_pso3d -------------------------------------------------------------------------------- /tests/data/triangle.og_tsf3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geode-solutions/OpenGeode/fa33bc046caf093fc7a244e33c97ee46e79561ff/tests/data/triangle.og_tsf3d -------------------------------------------------------------------------------- /tests/image/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 - 2025 Geode-solutions 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | # SOFTWARE. 20 | 21 | add_geode_test( 22 | SOURCE "test-colors.cpp" 23 | DEPENDENCIES 24 | ${PROJECT_NAME}::image 25 | ) 26 | add_geode_test( 27 | SOURCE "test-raster-image.cpp" 28 | DEPENDENCIES 29 | ${PROJECT_NAME}::image 30 | ) 31 | -------------------------------------------------------------------------------- /tests/mesh/test-hausdorff-distance.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | void test() 15 | { 16 | geode::OpenGeodeMeshLibrary::initialize(); 17 | const auto initial_mesh_filename = 18 | absl::StrCat( geode::DATA_PATH, "Armadillo.og_tsf3d" ); 19 | const auto mesh_A = 20 | geode::load_triangulated_surface< 3 >( initial_mesh_filename ); 21 | const auto simplified_mesh_filename = 22 | absl::StrCat( geode::DATA_PATH, "modified_Armadillo.og_tsf3d" ); 23 | const auto mesh_B = 24 | geode::load_triangulated_surface< 3 >( simplified_mesh_filename ); 25 | 26 | const auto hausdorff_distance = 27 | geode::hausdorff_distance( *mesh_A, *mesh_B ); 28 | DEBUG( hausdorff_distance ); 29 | } 30 | 31 | OPENGEODE_TEST( "hausdorff-distance" ) --------------------------------------------------------------------------------