{"id":9768,"library":"geode-explicit","title":"Geode-solutions Explicit Models","description":"geode-explicit is the OpenGeode module from Geode-solutions for defining and manipulating explicit geometric models, such as regular grids and explicit solids, within a 3D space. It is part of a larger ecosystem of C++ and Python libraries for geometric modeling. The library is actively maintained with frequent updates and bug fixes, typically following a rapid release cadence for the Geode-solutions ecosystem, with the current version being 7.0.7.","status":"active","version":"7.0.7","language":"en","source_language":"en","source_url":"https://github.com/Geode-solutions/geode-explicit","tags":["geometry","CAD","modeling","geospatial","3D","scientific-computing"],"install":[{"cmd":"pip install geode-explicit","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"symbol":"RegularGrid","correct":"from geode_explicit import RegularGrid"},{"symbol":"ExplicitSolid","correct":"from geode_explicit import ExplicitSolid"},{"note":"Common utility class from the geode_common package, a core dependency.","symbol":"Point3D","correct":"from geode_common import Point3D"}],"quickstart":{"code":"import os\nfrom geode_explicit import RegularGrid\nfrom geode_common import Point3D, BoundingBox\n\n# Define the bounding box for the grid\nmin_point = Point3D([0.0, 0.0, 0.0])\nmax_point = Point3D([10.0, 10.0, 10.0])\ngrid_bbox = BoundingBox(min_point, max_point)\n\n# Create a 3D regular grid with 10x10x10 cells\ngrid_dimensions = [10, 10, 10]\ngrid = RegularGrid(grid_bbox, grid_dimensions)\n\nprint(f\"Created a RegularGrid with {grid.nb_cells()} cells.\")\nprint(f\"Grid origin: {grid.grid_origin()}\")\nprint(f\"Grid cell size: {grid.cell_size()}\")\n\n# Save the grid to a file\noutput_filename = \"my_regular_grid.grd\"\ngrid.save_regular_grid(output_filename)\nprint(f\"Grid saved to {output_filename}\")\n\n# Load the grid from the file\nloaded_grid = RegularGrid.load_regular_grid(output_filename)\nprint(f\"Loaded a RegularGrid with {loaded_grid.nb_cells()} cells.\")\n\n# Clean up the created file\nos.remove(output_filename)","lang":"python","description":"This quickstart demonstrates how to create a 3D `RegularGrid` from a bounding box, save it to a file, and then load it back. It utilizes common utility classes like `Point3D` and `BoundingBox` from `geode-common`."},"warnings":[{"fix":"Refer to the official Geode-solutions documentation and release notes for version 7.x for updated API details. Update import paths, class instantiations, and method calls accordingly.","message":"The Geode-solutions ecosystem, including `geode-explicit`, underwent significant refactoring for version 7.x. Users migrating from 6.x should expect breaking API changes, particularly in class names, constructor arguments, and method signatures.","severity":"breaking","affected_versions":"6.x to 7.x"},{"fix":"When encountering cryptic errors, check the input data for validity (e.g., non-degenerate geometries, correct dimensions) and refer to the Geode-solutions C++ documentation for deeper insight into specific functions.","message":"`geode-explicit` is built on top of C++ libraries. While `pip` handles most dependencies, error messages can sometimes be low-level C++ exceptions (e.g., `std::runtime_error`) which are less descriptive than typical Python errors. Debugging may require familiarity with underlying geometric concepts.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your Python environment meets the `requires_python` specification. Use a virtual environment manager like `conda` or `venv` to create an environment with a compatible Python version.","message":"The library has strict Python version requirements (`>=3.9, <3.13`). Attempting to install or use `geode-explicit` with unsupported Python versions will lead to installation failures or runtime errors due to pre-compiled C++ bindings.","severity":"breaking","affected_versions":"All versions"},{"fix":"Always install `geode-explicit` in a clean virtual environment or ensure all `geode-*` packages are updated to their latest compatible versions using `pip install --upgrade geode-solutions` (which attempts to upgrade the entire ecosystem).","message":"`geode-explicit` relies on a large ecosystem of other `geode-*` packages (e.g., `geode-common`, `geode-model`). While `pip` manages these dependencies, ensuring all `geode-*` packages in your environment are of compatible versions is crucial. An incompatibility in one package can lead to runtime issues or crashes in `geode-explicit`.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Update your import statement to `from geode_explicit import RegularGrid` (or the respective class name).","cause":"Incorrect or outdated import path. For `geode-explicit` v7.x, many core classes are directly exposed under the top-level `geode_explicit` module.","error":"ImportError: cannot import name 'RegularGrid' from 'geode_explicit.regular_grid'"},{"fix":"Consult the `geode-explicit` v7.x documentation for the correct method name. For this specific case, `grid.nb_cells()` is the correct equivalent.","cause":"This method name (or similar) was likely used in older versions (e.g., 6.x) and has been renamed or replaced in 7.x.","error":"AttributeError: 'RegularGrid' object has no attribute 'get_cells_number'"},{"fix":"Verify your Python version is between 3.9 and 3.12 (inclusive). If not, switch to a supported Python version. Also check internet connectivity and PyPI availability.","cause":"The Python version in use is not supported by `geode-explicit`, or the package index cannot be reached.","error":"ERROR: No matching distribution found for geode-explicit"},{"fix":"Examine the exact C++ error message for clues. Check your input data (e.g., bounding box coordinates, grid dimensions) for validity and consistency. Simplify the problem or provide more robust input to narrow down the cause.","cause":"This is a generic error indicating an issue within the underlying Geode C++ library, often due to invalid input data, memory constraints, or unexpected geometric configurations.","error":"RuntimeError: OpenGeode error: Error message from underlying C++ library"}]}