dem.utils¶
Overview
Details
Various helper utilities for geometry.

hoomd.dem.utils.
area
(vertices, factor=1.0)¶ Computes the signed area of a polygon in 2 or 3D.
Parameters:

hoomd.dem.utils.
center
(vertices, faces=None)¶ Centers shapes in 2D or 3D.
Parameters: Returns a list of vertices shifted to have the center of mass of the given points at the origin. Shapes should be specified in righthanded order. If the input shape has no mass, return the input.
Warning
All faces should be specified in righthanded order.

hoomd.dem.utils.
convexHull
(vertices, tol=1e06)¶ Compute the 3D convex hull of a set of vertices and merge coplanar faces.
Parameters: Returns an array of vertices and a list of faces (vertex indices) for the convex hull of the given set of vertice.
Note
This method uses scipy’s quickhull wrapper and therefore requires scipy.

hoomd.dem.utils.
massProperties
(vertices, faces=None, factor=1.0)¶ Compute the mass, center of mass, and inertia tensor of a polygon or polyhedron
Parameters: Returns (mass, center of mass, moment of inertia tensor in (xx, xy, xz, yy, yz, zz) order) specified by the given list of vertices and faces. Note that the faces must be listed in a consistent order so that normals are all pointing in the correct direction from the face. If given a list of 2D vertices, return the same but for the 2D polygon specified by the vertices.
Warning
All faces should be specified in righthanded order.
The computation for the 3D case follows “Polyhedral Mass Properties (Revisited) by David Eberly, available at:
http://www.geometrictools.com/Documentation/PolyhedralMassProperties.pdf

hoomd.dem.utils.
rmax
(vertices, radius=0.0, factor=1.0)¶ Compute the maximum distance among a set of vertices
Parameters:

hoomd.dem.utils.
spheroArea
(vertices, radius=1.0, factor=1.0)¶ Computes the area of a spheropolygon.
Parameters: