### Install DioDe from GitHub repository Source: https://github.com/mrzv/diode/blob/master/README.rst Install DioDe directly from its GitHub repository using pip. This command fetches the latest version from the main branch. ```bash pip install --verbose `git+https://github.com/mrzv/diode.git `_ ``` -------------------------------- ### Install DioDe using pip Source: https://github.com/mrzv/diode/blob/master/README.rst Install DioDe as a Python package using pip. The --verbose flag provides more detailed output during installation. ```bash pip install --verbose diode ``` -------------------------------- ### Configure pybind11 and Build Python Module Source: https://github.com/mrzv/diode/blob/master/bindings/python/CMakeLists.txt Sets pybind11 to find Python, finds the pybind11 package, adds a Python module named 'diode' from 'diode.cpp', links it with CGAL, and installs the target. ```cmake set(PYBIND11_FINDPYTHON ON) find_package(pybind11 CONFIG REQUIRED) pybind11_add_module (diode diode.cpp) target_link_libraries (diode PUBLIC CGAL::CGAL) install(TARGETS diode DESTINATION .) ``` -------------------------------- ### Clone DioDe repository Source: https://github.com/mrzv/diode/blob/master/README.rst Clone the DioDe repository from GitHub to build and install it manually. This command downloads the project's source code. ```bash git clone ``_ ``` -------------------------------- ### Build DioDe from source Source: https://github.com/mrzv/diode/blob/master/README.rst Build the DioDe project from its source code after cloning the repository. This involves creating a build directory, configuring with CMake, and compiling with make. ```bash mkdir build cd build cmake .. make ``` -------------------------------- ### Add Executable and Link CGAL Library for Periodic Alpha Shapes Source: https://github.com/mrzv/diode/blob/master/examples/CMakeLists.txt Sets up a CMake build for a periodic alpha shape generation executable, linking it with the CGAL library. This is necessary for projects dealing with periodic structures or data. ```cmake add_executable(generate_periodic_alpha_shape generate_periodic_alpha_shape.cpp) target_link_libraries(generate_periodic_alpha_shape CGAL::CGAL) ``` -------------------------------- ### Initialize Dionysus Filtration Source: https://github.com/mrzv/diode/blob/master/README.rst Create a Dionysus filtration object from the list of simplices generated by DioDe. This allows for further analysis of the topological structure. ```python import dionysus f = dionysus.Filtration(simplices) print(f) ``` -------------------------------- ### Add DioDe Python bindings to PYTHONPATH Source: https://github.com/mrzv/diode/blob/master/README.rst Configure your shell environment to use the Python bindings of DioDe. Add the build directory of the Python bindings to your PYTHONPATH environment variable. ```bash export PYTHONPATH=.../build/bindings/python:$PYTHONPATH ``` -------------------------------- ### Fill Delaunay Arrays (Combinatorics Only) Source: https://github.com/mrzv/diode/blob/master/README.rst Use this function when only the simplicial complex (Delaunay triangulation) is needed, skipping CGAL's per-simplex radius calculations for faster processing. The result is a list of NumPy arrays representing vertices for each dimension. ```python verts_by_dim = diode.fill_delaunay_arrays(points) ``` -------------------------------- ### Add Executable and Link CGAL Library for Weighted Alpha Shapes Source: https://github.com/mrzv/diode/blob/master/examples/CMakeLists.txt Configures a CMake build to create an executable for weighted alpha shape generation, ensuring it's linked against the CGAL library. Use this when your project requires weighted alpha shape computations. ```cmake add_executable(generate_weighted_alpha_shape generate_weighted_alpha_shape.cpp) target_link_libraries(generate_weighted_alpha_shape CGAL::CGAL) ``` -------------------------------- ### Add Executable and Link CGAL Library Source: https://github.com/mrzv/diode/blob/master/examples/CMakeLists.txt Defines an executable target for generating alpha shapes and links it with the CGAL library. This is a common pattern for building C++ applications that utilize CGAL functionalities. ```cmake add_executable(generate_alpha_shape generate_alpha_shape.cpp) target_link_libraries(generate_alpha_shape CGAL::CGAL) ``` -------------------------------- ### Generate weighted periodic alpha shapes in Python Source: https://github.com/mrzv/diode/blob/master/README.rst When using CGAL version 4.11 or later, `diode.fill_weighted_periodic_alpha_shapes` can be used to generate the alpha shape for a weighted point set on a periodic cube. ```python import diode import numpy as np weighted_points = np.random.random((100,4)) weighted_points[:,3] /= 64 simplices_weighted_periodic = diode.fill_weighted_periodic_alpha_shapes(weighted_points) ``` -------------------------------- ### Generate ordinary alpha shapes in Python Source: https://github.com/mrzv/diode/blob/master/README.rst Use the `diode.fill_alpha_shapes` function to generate a list of simplices and their alpha values from a NumPy array of 3D points. The output can be directly used to initialize a Dionysus filtration. ```python import diode import numpy as np points = np.random.random((100,3)) simplices = diode.fill_alpha_shapes(points) print(simplices) ``` -------------------------------- ### Generate periodic alpha shapes in Python Source: https://github.com/mrzv/diode/blob/master/README.rst Use `diode.fill_periodic_alpha_shapes` to compute the alpha shape for a point set on a periodic cube. The function handles potential duplicate simplices reported by CGAL by passing the result to `dionysus.Filtration`. ```python import diode import dionysus points = np.random.random((100,3)) simplices_periodic = diode.fill_periodic_alpha_shapes(points) f_periodic = dionysus.Filtration(simplices_periodic) print(f_periodic) for s in f_periodic: print(s) ``` -------------------------------- ### Generate weighted alpha shapes in Python Source: https://github.com/mrzv/diode/blob/master/README.rst Use the `diode.fill_weighted_alpha_shapes` function to generate simplices and their alpha values from a NumPy array of 4D points (including weights). This is useful for weighted alpha shape computations. ```python import diode import numpy as np weighted_points = np.random.random((100,4)) simplices2 = diode.fill_weighted_alpha_shapes(weighted_points) print(simplices2) ``` -------------------------------- ### Compute circumcenter of a tetrahedron in Python Source: https://github.com/mrzv/diode/blob/master/README.rst Use the `diode.circumcenter` function to calculate the circumcenter of a 3D tetrahedron represented by a NumPy array of its vertices. ```python import diode import numpy as np tet = np.random.random((4,3)) center = diode.circumcenter(tet) print(center) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.