yade.bodiesHandling module

Miscellaneous functions, which are useful for handling bodies.

yade.bodiesHandling.facetsDimensions(idFacets=[], mask=-1)[source]

The function accepts the list of facet id’s or list of facets and calculates max and min dimensions, geometrical center.

Parameters:
  • idFacets (list) – list of spheres
  • mask (int) – Body.mask for the checked bodies
Returns:

dictionary with keys min (minimal dimension, Vector3), max (maximal dimension, Vector3), minId (minimal dimension facet Id, Vector3), maxId (maximal dimension facet Id, Vector3), center (central point of bounding box, Vector3), extends (sizes of bounding box, Vector3), number (number of facets, int),

yade.bodiesHandling.sphereDuplicate(idSphere)[source]

The functions makes a copy of sphere

yade.bodiesHandling.spheresModify(idSpheres=[], mask=-1, shift=Vector3(0, 0, 0), scale=1.0, orientation=Quaternion((1, 0, 0), 0), copy=False)[source]

The function accepts the list of spheres id’s or list of bodies and modifies them: rotating, scaling, shifting. if copy=True copies bodies and modifies them. Also the mask can be given. If idSpheres not empty, the function affects only bodies, where the mask passes. If idSpheres is empty, the function search for bodies, where the mask passes.

Parameters:
  • shift (Vector3) – Vector3(X,Y,Z) parameter moves spheres.
  • scale (float) – factor scales given spheres.
  • orientation (Quaternion) – orientation of spheres
  • mask (int) – Body.mask for the checked bodies
Returns:

list of bodies if copy=True, and Boolean value if copy=False

yade.bodiesHandling.spheresPackDimensions(idSpheres=[], mask=-1)[source]

The function accepts the list of spheres id’s or list of bodies and calculates max and min dimensions, geometrical center.

Parameters:
  • idSpheres (list) – list of spheres
  • mask (int) – Body.mask for the checked bodies
Returns:

dictionary with keys min (minimal dimension, Vector3), max (maximal dimension, Vector3), minId (minimal dimension sphere Id, Vector3), maxId (maximal dimension sphere Id, Vector3), center (central point of bounding box, Vector3), extends (sizes of bounding box, Vector3), volume (volume of spheres, Real), mass (mass of spheres, Real), number (number of spheres, int),