gpytoolbox icon indicating copy to clipboard operation
gpytoolbox copied to clipboard

A collection of utility functions to prototype geometry processing research in python

A Python Geometry Processing Toolbox

unit
tests unit
tests unit
tests PyPI

https://gpytoolbox.org

logo

Authors: Silvia Sellán, University of Toronto and Oded Stein, Massachusetts Institute of Technology

This is a very young library of general geometry processing Python research utility functions that evolves from our personal student codebases.

Installation

You should be able install the latest stable release of Gpytoolbox with pip:

python -m pip install gpytoolbox

A conda installation will be supported in the future

Documentation

You can find documentation for all our functions in our website. You can also view the documentation for a specific function by running help(function_name) or function_name.__doc__; for example,

>>> from gpytoolbox import grad
>>> help(grad)
Finite element gradient matrix

Given a triangle mesh or a polyline, computes the finite element gradient matrix assuming piecewise linear hat function basis.

Parameters
----------
V : numpy double array
    Matrix of vertex coordinates
F : numpy int array, optional (default None)
    Matrix of triangle indices

Returns
-------
G : scipy sparse.csr_matrix
    Sparse FEM gradient matrix

See Also
--------
cotangent_laplacian.

Notes
-----

Examples
--------
TO-DO

Contribute

We hope you find our current version of our library useful. At the same time, we encourage you to ask not what Gpytoolbox can do for you, but what you can do for Gpytoolbox.

Since Gpytoolbox is a very young library, we want to make it as easy as possible for others to contribute to it and help it grow. You can contribute by adding a new function in a new file inside src/gpytoolbox/, or by adding to existing functions, and submitting a Pull Request.

We also want to make the contribution process as unintimidating as possible. We will gladly review and edit your code to make sure it acommodates to our standards and we have set up many tests that will let us know if your contribution accidentally breaks anything. If there's any functionality that is not already in this library, is remotely related to geometry processing, and you have used or used in any of your past projects, we encourage you to submit it as-is in a Pull Request. We will gladly credit you in the individual function as well as on this home page.

License

Gpytoolbox's is released under an MIT license (see details), except for files in the gpytoolbox.copyleft module, which are under a GPL one (see details). Functions in the copyleft module must be imported explicitly; this way, if you import only the main Gpytoolbox module

import gpytoolbox

or individual functions from it,

from gpytoolbox import regular_square_mesh, regular_cube_mesh

you are only bound by the terms of the permissive MIT license. However, if you import any functionality from gpytoolbox.copyleft; e.g.,

from gpytoolbox.copyleft import mesh_boolean

you will be bound by the more restrictive GPL license.

Acknowledgements

Several people have, knowingly or unknowingly, greatly contributed to this library. We are thankful to them:

  • Alec Jacobson is the author of the original Matlab gptoolbox on which we inspired ourselves to create this library. Several of our functions are line-by-line translations of his Matlab ones. Thanks, Alec!

  • Nicholas Sharp, the author of the game-changing geometry visualization library polyscope, was extremely helpful in guiding us through setting up and distributing a Python package. Thanks, Nick!

TO-DO

  • Add examples to docstrings.
  • Implement tet mesh version of linear_elasticity_stiffness.py
  • Implement tet mesh version of linear_elasticity.py
  • Improve poisson_surface_reconstruction and make it 3D.
  • Random points on mesh.
  • Make in_element_aabb python implementation
  • Merge our squared_distance with libigl winding number and have logarithmic signed distances to mesh
  • Switch to pybind11
  • Port fracture modes code
  • Add tets to subdivide.py
  • angle_defect.py (which is zero at boundary vertices!)
  • dihedral_angles.py
  • Intrinsic Delaunay triangulation
  • Triangle-triangle distance and Hausdorff distance (with AABB)
  • Package for conda distribution
  • Add notes on every docstring mentioning libigl implementations