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 methodscontains,volume,reduce,Polytope.from_points;sum([p1, p2, ...])worksConversions (
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, clearValueErrorfor empty or unbounded sets; newalgorithms.convex_hull_representationsandalgorithms.minkowski_sum_verticeshyper_plane_shift_methodsupports rank deficient matrices (e.g. the velocity polytope of a planar robot in 3D) and 1D outputsICHM (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 (
dwas[max, -max])Optional compiled backend
pycapacity-cpp(foldercpp/): HPSM, VEPOLI2, ICHM and the H->V conversion in C++, used automatically when installed (algorithms.set_backend), plus a general polytope projectionpycapacity_cpp.project_polytope- see the C++ acceleration pageNew examples:
examples/scripts/polytope_operations.py,backend_comparison.py,general_projection.pyPolytopes as constraints in control: new examples in
examples/controlusing 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 docsreachable_space_approximation: fixed the half-space representation for a nonzero initial positionx0(ddid not include the shift byx0)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_descriptionscvxopt 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 throughcvxoptfor 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
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
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_ballmethod)
Visualisation tools - see API docs
plot_polytopefunction now hascolorparemeter that can be used to setface_colorandedge_colorandvertex_colorat 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 docsContains 4 dof planar robot model - see docs
In future it will contain more toy models, for jump starting the library usage
More examples
examplesfolder now contains more examples on how to use the librarypython scripts - see scripts
jupyter notebooks - see notebooks
benchmarking scripts - see scripts
More example in the docs - see docs
Journal of OpenSource software submission:
pycapacitypaper is submitter to the Journal of OpenSource software - see paper
Improved the docs with more infomation about the library
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_polytopefunction for plotting polytopesFunctions
plot_polytope_vertexandplot_polytope_facesnow can receive a polytope objectFunction
plot_ellipsoidnow can receive a ellipsoid objectBetter management of the
matplotlibfigures and axes, now user can provide anax,pltorfigureto 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