coxeter.shape_getters module¶
This module defines various convenience functions for generating shapes.
The methods here provide routes for generating instances of
Shape based on certain pre-specified mappings.
Classes:
|
A circle with the given radius. |
|
A convex polygon. |
|
A convex polyhedron. |
|
A convex spheropolygon. |
|
A convex spheropolyhedron. |
|
An ellipse with principal axes a and b. |
|
An ellipsoid with principal axes a, b, and c. |
|
A simple (non-self-overlapping) polygon. |
|
A three-dimensional polytope. |
|
A sphere with the given radius. |
Functions:
|
Create a |
-
coxeter.shape_getters.from_gsd_type_shapes(params, dimensions=3)¶ Create a
Shapefrom a dict conforming to the GSD schema.See here for the specification of the schema. Note that the schema does not differentiate between 2D and 3D shapes for spheres (vs. circles) and ellipsoids (vs. ellipses) because in context the dimensionality of those shapes can be inferred from simulation boxes. To address this ambiguity, this function accepts a
dimensionsparameter that can be used to disambiguate explicitly between these two cases.- Parameters
params (dict) – The parameters of the shape to construct.
dimensions (int) – The dimensionality of the shape (either 2 or 3). Ignored except when the shape is a sphere or an ellipsoid, in which case a value of 2 is used to indicate generating a
CircleorEllipseinstead of aSphereorEllipsoid(Default value: 3).
- Returns
The desired shape.
- Return type