pySTDLM.CellArranger#

Functions

setLMLogConsole([level])

Set the logger to write to the console as the code is working

setLMLogFile(filename[, level])

Set up file handler to print log to file

setLMLoggerLevel(level)

Set the level of the logger for the application

Classes

BoxCell([p1, p2])

A representation for a spherical cell.

CapsuleCell([p1, p2, radius, length])

A representation for a spherical cell.

CapsuleShellCell([p1, p2, radius, length])

A representation for a spherical cell.

CellArranger([cellType, cellAttributes, ...])

A base class for laying out cells in a 3D space.

CellShape()

Base class for a particular cell type for use in CellArranger (and later more)

LooseGridArranger(cellType, cellAttributes, ...)

An arranger that orients cells in square grid with padding in between.

RandomArranger(cellType, cellAttributes, ...)

An arranger that randomly orients a number of cells in a regin until either a count or a volume fraction target is met.

RandomSphericalArranger(cellType, ...)

An arranger that randomly orients a number of cells in a sphere inside a regin until either a count or a volume fraction target is met.

SphereCell([origin, radius])

A representation for a spherical cell.

TightGridArranger(cellType, cellAttributes, ...)

An arranger that orients cells in square grid.

class pySTDLM.CellArranger.CellArranger(cellType=None, cellAttributes=None, arrangerAttributes=None, name='Unknown')[source]#

Bases: object

A base class for laying out cells in a 3D space.

Parameters:
  • cellType – The type of cell this packer represents, can be one of: [“Sphere”, “Capsule”, “Box”, “CapsuleShell”]

  • cellAttributes – A dictionary with the required attributes specified for the cell and the form

  • arrangerAttributes – A dictionary with the required/optional requirements for the individiual arranger

addToSimulation(sim)[source]#
cellFactory()[source]#
packVolume(sim, volume=None)[source]#

Pack a specified volume with cells

Parameters:
  • volume – A volume specified as [[xmin,ymin,zmin],[xmax,ymax,zmax]] (TODO: Add angles)

  • form – The form of the packing, which can one of: [“Random”, “RandomSpherical”, “TightGrid”, “LooseGrid”, “SkewedGrid”]

Returns:

A tuple of the form [volumePacked, volumePercent, numberCells]

class pySTDLM.CellArranger.LooseGridArranger(cellType, cellAttributes, arrangerAttributes)[source]#

Bases: CellArranger

An arranger that orients cells in square grid with padding in between.

The attribute dictionary requires “offset” which is a list of the form [dx, dy, dz].

addToSimulation(sim)#
cellFactory()#
intPackVolume(sim, mins, maxs)[source]#
packVolume(sim, volume=None)#

Pack a specified volume with cells

Parameters:
  • volume – A volume specified as [[xmin,ymin,zmin],[xmax,ymax,zmax]] (TODO: Add angles)

  • form – The form of the packing, which can one of: [“Random”, “RandomSpherical”, “TightGrid”, “LooseGrid”, “SkewedGrid”]

Returns:

A tuple of the form [volumePacked, volumePercent, numberCells]

class pySTDLM.CellArranger.RandomArranger(cellType, cellAttributes, arrangerAttributes)[source]#

Bases: CellArranger

An arranger that randomly orients a number of cells in a regin until either a count or a volume fraction target is met.

This class requires either “fraction” or “number” attributes specified in the arrangerAttributes. It also has an optional parameter “padding” which maintains that much padding between the cells and their neighbors.

addToSimulation(sim)#
cellFactory()#
doesIntersect(b1, b2)[source]#
intPackVolume(sim, mins, maxs)[source]#
newBBox(bbox, padding)[source]#
outsideDomain(b1, mins, maxs)[source]#
packVolume(sim, volume=None)#

Pack a specified volume with cells

Parameters:
  • volume – A volume specified as [[xmin,ymin,zmin],[xmax,ymax,zmax]] (TODO: Add angles)

  • form – The form of the packing, which can one of: [“Random”, “RandomSpherical”, “TightGrid”, “LooseGrid”, “SkewedGrid”]

Returns:

A tuple of the form [volumePacked, volumePercent, numberCells]

class pySTDLM.CellArranger.RandomSphericalArranger(cellType, cellAttributes, arrangerAttributes)[source]#

Bases: CellArranger

An arranger that randomly orients a number of cells in a sphere inside a regin until either a count or a volume fraction target is met.

This class requires either “fraction” or “number” attributes specified in the arrangerAttributes. It also has an optional parameter “padding” which maintains that much padding between the cells and their neighbors.

addToSimulation(sim)#
cellFactory()#
intPackVolume(sim, mins, maxs)[source]#
packVolume(sim, volume=None)#

Pack a specified volume with cells

Parameters:
  • volume – A volume specified as [[xmin,ymin,zmin],[xmax,ymax,zmax]] (TODO: Add angles)

  • form – The form of the packing, which can one of: [“Random”, “RandomSpherical”, “TightGrid”, “LooseGrid”, “SkewedGrid”]

Returns:

A tuple of the form [volumePacked, volumePercent, numberCells]

class pySTDLM.CellArranger.TightGridArranger(cellType, cellAttributes, arrangerAttributes)[source]#

Bases: CellArranger

An arranger that orients cells in square grid.

addToSimulation(sim)#
cellFactory()#
intPackVolume(sim, mins, maxs)[source]#
packVolume(sim, volume=None)#

Pack a specified volume with cells

Parameters:
  • volume – A volume specified as [[xmin,ymin,zmin],[xmax,ymax,zmax]] (TODO: Add angles)

  • form – The form of the packing, which can one of: [“Random”, “RandomSpherical”, “TightGrid”, “LooseGrid”, “SkewedGrid”]

Returns:

A tuple of the form [volumePacked, volumePercent, numberCells]