Shape Definitions¶
Shape definitions contain information about the shape of individual particles.
Some shapes define a type_shape
property, which returns a
dict
for consumption by visualization tools, in the format of
hoomd.hpmc.integrate.mode_hpmc.get_type_shapes()
.
-
class
garnett.shapes.
FallbackShape
[source]¶ This shape definition class is used when no specialized Shape class can be applied.
The fallback shape definition is a string containing the definition.
-
class
garnett.shapes.
Shape
(shape_class=None, color=None)[source]¶ Parent class of all shape objects.
Parameters: -
pos_string
¶
-
type_shape
¶
-
-
class
garnett.shapes.
SphereShape
(diameter, orientable=False, color=None)[source]¶ Shape class for spheres of a specified diameter.
Parameters: -
pos_string
¶
-
type_shape
¶
-
-
class
garnett.shapes.
ArrowShape
(thickness=0.1, color=None)[source]¶ Shape class for arrows of a specified thickness.
Parameters: -
pos_string
¶
-
type_shape
¶
-
-
class
garnett.shapes.
SphereUnionShape
(diameters, centers, colors=None)[source]¶ Shape class for sphere unions, such as rigid bodies of many spheres.
Parameters: -
pos_string
¶
-
type_shape
¶
-
-
class
garnett.shapes.
PolygonShape
(vertices, color=None)[source]¶ Shape class for polygons in a 2D plane.
Parameters: -
pos_string
¶
-
type_shape
¶
-
-
class
garnett.shapes.
SpheropolygonShape
(vertices, rounding_radius=0, color=None)[source]¶ Shape class for rounded polygons in a 2D plane.
Parameters: -
pos_string
¶
-
type_shape
¶
-
-
class
garnett.shapes.
ConvexPolyhedronShape
(vertices, color=None)[source]¶ Shape class for convex polyhedra.
Parameters: -
pos_string
¶
-
type_shape
¶
-
-
class
garnett.shapes.
ConvexPolyhedronUnionShape
(vertices, centers, orientations, colors=None)[source]¶ Shape class for unions of convex polyhedra.
Parameters: - vertices (list) – List of lists of 3D vertex vectors in particle coordinates (each polyhedron, each vertex).
- centers (list) – List of 3D polyhedra center vectors.
- orientations (list) – Orientations of the polyhedra, as a list of quaternions.
- colors (list) – List of hexadecimal color strings in format
RRGGBBAA
(default:None
).
-
pos_string
¶
-
type_shape
¶
-
class
garnett.shapes.
ConvexSpheropolyhedronShape
(vertices, rounding_radius=0, color=None)[source]¶ Shape class for a convex polyhedron extended by a rounding radius.
Parameters: -
pos_string
¶
-
type_shape
¶
-
-
class
garnett.shapes.
GeneralPolyhedronShape
(vertices, faces, color=None, facet_colors=None)[source]¶ Shape class for general polyhedra, such as arbitrary meshes.
Parameters: - vertices (list) – List of 3D vertex vectors.
- faces (list) – List of lists of integers representing vertex indices for each face.
- color (str) – Hexadecimal color string in format
RRGGBBAA
(default:None
). - facet_colors (list) – List of hexadecimal color strings in format
RRGGBBAA
for each facet (default:None
).
-
pos_string
¶
-
type_shape
¶