Changelog

See github releases and pypi for more info.

If wanting to use a specific version of the library, you can install it using pip, for example version 1.2.17:

pip install pycapacity==1.2.17

V3.0 (11-2026)

  • Polytope operations: the Minkowski sum is computed with one convex hull of the vertex sums and returns only the vertices (it used to go through the half-plane representation and could return boundary points that are not vertices); new operators p + x / p - x (translation), a * p (scaling), R @ p (linear map), and methods contains, volume, reduce, Polytope.from_points; sum([p1, p2, ...]) works

  • Conversions (vertex_to_hspace, hspace_to_vertex, find_from_point_cloud): one inequality per facet (the triangles of a facet used to give one inequality each), each vertex once, flat (lower dimensional) polytopes supported, clear ValueError for empty or unbounded sets; new algorithms.convex_hull_representations and algorithms.minkowski_sum_vertices

  • hyper_plane_shift_method supports rank deficient matrices (e.g. the velocity polytope of a planar robot in 3D) and 1D outputs

  • ICHM (Python): fixed the facet keys (facets whose normals are permutations of each other were skipped, which could miss part of the polytope) and the 1D half-plane representation (d was [max, -max])

  • Optional compiled backend pycapacity-cpp (folder cpp/): HPSM, VEPOLI2, ICHM and the H->V conversion in C++, used automatically when installed (algorithms.set_backend), plus a general polytope projection pycapacity_cpp.project_polytope - see the C++ acceleration page

  • New examples: examples/scripts/polytope_operations.py, backend_comparison.py, general_projection.py

  • Polytopes as constraints in control: new examples in examples/control using the half-space representation in QPs and LPs: two robots sharing a workspace (reachable space), human-robot load sharing, two robots carrying a box, time-optimal motion along a path, each with a minimal version - see docs

  • reachable_space_approximation: fixed the half-space representation for a nonzero initial position x0 (d did not include the shift by x0)

  • visual.plot_polytope: faster 3D drawing (all the faces in one collection)

  • Docs: the tutorials are split into pages for robots, human models, polytopes and control

  • Pinocchio examples and tutorials load the robots with robot_descriptions

  • cvxopt is now optional: the LPs of the Python implementation (ICHM, Chebyshev ball, human.torque_to_muscle_force) use HiGHS (highspy, new dependency, wheels for all platforms) and GLPK through cvxopt for small problems when it is installed (pip install pycapacity[cvxopt]); algorithms.set_lp_solver("glpk" | "highs" | "auto"). torque_to_muscle_force(..., options="qp") still needs cvxopt.

  • Upgrading from v2: the functions keep their names, arguments and return types. Half-space representations computed from vertices can have fewer rows (one per facet instead of one per triangle), and the Minkowski sum returns only the vertices of the sum. The polytopes are the same, except where v2 was wrong (see the fixes above).

V2.1.7 (02-2025)

  • Added support examples for interfacing pycapacity with mujoco - see example

  • Added a support for real-time polyotpe visualisation in mujoco

Reachable space of a robot in MuJoCo Polytopes of an xArm7 robot in MuJoCo

V2.1.6 (02-2025)

  • Added the initial implementation for the non-convex reachable workspace approximation - see API docs

  • In order to use it you need to install CGAL library with its python bindings - if not installed the algorihtm will only be available in the convex mode

  • See the example in tutorials - see example

Reachable space of a robot

V2.1.5 (02-2025)

  • Added the initial implementation of the non-linear reachable workspace approximation - see API docs

v2.1.4 (12-2024)

  • BUGFIX: acceleration ellipsoid inverted limits

v2.1.3 (11-2024)

  • Reachable space approximation polytope now allows for specifying additional Cartesian space constraints - see API docs

v2.1 (09-2023)

  • Polytope class - see API docs

    • Added Minkowski sum (operator +) and intersection operations (operator &)

    • Added inner approximation using the Chebyshev ball (chebyshev_ball method)

  • Visualisation tools - see API docs

    • plot_polytope function now has color paremeter that can be used to set face_color and edge_color and vertex_color at once - see docs

  • Algorithms: - see API docs

    • Added Chebyshev ball algorithm (chebyshev_ball) - see docs

  • Human metrics - see API docs

    • Added ellipsoid: metrics acceleration, velocity and force

  • New module added: pycapacity.examples - see API docs

    • Contains 4 dof planar robot model - see docs

    • In future it will contain more toy models, for jump starting the library usage

  • More examples

  • Journal of OpenSource software submission:

    • pycapacity paper is submitter to the Journal of OpenSource software - see paper

  • Improved the docs with more infomation about the library

    • Implemented polytope algorithms and their performance - see docs

    • Implemented capacity metrics - see docs

v2.0 (05-2023)

  • Polytope and ellipsoid algorithms now return Polytope and Ellipsoid objects

    • Polytope class can be used as a standalone class to find vertex \(\mathcal{V}\), halfplane \(\mathcal{H}\) and face \(\mathcal{F}\) representation of a polytope

  • Visualisation tools improved:

    • New plot_polytope function for plotting polytopes

    • Functions plot_polytope_vertex and plot_polytope_faces now can receive a polytope object

    • Function plot_ellipsoid now can receive a ellipsoid object

    • Better management of the matplotlib figures and axes, now user can provide an ax, plt or figure to the plotting functions

  • Added support for robot reachable workspace approximation using convex polytopes (see API docs)

  • Added unit testing + continuous integration

  • Improved docs with sphinx