Tissue Forge Library Python API Reference
This is the API Reference page for the module: tissue_forge
- tissue_forge.init(*args, **kwargs)
Initialize a simulation in Python
- Parameters:
args (PyObject) – positional arguments; first argument is name of simulation (if any)
kwargs (PyObject) –
keyword arguments; currently supported are
dim: (3-component list of floats) the dimensions of the spatial domain; default is [10., 10., 10.]
cutoff: (float) simulation cutoff distance; default is 1.
cells: (3-component list of ints) the discretization of the spatial domain; default is [4, 4, 4]
threads: (int) number of threads; default is hardware maximum
flux_steps: (int) number of flux steps per simulation step; default is 1
integrator: (int) simulation integrator; default is FORWARD_EULER
dt: (float) time discretization; default is 0.01
bc: (int or dict) boundary conditions; default is everywhere periodic
window_size: (2-component list of ints) size of application window; default is [800, 600]
throw_exc: (bool) whether errors raise exceptions; default is False
seed: (int) seed for pseudo-random number generator
load_file: (str) path to saved simulation state to initialize
logger_level: (int) logger level; default is no logging
clip_planes: (list of tuple of (FVector3, FVector3)) list of point-normal pairs of clip planes; default is no planes
- tissue_forge.run(*args, **kwargs)
Runs the event loop until all windows close or simulation time expires. Automatically performs universe time propogation.
- Parameters:
args (float) – final time (default runs infinitly)
- tissue_forge.irun()
Alias of
tissue_forge.tissue_forge.Simulator.irun
- tissue_forge.close()
Alias of
tissue_forge.tissue_forge.Simulator.close
- tissue_forge.show()
Alias of
tissue_forge.tissue_forge.Simulator.show
- tissue_forge.step(until: float = 0)
Alias of
tissue_forge.tissue_forge.Universe.step
- tissue_forge.stop()
Alias of
tissue_forge.tissue_forge.Universe.stop
- tissue_forge.start()
Alias of
tissue_forge.tissue_forge.Universe.start
- tissue_forge.throw_exceptions(_throw: bool)
Set whether errors result in exceptions
- tissue_forge.throwing_exceptions() bool
Test whether errors result in exceptions
- class tissue_forge.version
- build_date
Package build date
- compiler
Package compiler ID
- compiler_version
Package compiler version
- major
Tissue Forge major version
- minor
Tissue Forge minor version
- patch
Tissue Forge patch version
- system_name
System name
- system_version
System version
- version
Tissue Forge version
- tissue_forge.has_cuda
- Type:
boolean
Flag signifying whether CUDA support is installed.
Simulator
- class tissue_forge.SimulatorInterface
- static close()
Closes the main window, while the application / simulation continues to run.
- property cuda_config
CUDA runtime interface, if any
- static irun()
Interactive python version of the run loop. This checks the ipython context and lets ipython process keyboard input, while we also running the simulator and processing window messages.
- static redraw()
Redraw the scene
- static run(*args, **kwargs)
Runs the event loop until all windows close or simulation time expires. Automatically performs universe time propogation.
- Parameters:
args (double) – final time (default runs infinitly)
- static show()
Shows any windows that were specified in the config. This works just like MatPlotLib’s
show
method. Theshow
method does not start the universe time propagation unlikerun
andirun
.
- property threads: int
Number of threads
- property throw_exceptions: bool
Whether errors result in exceptions
- tissue_forge.Simulator
- Type:
Simulator runtime interface
Universe
- class tissue_forge.UniverseInterface
- property angles
All angles in the universe
- property bonds
All bonds in the universe
- property boundary_conditions
Boundary conditions
- property cutoff: float
Global interaction cutoff distance
- property dihedrals
All dihedrals in the universe
- property dt
Time step
- property flux_steps: int
Number of flux steps per simulation step
- grid(shape)
Gets a three-dimesional array of particle lists, of all the particles in the system.
- Parameters:
shape – shape of grid
- Returns:
three-dimension array of particle lists according to discretization and location
- property kinetic_energy
Universe kinetic energy
- property name: str
name of the model / script
- property num_types: int
Number of particle types
- property particles
Gets all particles in the universe
- Return type:
- reset_species()
Reset all species in all particles
- start()
Starts the universe time evolution, and advanced the universe forward by timesteps in
dt
. All methods to build and manipulate universe objects are valid whether the universe time evolution is running or stopped.
- step(until: float = 0)
Performs a single time step of the universe if no arguments are given. Optionally runs until
until
.- Parameters:
until – runs the timestep for this length of time, optional.
- stop()
Stops the universe time evolution. This essentially freezes the universe, everything remains the same, except time no longer moves forward.
- property temperature
Universe temperature
- property time
Current time
- virial(origin=None, radius: float | None = None, types=None) fMatrix3
Computes the virial tensor for the either the entire simulation domain, or a specific local virial tensor at a location and radius. Optionally can accept a list of particle types to restrict the virial calculation for specify types.
- Parameters:
origin – An optional length-3 array for the origin. Defaults to the center of the simulation domain if not given.
radius – An optional number specifying the size of the region to compute the virial tensor for. Defaults to the entire simulation domain.
types – An optional list of
Particle
types to include in the calculation. Defaults to every particle type.
- Returns:
virial tensor
- property volume: float
Universe volume
- tissue_forge.Universe
- Type:
Universe runtime interface
Boundary Conditions
- class tissue_forge.BoundaryCondition
A condition on a boundary of the universe.
- property kind_str: str
The name of the kind of boundary condition.
- restore
restoring percent.
When objects hit this boundary, they get reflected back at restore percent, so if restore is 0.5, and object hitting the boundary at 3 length / time recoils with a velocity of 1.5 lengths / time.
- velocity
the velocity on the boundary
- name
name of the boundary
- normal
vector normal to the boundary
- class tissue_forge.BoundaryConditions(*args)
The BoundaryConditions class serves as a container for the six instances of the
BoundaryCondition
object- left
The left boundary
- right
The right boundary
- front
The front boundary
- back
The back boundary
- bottom
The bottom boundary
- top
The top boundary
- toString() std::string
Get a JSON string representation
- Return type:
string
- Returns:
std::string
Constants
Geometry Constants
Boundary Condition Constants
- tissue_forge.BOUNDARY_NONE
no boundary conditions
- tissue_forge.PERIODIC_X
periodic in the x (first) direction
- tissue_forge.PERIODIC_Y
periodic in the y (second) direction
- tissue_forge.PERIODIC_Z
periodic in the z (third) direction
- tissue_forge.PERIODIC_FULL
periodic in the all directions
- tissue_forge.FREESLIP_X
free slip in the x (first) direction
- tissue_forge.FREESLIP_Y
free slip in the y (second) direction
- tissue_forge.FREESLIP_Z
free slip in the z (third) direction
- tissue_forge.FREESLIP_FULL
free slip in the all directions
Integrator Constants
- tissue_forge.FORWARD_EULER
Integrator constant: Forward Euler.
Recommended, most tested, standard single-step.
- tissue_forge.RUNGE_KUTTA_4
Integrator constant: Runge-Kutta.
Experimental Runge-Kutta-4.
Particle Dynamics Constants
- tissue_forge.Newtonian
Newtonian dynamics.
- tissue_forge.Overdamped
Overdamped dynamics.
Potential Constants
- tissue_forge.Potential.Kind.potential
Potential kind
- tissue_forge.Potential.Kind.dpd
Dissipative particle dynamics kind
Particles and Clusters
- class tissue_forge.Particle
The particle data structure.
Instance vars for each particle.
Note that the arrays for
x
,v
andf
are 4 entries long for proper alignment.All particles are stored in a series of contiguous blocks of memory that are owned by the space cells. Each space cell has a array of particle structs.
If you’re building a model, you should probably instead be working with a ParticleHandle.
- handle() TissueForge::ParticleHandle *
Get a handle for this particle.
- toString() std::string
Get a JSON string representation
- static fromString(str: std::string const &) TissueForge::Particle *
Create from a JSON string representation.
The returned particle is not automatically registered with the engine.
To properly register a particle from a string, pass the string to the particle constructor of the appropriate particle type or cluster.
- Parameters:
str (string) – constructor string, as returned by toString
- Return type:
- Returns:
unregistered particle
- __reduce__()
Helper for pickle.
- class tissue_forge.ParticleHandle(*args)
A handle to a particle.
The engine allocates particle memory in blocks, and particle values get moved around all the time, so their addresses change.
The partlist is always ordered by id, i.e. partlist[id] always points to the same particle, even though that particle may move from cell to cell.
This is a safe way to work with a particle.
- property charge
Particle charge
- property mass
Particle mass
- property frozen
Particle frozen flag
- property frozen_x
Particle frozen flag along x
- property frozen_y
Particle frozen flag along y
- property frozen_z
Particle frozen flag along z
- property style
Particle style
- property age
Particle age
- property radius
Particle radius
- property volume
Particle volume
- property name
Particle name
- property position
Particle position
- property velocity
Particle velocity
- property force
Net force acting on particle
- property force_init
Persistent force acting on particle
- property id
Particle id
- property type_id
Particle type id
- property cluster_id
Cluster particle id, if any; -1 if particle is not in a cluster
- property species
Particle species
- property bonds
Bonds attached to particle
- property angles
Angles attached to particle
- property dihedrals
Dihedrals attached to particle
- part() TissueForge::Particle *
Gets the actual particle of this handle.
- Return type:
- Returns:
particle, if available
- get() TissueForge::Particle *
Gets the actual particle of this handle.
Alias for consistency with other objects.
- type() TissueForge::ParticleType *
Gets the particle type of this handle.
- split(*args) TissueForge::ParticleHandle *
Overload 1:
Splits a single particle into two and returns the new particle.
- Return type:
- Returns:
new particle
Overload 2:
Splits a single particle into two along a direction.
- Parameters:
direction (
FVector3
) – direction along which the particle is split.- Return type:
- Returns:
new particle
- destroy() HRESULT
Destroys the particle and removes it from inventory.
Subsequent references to a destroyed particle result in an error.
- sphericalPosition(particle: Particle = None, origin: fVector3 = None) TissueForge::FVector3
Calculates the particle’s coordinates in spherical coordinates.
By default, calculations are made with respect to the center of the universe.
- virial(radius: FPTYPE * = None) TissueForge::FMatrix3
Computes the virial tensor. Optionally pass a distance to include a neighborhood.
- Parameters:
radius (float) – A distance to define a neighborhood, optional
- become(type: ParticleType) HRESULT
Dynamically changes the type of an object. We can change the type of a ParticleType-derived object to anyther pre-existing ParticleType-derived type. What this means is that if we have an object of say type A, we can change it to another type, say B, and and all of the forces and processes that acted on objects of type A stip and the forces and processes defined for type B now take over.
- Parameters:
type (
ParticleType
) – new particle type
- neighbors(distance=None, types=None)
Gets a list of nearby particles.
- Parameters:
distance – optional search distance; default is simulation cutoff
types – optional list of particle types to search by; default is all types
- Return type:
- bonded_neighbors()
All bonded neighbor ids.
- distance(_other: ParticleHandle) FPTYPE
Calculates the distance to another particle
- Parameters:
_other (
ParticleHandle
) – another particle.
- to_cluster() TissueForge::ClusterParticleHandle *
Limits casting to cluster by type
- __str__() str
Return str(self).
- __lt__(rhs) bool
Return self<value.
- __gt__(rhs) bool
Return self>value.
- __le__(rhs) bool
Return self<=value.
- __ge__(rhs) bool
Return self>=value.
- __eq__(rhs) bool
Return self==value.
- __ne__(rhs) bool
Return self!=value.
- class tissue_forge.ParticleTypeSpec
Interface for class-centric design of ParticleType
- mass = None
Particle type mass
- charge = None
Particle type charge
- radius = None
Particle type radius
- target_energy = None
Particle type target energy
- minimum_radius = None
Particle type minimum radius
- eps = None
Particle type nonbonded interaction parameter
- rmin = None
Particle type nonbonded interaction parameter
- dynamics = None
Particle type dynamics flag
- frozen = None
Particle type frozen flag
- name = None
Particle type name
- name2 = None
Particle type second name
- style = None
Particle type style dictionary specification.
Basic rendering details can be specified as a dictionary, like color and visibility,
style = {'color': 'CornflowerBlue', 'visible': False}
This declaration is the same as performing operations on a type after registration,
ptype: ParticleType ptype.style.setColor('CornflowerBlue') ptype.style.setVisible(False)
Rendering instead by species and species amount uses specification for a color mapper,
style = {'colormap': {'species': 'S1', 'map': 'rainbow', 'range': (0, 10)}}
This declaration is the same as performing operations on a type after registration,
ptype: ParticleType ptype.style.mapper = rendering.ColorMapper('rainbow', 0, 10) ptype.style.mapper.set_map_particle_species(ptype, 'S1')
Valid entries for data mapping are as follows,
‘force’: ‘x’, ‘y’ or ‘z’ for x-, y- or z-component of force
‘position’: ‘x’, ‘y’ or ‘z’ for x-, y- or z-component of position
‘species’: Name of a species attached to a particle type
‘velocity’: ‘x’, ‘y’, ‘z’ or ‘speed’ for x-, y-, z-component or magnitude of velocity
- species = None
Particle type list of species by name, if any. Species are automatically created and populated in the state vector of the type and all created particles.
- classmethod get()
Get the engine type that corresponds to this class.
The type is automatically registered as necessary.
- Returns:
registered type instance
- Return type:
- class tissue_forge.ParticleType(noReg: bool const & = False)
Structure containing information on each particle type.
This is only a definition for a type of particle, and not an actual particle with position, velocity, etc. However, particles of this type can be created with one of these.
- property frozen
Particle type frozen flag
- property frozen_x
Particle type frozen flag along x
- property frozen_y
Particle type frozen flag along y
- property frozen_z
Particle type frozen flag along z
- property temperature
Particle type temperature
- property target_temperature
Particle type target temperature
- id
ID of this type
- mass
Default mass of particles
- charge
Default charge of particles
- radius
Default radius of particles
- property volume
Particle type volume
- kinetic_energy
Kinetic energy of all particles of this type.
- potential_energy
Potential energy of all particles of this type.
- target_energy
Target energy of all particles of this type.
- minimum_radius
Default minimum radius of this type.
If a split event occurs, resulting particles will have a radius at least as great as this value.
- dynamics
Default dynamics of particles of this type.
- name
Name of this particle type.
- style
style pointer, optional.
- species
optional pointer to species list. This is the metadata for the species
- parts
list of particles that belong to this type.
- particle(i: int) TissueForge::Particle *
get the i’th particle that’s a member of this type.
- Parameters:
i (int) – index of particle to get
- static particleTypeIds() std::set< short,std::less< short >,std::allocator< short > >
Get all current particle type ids, excluding clusters
- __str__()
Return str(self).
- __getitem__(index: int)
- __contains__(item)
- __lt__(rhs) bool
Return self<value.
- __gt__(rhs) bool
Return self>value.
- __le__(rhs) bool
Return self<=value.
- __ge__(rhs) bool
Return self>=value.
- __eq__(rhs) bool
Return self==value.
- __ne__(rhs) bool
Return self!=value.
- _call(*args) TissueForge::ParticleHandle *
Overload 1:
Particle constructor.
Automatically updates when running on a CUDA device.
- Parameters:
- Return type:
- Returns:
new particle
Overload 2:
Particle constructor.
Automatically updates when running on a CUDA device.
- Parameters:
str (string) – JSON string
clusterId (int) – id of parent cluster, optional
- Return type:
- Returns:
new particle
- factory(nr_parts=0, positions=None, velocities=None, cluster_ids=None)
Particle factory constructor, for making lots of particles quickly.
At minimum, arguments must specify the number of particles to create, whether specified explicitly or through one or more vector arguments.
- Parameters:
nr_parts – number of particles to create, optional
positions – initial particle positions, optional
velocities – initial particle velocities, optional
clusterIds – parent cluster ids, optional
- Returns:
ids of created particles
- newType(_name: char const *) TissueForge::ParticleType *
Particle type constructor.
New type is constructed from the definition of the calling type.
- Parameters:
_name (string) – name of the new type
- Return type:
- Returns:
new particle type
- registerType() HRESULT
Registers a type with the engine.
Note that this occurs automatically, unless noReg==true in constructor.
- on_register() void
A callback for when a type is registered
- isRegistered() bool
Tests whether this type is registered
- Return type:
boolean
- Returns:
true if registered
- get() TissueForge::ParticleType *
Get the type engine instance
- items() TissueForge::ParticleList &
Get all particles of this type.
- isCluster() bool
Test whether the type is a cluster type
- to_cluster() TissueForge::ClusterParticleType *
Limits casting to cluster by type
- toString() std::string
Get a JSON string representation
- static fromString(str: std::string const &) TissueForge::ParticleType *
Create from a JSON string representation.
The returned type is automatically registered with the engine.
- Parameters:
str (string) – a string, as returned by
toString
- __reduce__()
Helper for pickle.
- class tissue_forge.ClusterParticleHandle(*args)
Bases:
ParticleHandle
The cluster analogue to
ParticleHandle
.These are special in that they can create particles of their constituent particle types, much like a
ParticleType
.- property radius_of_gyration
Radius of gyration
- property center_of_mass
Center of mass
- property centroid
Centroid
- property moment_of_inertia
Moment of inertia
- property num_parts
number of particles that belong to this cluster.
- property parts
particles that belong to this cluster.
- items = <function ClusterParticleHandle.items>
- has(*args) bool
Overload 1: Test whether the cluster has an id
Overload 2: Test whether the cluster has a particle
- __str__()
Return str(self).
- __getitem__(index: int)
- __contains__(item)
- __lt__(rhs) bool
Return self<value.
- __gt__(rhs) bool
Return self>value.
- __le__(rhs) bool
Return self<=value.
- __ge__(rhs) bool
Return self>=value.
- __eq__(rhs) bool
Return self==value.
- __ne__(rhs) bool
Return self!=value.
- _call(*args) TissueForge::ParticleHandle *
Overload 1:
Constituent particle constructor.
The created particle will belong to this cluster.
Automatically updates when running on a CUDA device.
- Parameters:
partType (
ParticleType
) – type of particle to createposition (
FVector3
) – position of new particle, optionalvelocity (
FVector3
) – velocity of new particle, optional
- Return type:
- Returns:
ParticleHandle*
Overload 2:
Constituent particle constructor.
The created particle will belong to this cluster.
Automatically updates when running on a CUDA device.
- Parameters:
partType (
ParticleType
) – type of particle to createstr (string) – JSON string
- Return type:
- Returns:
ParticleHandle*
- cluster() TissueForge::Cluster *
Gets the actual cluster of this handle.
- Return type:
- Returns:
Particle*
- split(axis: fVector3 = None, random: bool * = None, time: FPTYPE * = None, normal: fVector3 = None, point: fVector3 = None) TissueForge::ParticleHandle *
Split the cluster.
- Parameters:
axis (
FVector3
) – axis of split, optionalrandom (boolean) – divide by randomly and evenly allocating constituent particles, optional
time (float) – time at which to implement the split; currently not supported
normal (
FVector3
) – normal vector of cleavage plane, optionalpoint (
FVector3
) – point on cleavage plane, optional
- Return type:
- Returns:
ParticleHandle*
- class tissue_forge.ClusterTypeSpec
Bases:
ParticleTypeSpec
Interface for class-centric design of ClusterParticleType
- types = None
List of constituent types of the cluster, if any
- class tissue_forge.ClusterParticleType(noReg: bool const & = False)
Bases:
ParticleType
The cluster analogue to
ParticleType
.- types
list of particle types that belong to this type.
- hasType(type: ParticleType) bool
Tests where this cluster has a particle type.
Only tests for immediate ownership and ignores multi-level clusters.
- Parameters:
type (
ParticleType
) – type to test- Return type:
boolean
- Returns:
true if this cluster has the type
- get() TissueForge::ClusterParticleType *
Get the type engine instance
- Return type:
- Returns:
ClusterParticleType*
- has(*args) bool
Overload 1: Test whether the type has a type id
Overload 2: Test whether the type has a type
Overload 3: Test whether the type has a particle
- __str__()
Return str(self).
- __getitem__(index: int)
- __contains__(item)
- __lt__(rhs) bool
Return self<value.
- __gt__(rhs) bool
Return self>value.
- __le__(rhs) bool
Return self<=value.
- __ge__(rhs) bool
Return self>=value.
- __eq__(rhs) bool
Return self==value.
- __ne__(rhs) bool
Return self!=value.
ParticleList and ParticleTypeList
- class tissue_forge.ParticleList(*args)
A special list with convenience methods for working with sets of particles.
- property virial
Virial tensor of particles in list
- property radius_of_gyration
Radius of gyration of particles in list
- property center_of_mass
Center of mass of particles in list
- property centroid
Centroid of particles in list
- property moment_of_inertia
Moment of inertia of particles in list
- property positions
Position of each particle in list
- property velocities
Velocity of each particle in list
- property forces
Net forces acting on each particle in list
- property ownsdata: bool
Whether the list owns its data
- property mutable: bool
Whether the list is mutable
- has(*args) bool
Overload 1: Test whether the list has an id
Overload 2: Test whether the list has a particle
- __len__() int
- __getitem__(i: int)
- __contains__(item)
- reserve(_nr_parts: size_t) HRESULT
Reserve enough storage for a given number of items.
- Parameters:
_nr_parts (int) – number of items
- Return type:
int
- Returns:
HRESULT
- insert(*args) uint16_t
Inserts the given particle into the list, returns the index of the item.
- Parameters:
particle (
ParticleHandle
) – particle to insert- Return type:
int
- Returns:
uint16_t
- remove(id: int32_t) uint16_t
looks for the item with the given id and deletes it form the list
- Parameters:
id (int) – id to remove
- Return type:
int
- Returns:
uint16_t
- extend(other: ParticleList) uint16_t
inserts the contents of another list
- Parameters:
other (
ParticleList
) – another list
- item(i: int32_t const &) TissueForge::ParticleHandle *
looks for the item at the given index and returns it if found, otherwise returns NULL
- Parameters:
i (int) – index of lookup
- Return type:
- Returns:
ParticleHandle*
- vector() std::vector< int32_t,std::allocator< int32_t > >
returns the list as a vector
- static all() TissueForge::ParticleList
returns an instance populated with all current particles
- Return type:
- Returns:
ParticleList*
- sphericalPositions(origin: fVector3 = None) std::vector< TissueForge::FVector3,std::allocator< TissueForge::FVector3 > >
Get the spherical coordinates of each particle
- Parameters:
origin (
FVector3
) – optional origin of coordinates; default is center of universe- Return type:
std::vector< TissueForge::FVector3,std::allocator< TissueForge::FVector3 > >
- Returns:
std::vector<FVector3>
- toString() std::string
Get a JSON string representation
- Return type:
string
- Returns:
std::string
- static fromString(str: std::string const &) TissueForge::ParticleList *
Create from a JSON string representation
- Parameters:
str (string) –
- Return type:
- Returns:
ParticleList*
- __reduce__()
Helper for pickle.
- class tissue_forge.ParticleTypeList(*args)
A special list with convenience methods for working with sets of particle types.
- property virial
Virial tensor of particles corresponding to all types in list
- property radius_of_gyration
Radius of gyration of particles corresponding to all types in list
- property center_of_mass
Center of mass of particles corresponding to all types in list
- property centroid
Centroid of particles corresponding to all types in list
- property moment_of_inertia
Moment of inertia of particles corresponding to all types in list
- property positions
Position of each particle corresponding to all types in list
- property velocities
Velocity of each particle corresponding to all types in list
- property forces
Total net force acting on each particle corresponding to all types in list
- property ownsdata: bool
Whether the list owns its data
- property mutable: bool
Whether the list is mutable
- has(*args) bool
Overload 1: Test whether the list has an id
Overload 2: Test whether the list has a particle type
Overload 3: Test whether the list has a particle
- __len__() int
- __getitem__(i: int)
- __contains__(item)
- reserve(_nr_parts: size_t) HRESULT
Reserve enough storage for a given number of items.
- Parameters:
_nr_parts (int) – number of items
- Return type:
int
- Returns:
HRESULT
- insert(*args) uint16_t
Inserts the given particle type into the list, returns the index of the item.
- Parameters:
ptype (
ParticleType
) –- Return type:
int
- Returns:
uint16_t
- remove(id: int32_t) uint16_t
looks for the item with the given id and deletes it form the list
- Parameters:
id (int) – id to remove
- Return type:
int
- Returns:
uint16_t
- extend(other: ParticleTypeList) uint16_t
inserts the contents of another list
- Parameters:
other (
ParticleTypeList
) – another list
- item(i: int32_t const &) TissueForge::ParticleType *
looks for the item at the given index and returns it if found, otherwise returns NULL
- Parameters:
i (int) – index of lookup
- Return type:
- Returns:
ParticleType*
- vector() std::vector< int32_t,std::allocator< int32_t > >
returns the list as a vector
- static all() TissueForge::ParticleTypeList
returns an instance populated with all current particle types
- Return type:
- Returns:
ParticleTypeList*
- sphericalPositions(origin: fVector3 = None) std::vector< TissueForge::FVector3,std::allocator< TissueForge::FVector3 > >
Get the spherical coordinates of each particle
- Parameters:
origin (
FVector3
) – optional origin of coordinates; default is center of universe- Return type:
std::vector< TissueForge::FVector3,std::allocator< TissueForge::FVector3 > >
- Returns:
std::vector<FVector3>
- toString() std::string
Get a JSON string representation
- Return type:
string
- Returns:
std::string
- static fromString(str: std::string const &) TissueForge::ParticleTypeList *
Create from a JSON string representation
- Parameters:
str (string) –
- Return type:
- Returns:
ParticleTypeList*
- __reduce__()
Helper for pickle.
Potentials
- class tissue_forge.tissue_forge._Potential
A Potential object is a compiled interpolation of a given function. The Universe applies potentials to particles to calculate the net force on them.
For performance reasons, Tissue Forge implements potentials as interpolations, which can be much faster than evaluating the function directly.
A potential can be treated just like any callable object.
- property min: float
Minimum distance of evaluation
- property max: float
Maximum distance of evaluation
- property cutoff: float
Cutoff distance
- property domain: (<class 'float'>, <class 'float'>)
Evaluation domain
- property intervals: int
Evaluation intervals
- property bound: bool
Bound flag
- property r0: float
Potential r0 value
- property shifted: bool
Shifted flag
- property periodic: bool
Periodic flag
- property r_square: bool
Potential r2 value
- _call(*args) FPTYPE
- plot(s=1.0, force=True, potential=False, show=True, ymin=None, ymax=None, *args, **kwargs)
Potential plot function
- Parameters:
s – sum of theoretical radii of two interacting particles
force – flag to plot evaluations of the force magnitude
potential – flag to plot evaluations of the potential
show – flag to show the plot
ymin – minimum vertical plot value
ymax – maximum vertical plot value
- Returns:
plot lines
- toString() std::string
Get a JSON string representation
- Return type:
string
- Returns:
std::string
- static fromString(str: std::string const &) TissueForge::Potential *
Create from a JSON string representation
- Parameters:
str (string) –
- Return type:
- Returns:
Potential*
- __reduce__()
Helper for pickle.
- static lennard_jones_12_6(min: FPTYPE, max: FPTYPE, A: FPTYPE, B: FPTYPE, tol: FPTYPE * = None) TissueForge::Potential *
Creates a 12-6 Lennard-Jones potential.
The Lennard Jones potential has the form:
\[\left( \frac{A}{r^{12}} - \frac{B}{r^6} \right)\]- Parameters:
min (float) – The smallest radius for which the potential will be constructed.
max (float) – The largest radius for which the potential will be constructed.
A (float) – The first parameter of the Lennard-Jones potential.
B (float) – The second parameter of the Lennard-Jones potential.
tol (float) – The tolerance to which the interpolation should match the exact potential. Defaults to 0.001 * (max - min).
- Return type:
- Returns:
Potential*
- static lennard_jones_12_6_coulomb(min: FPTYPE, max: FPTYPE, A: FPTYPE, B: FPTYPE, q: FPTYPE, tol: FPTYPE * = None) TissueForge::Potential *
Creates a potential of the sum of a 12-6 Lennard-Jones potential and a shifted Coulomb potential.
The 12-6 Lennard Jones - Coulomb potential has the form:
\[\left( \frac{A}{r^{12}} - \frac{B}{r^6} \right) + q \left( \frac{1}{r} - \frac{1}{max} \right)\]- Parameters:
min (float) – The smallest radius for which the potential will be constructed.
max (float) – The largest radius for which the potential will be constructed.
A (float) – The first parameter of the Lennard-Jones potential.
B (float) – The second parameter of the Lennard-Jones potential.
q (float) – The charge scaling of the potential.
tol (float) – The tolerance to which the interpolation should match the exact potential. Defaults to 0.001 * (max - min).
- Return type:
- Returns:
Potential*
- static ewald(min: FPTYPE, max: FPTYPE, q: FPTYPE, kappa: FPTYPE, tol: FPTYPE * = None, periodicOrder: unsigned int * = None) TissueForge::Potential *
Creates a real-space Ewald potential.
The Ewald potential has the form:
\[q \frac{\mathrm{erfc}\, ( \kappa r)}{r}\]- Parameters:
min (float) – The smallest radius for which the potential will be constructed.
max (float) – The largest radius for which the potential will be constructed.
q (float) – The charge scaling of the potential.
kappa (float) – The screening distance of the Ewald potential.
tol (float) – The tolerance to which the interpolation should match the exact potential. Defaults to 0.001 * (max - min).
periodicOrder (int) – Order of lattice periodicity along all periodic dimensions. Defaults to 0.
- Return type:
- Returns:
Potential*
- static coulomb(q: FPTYPE, min: FPTYPE * = None, max: FPTYPE * = None, tol: FPTYPE * = None, periodicOrder: unsigned int * = None) TissueForge::Potential *
Creates a Coulomb potential.
The Coulomb potential has the form:
\[\frac{q}{r}\]- Parameters:
q (float) – The charge scaling of the potential.
min (float) – The smallest radius for which the potential will be constructed. Default is 0.01.
max (float) – The largest radius for which the potential will be constructed. Default is 2.0.
tol (float) – The tolerance to which the interpolation should match the exact potential. Defaults to 0.001 * (max - min).
periodicOrder (int) – Order of lattice periodicity along all periodic dimensions. Defaults to 0.
- Return type:
- Returns:
Potential*
- static coulombR(q: FPTYPE, kappa: FPTYPE, min: FPTYPE, max: FPTYPE, modes: unsigned int * = None) TissueForge::Potential *
Creates a Coulomb reciprocal potential.
The Coulomb reciprocal potential has the form:
\[\frac{\pi q}{V} \sum_{||\mathbf{m}|| \neq 0} \frac{1}{||\mathbf{m}||^2} \exp \left( \left( i \mathbf{r}_{jk} - \left( \frac{\pi}{\kappa} \right)^{2} \mathbf{m} \right) \cdot \mathbf{m} \right)\]Here \(V\) is the volume of the domain and \(\mathbf{m}\) is a reciprocal vector of the domain.
- Parameters:
q (float) – Charge scaling of the potential.
kappa (float) – Screening distance.
min (float) – Smallest radius for which the potential will be constructed.
max (float) – Largest radius for which the potential will be constructed.
modes (int) – Number of Fourier modes along each periodic dimension. Default is 1.
- Return type:
- Returns:
Potential*
- static harmonic(k: FPTYPE, r0: FPTYPE, min: FPTYPE * = None, max: FPTYPE * = None, tol: FPTYPE * = None) TissueForge::Potential *
Creates a harmonic bond potential.
The harmonic potential has the form:
\[k \left( r-r_0 \right)^2\]- Parameters:
k (float) – The energy of the bond.
r0 (float) – The bond rest length.
min (float) – The smallest radius for which the potential will be constructed. Defaults to \(r_0 - r_0 / 2\).
max (float) – The largest radius for which the potential will be constructed. Defaults to \(r_0 + r_0 /2\).
tol (float) – The tolerance to which the interpolation should match the exact potential. Defaults to \(0.01 \abs(max-min)\).
- Return type:
- Returns:
Potential*
- static linear(k: FPTYPE, min: FPTYPE * = None, max: FPTYPE * = None, tol: FPTYPE * = None) TissueForge::Potential *
Creates a linear potential.
The linear potential has the form:
\[k r\]- Parameters:
k (float) – interaction strength; represents the potential energy peak value.
min (float) – The smallest radius for which the potential will be constructed. Defaults to 0.0.
max (float) – The largest radius for which the potential will be constructed. Defaults to 10.0.
tol (float) – The tolerance to which the interpolation should match the exact potential. Defaults to 0.001.
- Return type:
- Returns:
Potential*
- static harmonic_angle(k: FPTYPE, theta0: FPTYPE, min: FPTYPE * = None, max: FPTYPE * = None, tol: FPTYPE * = None) TissueForge::Potential *
Creates a harmonic angle potential.
The harmonic angle potential has the form:
\[k \left(\theta-\theta_{0} \right)^2\]- Parameters:
k (float) – The energy of the angle.
theta0 (float) – The minimum energy angle.
min (float) – The smallest angle for which the potential will be constructed. Defaults to zero.
max (float) – The largest angle for which the potential will be constructed. Defaults to PI.
tol (float) – The tolerance to which the interpolation should match the exact potential. Defaults to 0.005 * (max - min).
- Return type:
- Returns:
Potential*
- static harmonic_dihedral(k: FPTYPE, delta: FPTYPE, min: FPTYPE * = None, max: FPTYPE * = None, tol: FPTYPE * = None) TissueForge::Potential *
Creates a harmonic dihedral potential.
The harmonic dihedral potential has the form:
\[k \left( \theta - \delta \right) ^2\]- Parameters:
k (float) – energy of the dihedral.
delta (float) – minimum energy dihedral.
min (float) – The smallest angle for which the potential will be constructed. Defaults to zero.
max (float) – The largest angle for which the potential will be constructed. Defaults to PI.
tol (float) – The tolerance to which the interpolation should match the exact potential. Defaults to 0.005 * (max - min).
- Return type:
- Returns:
Potential*
- static cosine_dihedral(k: FPTYPE, n: int, delta: FPTYPE, tol: FPTYPE * = None) TissueForge::Potential *
Creates a cosine dihedral potential.
The cosine dihedral potential has the form:
\[k \left( 1 + \cos( n \theta-\delta ) \right)\]- Parameters:
k (float) – energy of the dihedral.
n (int) – multiplicity of the dihedral.
delta (float) – minimum energy dihedral.
tol (float) – The tolerance to which the interpolation should match the exact potential. Defaults to 0.01.
- Return type:
- Returns:
Potential*
- static well(k: FPTYPE, n: FPTYPE, r0: FPTYPE, min: FPTYPE * = None, max: FPTYPE * = None, tol: FPTYPE * = None) TissueForge::Potential *
Creates a well potential.
Useful for binding a particle to a region.
The well potential has the form:
\[\frac{k}{\left(r_0 - r\right)^{n}}\]- Parameters:
k (float) – potential prefactor constant, should be decreased for larger n.
n (float) – exponent of the potential, larger n makes a sharper potential.
r0 (float) – The extents of the potential, length units. Represents the maximum extents that a two objects connected with this potential should come apart.
min (float) – The smallest radius for which the potential will be constructed. Defaults to zero.
max (float) – The largest radius for which the potential will be constructed. Defaults to r0.
tol (float) – The tolerance to which the interpolation should match the exact potential. Defaults to 0.01 * abs(min-max).
- Return type:
- Returns:
Potential*
- static glj(e: FPTYPE, m: FPTYPE * = None, n: FPTYPE * = None, k: FPTYPE * = None, r0: FPTYPE * = None, min: FPTYPE * = None, max: FPTYPE * = None, tol: FPTYPE * = None, shifted: bool * = None) TissueForge::Potential *
Creates a generalized Lennard-Jones potential.
The generalized Lennard-Jones potential has the form:
\[\frac{\epsilon}{n-m} \left[ m \left( \frac{r_0}{r} \right)^n - n \left( \frac{r_0}{r} \right)^m \right]\]- Parameters:
e (float) – effective energy of the potential.
m (float) – order of potential. Defaults to 3
n (float) – order of potential. Defaults to 2*m.
k (float) – mimumum of the potential. Defaults to 1.
r0 (float) – mimumum of the potential. Defaults to 1.
min (float) – The smallest radius for which the potential will be constructed. Defaults to 0.05 * r0.
max (float) – The largest radius for which the potential will be constructed. Defaults to 5 * r0.
tol (float) – The tolerance to which the interpolation should match the exact potential. Defaults to 0.01.
shifted (boolean) – Flag for whether using a shifted potential. Defaults to true.
- Return type:
- Returns:
Potential*
- static morse(d: FPTYPE * = None, a: FPTYPE * = None, r0: FPTYPE * = None, min: FPTYPE * = None, max: FPTYPE * = None, tol: FPTYPE * = None, shifted: bool * = None) TissueForge::Potential *
Creates a Morse potential.
The Morse potential has the form:
\[d \left(1 - e^{ -a \left(r - r_0 \right) } \right)^2\]- Parameters:
d (float) – well depth. Defaults to 1.0.
a (float) – potential width. Defaults to 6.0.
r0 (float) – equilibrium distance. Defaults to 0.0.
min (float) – The smallest radius for which the potential will be constructed. Defaults to 0.0001.
max (float) – The largest radius for which the potential will be constructed. Defaults to 3.0.
tol (float) – The tolerance to which the interpolation should match the exact potential. Defaults to 0.001.
shifted (boolean) – Flag for whether using a shifted potential. Defaults to true.
- Return type:
- Returns:
Potential*
- static overlapping_sphere(mu: FPTYPE * = None, kc: FPTYPE * = None, kh: FPTYPE * = None, r0: FPTYPE * = None, min: FPTYPE * = None, max: FPTYPE * = None, tol: FPTYPE * = None) TissueForge::Potential *
Creates an overlapping-sphere potential from [OFPF+17].
The overlapping-sphere potential has the form:
\[\mu_{ij} s_{ij}(t) \hat{\mathbf{r}}_{ij} \log \left( 1 + \frac{||\mathbf{r}_{ij}|| - s_{ij}(t)}{s_{ij}(t)} \right) \text{ if } ||\mathbf{r}_{ij}|| < s_{ij}(t) ,\]\[\mu_{ij}\left(||\mathbf{r}_{ij}|| - s_{ij}(t)\right) \hat{\mathbf{r}}_{ij} \exp \left( -k_c \frac{||\mathbf{r}_{ij}|| - s_{ij}(t)}{s_{ij}(t)} \right) \text{ if } s_{ij}(t) \leq ||\mathbf{r}_{ij}|| \leq r_{max} ,\]\[0 \text{ otherwise} .\]Osborne refers to \(\mu_{ij}\) as a “spring constant”, this controls the size of the force, and is the potential energy peak value. \(\hat{\mathbf{r}}_{ij}\) is the unit vector from particle \(i\) center to particle \(j\) center, \(k_C\) is a parameter that defines decay of the attractive force. Larger values of \(k_C\) result in a shaper peaked attraction, and thus a shorter ranged force. \(s_{ij}(t)\) is the is the sum of the radii of the two particles.
- Parameters:
mu (float) – interaction strength, represents the potential energy peak value. Defaults to 1.0.
kc (float) – decay strength of long range attraction. Larger values make a shorter ranged function. Defaults to 1.0.
kh (float) – Optionally add a harmonic long-range attraction, same as
glj
function. Defaults to 0.0.r0 (float) – Optional harmonic rest length, only used if kh is non-zero. Defaults to 0.0.
min (float) – The smallest radius for which the potential will be constructed. Defaults to 0.001.
max (float) – The largest radius for which the potential will be constructed. Defaults to 10.0.
tol (float) – The tolerance to which the interpolation should match the exact potential. Defaults to 0.001.
- Return type:
- Returns:
Potential*
- static power(k: FPTYPE * = None, r0: FPTYPE * = None, alpha: FPTYPE * = None, min: FPTYPE * = None, max: FPTYPE * = None, tol: FPTYPE * = None) TissueForge::Potential *
Creates a power potential.
The power potential the general form of many of the potential functions, such as
linear
, etc. power has the form:\[k \lvert r-r_0 \rvert ^{\alpha}\]- Parameters:
k (float) – interaction strength, represents the potential energy peak value. Defaults to 1
r0 (float) – potential rest length, zero of the potential, defaults to 0.
alpha (float) – Exponent, defaults to 1.
min (float) – minimal value potential is computed for, defaults to r0 / 2.
max (float) – cutoff distance, defaults to 3 * r0.
tol (float) – Tolerance, defaults to 0.01.
- Return type:
- Returns:
Potential*
- static dpd(alpha: FPTYPE * = None, gamma: FPTYPE * = None, sigma: FPTYPE * = None, cutoff: FPTYPE * = None, shifted: bool * = None) TissueForge::Potential *
Creates a Dissipative Particle Dynamics potential.
The Dissipative Particle Dynamics force has the form:
\[\mathbf{F}_{ij} = \mathbf{F}^C_{ij} + \mathbf{F}^D_{ij} + \mathbf{F}^R_{ij}\]The conservative force is:
\[\mathbf{F}^C_{ij} = \alpha \left(1 - \frac{r_{ij}}{r_c}\right) \mathbf{e}_{ij}\]The dissapative force is:
\[\mathbf{F}^D_{ij} = -\gamma \left(1 - \frac{r_{ij}}{r_c}\right)^{2}(\mathbf{e}_{ij} \cdot \mathbf{v}_{ij}) \mathbf{e}_{ij}\]The random force is:
\[\mathbf{F}^R_{ij} = \sigma \left(1 - \frac{r_{ij}}{r_c}\right) \xi_{ij}\Delta t^{-1/2}\mathbf{e}_{ij}\]- Parameters:
alpha (float) – interaction strength of the conservative force. Defaults to 1.0.
gamma (float) – interaction strength of dissapative force. Defaults to 1.0.
sigma (float) – strength of random force. Defaults to 1.0.
cutoff (float) – cutoff distance. Defaults to 1.0.
shifted (boolean) – Flag for whether using a shifted potential. Defaults to false.
- Return type:
- Returns:
Potential*
- class tissue_forge.tissue_forge.Potential
Bases:
_Potential
- custom = <function Potential.custom>
- class tissue_forge.tissue_forge.DPDPotential(alpha: FPTYPE, gamma: FPTYPE, sigma: FPTYPE, cutoff: FPTYPE, shifted: bool)
Bases:
_Potential
- alpha
strength of conserative interaction
- gamma
strength of dissapative interaction
- sigma
strength of random interaction
- static fromPot(pot: _Potential) TissueForge::DPDPotential *
Convert basic potential to DPD.
If the basic potential is not DPD, then NULL is returned.
- Parameters:
pot (
Potential
) –- Return type:
- Returns:
DPDPotential*
- toString() std::string
Get a JSON string representation
- Return type:
string
- Returns:
std::string
- static fromString(str: std::string const &) TissueForge::DPDPotential *
Create from a JSON string representation
- Parameters:
str (string) –
- Return type:
- Returns:
Potential*
- __reduce__()
Helper for pickle.
Forces
- class tissue_forge.tissue_forge.Force
Force is a metatype, in that Tissue Forge has lots of different instances of force functions, that have different attributes, but only have one base type.
Forces are one of the fundamental processes in Tissue Forge that cause objects to move.
- bind_species(a_type: ParticleType, coupling_symbol: std::string const &) HRESULT
Bind a force to a species.
When a force is bound to a species, the magnitude of the force is scaled by the concentration of the species.
- Parameters:
a_type (
ParticleType
) – particle type containing the speciescoupling_symbol (string) – symbol of the species
- Return type:
int
- Returns:
HRESULT
- static berendsen_tstat(tau: FPTYPE const &) TissueForge::Berendsen *
Creates a Berendsen thermostat.
The thermostat uses the target temperature \(T_0\) from the object to which it is bound. The Berendsen thermostat effectively re-scales the velocities of an object in order to make the temperature of that family of objects match a specified temperature.
The Berendsen thermostat force has the function form:
\[\frac{\mathbf{p}}{\tau_T} \left(\frac{T_0}{T} - 1 \right),\]where \(\mathbf{p}\) is the momentum, \(T\) is the measured temperature of a family of particles, \(T_0\) is the control temperature, and \(\tau_T\) is the coupling constant. The coupling constant is a measure of the time scale on which the thermostat operates, and has units of time. Smaller values of \(\tau_T\) result in a faster acting thermostat, and larger values result in a slower acting thermostat.
- Parameters:
tau (float) – time constant that determines how rapidly the thermostat effects the system.
- Return type:
- Returns:
Berendsen*
- static random(std: FPTYPE const &, mean: FPTYPE const &, duration: FPTYPE const & = 0.01) TissueForge::Gaussian *
Creates a random force.
A random force has a randomly selected orientation and magnitude.
Orientation is selected according to a uniform distribution on the unit sphere.
Magnitude is selected according to a prescribed mean and standard deviation.
- Parameters:
std (float) – standard deviation of magnitude
mean (float) – mean of magnitude
duration (float) – duration of force. Defaults to 0.01.
- Return type:
- Returns:
Gaussian*
- static friction(coef: FPTYPE const &) TissueForge::Friction *
Creates a friction force.
A friction force has the form:
\[- \frac{|| \mathbf{v} ||}{\tau} \mathbf{v} ,\]where \(\mathbf{v}\) is the velocity of a particle and \(\tau\) is a time constant.
- Parameters:
coef (float) – time constant
- Return type:
- Returns:
Friction*
- toString() std::string
Get a JSON string representation
- Return type:
string
- Returns:
std::string
- static fromString(str: std::string const &) TissueForge::Force *
Create from a JSON string representation
- Parameters:
str (string) –
- Return type:
- Returns:
Force*
- __reduce__()
Helper for pickle.
- class tissue_forge.tissue_forge._CustomForce(*args)
Bases:
Force
A custom force function.
The force is updated according to an update frequency.
- class tissue_forge.tissue_forge.CustomForce(*args)
Bases:
_CustomForce
Creates an instance from an underlying custom python function
- Parameters:
f (PyObject) – python function. Takes no arguments and returns a three-component vector.
period (float) – period at which the force is updated.
- property value
Current value of the force.
This can be set to a function that takes no arguments and returns a 3-component list of floats.
- property period
Period of the force
- class tissue_forge.tissue_forge.Berendsen
Bases:
Force
Berendsen force.
Create one with
Force.berendsen_tstat
.- itau
time constant
- class tissue_forge.tissue_forge.Gaussian
Bases:
Force
Random force.
Create one with
Force.random
.- std
standard deviation of magnitude
- mean
mean of magnitude
- durration_steps
duration of force.
- class tissue_forge.tissue_forge.Friction
Bases:
Force
Friction force.
Create one with
Force.friction
.- coef
time constant
Fluxes
- class tissue_forge.Fluxes
A flux is defined between a pair of types, and acts on the state vector between a pair of instances.
The indices of the species in each state vector are most likely different, so Tissue Forge tracks the indices in each type, and the transport constatants.
A flux between a pair of types, and pair of respective species needs:
(1) type A, (2) type B, (3) species id in A, (4) species id in B, (5) transport constant.
Allocates Flux as a single block, member pointers point to offsets in these blocks.
Allocated size is: sizeof(Fluxes) + 2 * alloc_size * sizeof(int32) + alloc_size * sizeof(FPTYPE)
- static flux(*args, **kwargs) TissueForge::Fluxes *
Alias of fluxFick.
- Parameters:
A (
ParticleType
) – first typeB (
ParticleType
) – second typename (string) – name of species
k (float) – transport coefficient
decay (float) – optional decay. Defaults to 0.0.
cutoff (float) – optional cutoff distance. Defaults to global cutoff
- Return type:
- Returns:
Fluxes*
- static fluxFick(*args, **kwargs) TissueForge::Fluxes *
Creates and binds a Fickian diffusion flux.
Fickian diffusion flux implements the analogous reaction:
\[a.S \leftrightarrow b.S ; k \left(1 - \frac{r}{r_{cutoff}} \right)\left(a.S - b.S\right) ,\]\[a.S \rightarrow 0 ; \frac{d}{2} a.S ,\]\[b.S \rightarrow 0 ; \frac{d}{2} b.S ,\]where \(a.S\) is a chemical species located at object \(a\), and likewise for \(b\), \(k\) is the flux constant, \(r\) is the distance between the two objects, \(r_{cutoff}\) is the global cutoff distance, and \(d\) is an optional decay term.
Automatically updates when running on a CUDA device.
- Parameters:
A (
ParticleType
) – first typeB (
ParticleType
) – second typename (string) – name of species
k (float) – transport coefficient
decay (float) – optional decay. Defaults to 0.0.
cutoff (float) – optional cutoff distance. Defaults to global cutoff
- Return type:
- Returns:
Fluxes*
- static secrete(*args, **kwargs) TissueForge::Fluxes *
Creates a secretion flux by active pumping.
Secretion flux implements the analogous reaction:
\[a.S \rightarrow b.S ; k \left(1 - \frac{r}{r_{cutoff}} \right)\left(a.S - a.S_{target} \right) ,\]\[a.S \rightarrow 0 ; \frac{d}{2} a.S ,\]\[b.S \rightarrow 0 ; \frac{d}{2} b.S ,\]where \(a.S\) is a chemical species located at object \(a\), and likewise for \(b\), \(k\) is the flux constant, \(r\) is the distance between the two objects, \(r_{cutoff}\) is the global cutoff distance, and \(d\) is an optional decay term.
Automatically updates when running on a CUDA device.
- Parameters:
A (
ParticleType
) – first typeB (
ParticleType
) – second typename (string) – name of species
k (float) – transport coefficient
target (float) – target concentration
decay (float) – optional decay. Defaults to 0.0
cutoff (float) – optional cutoff distance. Defaults to global cutoff
- Return type:
- Returns:
Fluxes*
- static uptake(*args, **kwargs) TissueForge::Fluxes *
Creates an uptake flux by active pumping.
Uptake flux implements the analogous reaction:
\[a.S \rightarrow b.S ; k \left(1 - \frac{r}{r_{cutoff}}\right)\left(b.S - b.S_{target} \right)\left(a.S\right) ,\]\[a.S \rightarrow 0 ; \frac{d}{2} a.S ,\]\[b.S \rightarrow 0 ; \frac{d}{2} b.S ,\]where \(a.S\) is a chemical species located at object \(a\), and likewise for \(b\), \(k\) is the flux constant, \(r\) is the distance between the two objects, \(r_{cutoff}\) is the global cutoff distance, and \(d\) is an optional decay term.
Automatically updates when running on a CUDA device.
- Parameters:
A (
ParticleType
) – first typeB (
ParticleType
) – second typename (string) – name of species
k (float) – transport coefficient
target (float) – target concentration
decay (float) – optional decay. Defaults to 0.0
cutoff (float) – optional cutoff distance. Defaults to global cutoff
- Return type:
- Returns:
Fluxes*
Bonds
- class tissue_forge.Bond
Bonds apply a potential to a particular set of particles.
If you’re building a model, you should probably instead be working with a BondHandle.
- static create(potential: _Potential, i: ParticleHandle, j: ParticleHandle, half_life: FPTYPE * = None, dissociation_energy: FPTYPE * = None, flags: uint32_t = 0) TissueForge::BondHandle *
Construct a new bond handle and underlying bond.
Automatically updates when running on a CUDA device.
- Parameters:
potential (
Potential
) – bond potentiali (
ParticleHandle
) – ith particlej (
ParticleHandle
) – jth particlehalf_life (float) – bond half life
dissociation_energy (float) – dissociation energy
flags (int) – bond flags
- toString() std::string
Get a JSON string representation
- static fromString(str: std::string const &) TissueForge::Bond *
Create from a JSON string representation.
The returned bond is not automatically registered with the engine.
- Parameters:
str (string) –
- __reduce__()
Helper for pickle.
- class tissue_forge.BondHandle(*args)
Handle to a bond
This is a safe way to work with a bond.
Overload 1:
Construct a new bond handle and do nothing Subsequent usage will require a call to ‘init’
Overload 2:
Construct a new bond handle from an existing bond id
- Parameters:
id (int) – id of existing bond
Overload 3:
Construct a new bond handle and underlying bond.
Automatically updates when running on a CUDA device.
- Parameters:
potential (
Potential
) – bond potentiali (int) – id of ith particle
j (int) – id of jth particle
half_life (float) – bond half life
bond_energy (float) – bond energy
flags (int) – bond flags
- property length
bond length
- property energy
bond energy
- property parts
bonded particles
- property potential
bond potential
- property id
bond id
- property dissociation_energy
bond dissociation energy
- property half_life
bond half life
- property style
bond style
- property age
bond age
- has(*args) bool
Overload 1: Test whether the bond has an id
Overload 2: Test whether the bond has a particle
- __str__() str
Return str(self).
- __getitem__(index: int)
- __contains__(item)
- __lt__(rhs) bool
Return self<value.
- __gt__(rhs) bool
Return self>value.
- __le__(rhs) bool
Return self<=value.
- __ge__(rhs) bool
Return self>=value.
- __eq__(rhs) bool
Return self==value.
- __ne__(rhs) bool
Return self!=value.
- static pairwise(pot: _Potential, parts: ParticleList, cutoff: FPTYPE const &, ppairs: vectorPairParticleType_ParticleType, half_life: FPTYPE const &, bond_energy: FPTYPE const &, flags: uint32_t) std::vector< TissueForge::BondHandle,std::allocator< TissueForge::BondHandle > >
Apply bonds to a list of particles.
Automatically updates when running on a CUDA device.
- Parameters:
pot (
Potential
) – the potential of the created bondsparts (
ParticleList
) – list of particlescutoff (float) – cutoff distance of particles that are bonded
ppairs (std::vector< std::pair< TissueForge::ParticleType *,TissueForge::ParticleType * > *,std::allocator< std::pair< TissueForge::ParticleType *,TissueForge::ParticleType * > * > >) – type pairs of bonds
half_life (float) – bond half life
bond_energy (float) – bond energy
flags (int) – bond flags
- Return type:
std::vector< TissueForge::BondHandle,std::allocator< TissueForge::BondHandle > >
- Returns:
created bonds
- destroy() HRESULT
Destroy the bond.
Automatically updates when running on a CUDA device.
- static items() std::vector< TissueForge::BondHandle,std::allocator< TissueForge::BondHandle > >
Gets all bonds in the universe
- decays() bool
Tests whether this bond decays
- Return type:
boolean
- Returns:
true when the bond should decay
- class tissue_forge.Angle
A bond concerning an angle
If you’re building a model, you should probably instead be working with a AngleHandle.
- static create(potential: _Potential, p1: ParticleHandle, p2: ParticleHandle, p3: ParticleHandle, flags: uint32_t = 0) TissueForge::AngleHandle *
Creates an angle bond.
Automatically updates when running on a CUDA device.
- Parameters:
potential (
Potential
) – potential of the bondp1 (
ParticleHandle
) – first outer particlep2 (
ParticleHandle
) – center particlep3 (
ParticleHandle
) – second outer particleflags (int) – angle flags
- Return type:
- Returns:
AngleHandle*
- toString() std::string
Get a JSON string representation
- static fromString(str: std::string const &) TissueForge::Angle *
Create from a JSON string representation.
The returned angle is not automatically registered with the engine.
- Parameters:
str (string) –
- __reduce__()
Helper for pickle.
- class tissue_forge.AngleHandle(*args)
A handle to an angle bond
This is a safe way to work with an angle bond.
Construct a new angle handle from an existing angle id
- Parameters:
id – id of existing angle
- property angle
angle angle
- property energy
angle energy
- property parts
bonded particles
- property potential
angle potential
- property id
angle id
- property dissociation_energy
bond dissociation energy
- property half_life
angle half life
- property style
angle style
- property age
angle age
- has(*args) bool
Overload 1: Test whether the bond has an id
Overload 2: Test whether the bond has a particle
- __str__() str
Return str(self).
- __getitem__(index: int)
- __contains__(item)
- __lt__(rhs) bool
Return self<value.
- __gt__(rhs) bool
Return self>value.
- __le__(rhs) bool
Return self<=value.
- __ge__(rhs) bool
Return self>=value.
- __eq__(rhs) bool
Return self==value.
- __ne__(rhs) bool
Return self!=value.
- get() TissueForge::Angle *
Gets the angle of this handle
- Return type:
- Returns:
angle, if available
- destroy() HRESULT
Destroy the angle.
Automatically updates when running on a CUDA device.
- static items() std::vector< TissueForge::AngleHandle,std::allocator< TissueForge::AngleHandle > >
Gets all angles in the universe
- decays() bool
Tests whether this bond decays
- Return type:
boolean
- Returns:
true when the bond should decay
- class tissue_forge.Dihedral
The dihedral structure
- static create(potential: _Potential, p1: ParticleHandle, p2: ParticleHandle, p3: ParticleHandle, p4: ParticleHandle) TissueForge::DihedralHandle *
Creates a dihedral bond
- Parameters:
potential (
Potential
) – potential of the bondp1 (
ParticleHandle
) – first outer particlep2 (
ParticleHandle
) – first center particlep3 (
ParticleHandle
) – second center particlep4 (
ParticleHandle
) – second outer particle
- Return type:
- Returns:
DihedralHandle*
- toString() std::string
Get a JSON string representation
- static fromString(str: std::string const &) TissueForge::Dihedral *
Create from a JSON string representation.
The returned dihedral is not automatically registered with the engine.
- Parameters:
str (string) –
- __reduce__()
Helper for pickle.
- class tissue_forge.DihedralHandle(*args)
A handle to a dihedral bond
This is a safe way to work with a dihedral bond.
Construct a new dihedral handle from an existing dihedral id
- Parameters:
id – id of existing dihedral
- property angle
dihedral angle
- property energy
dihedral energy
- property parts
bonded particles
- property potential
dihedral potential
- property id
dihedral id
- property dissociation_energy
bond dissociation energy
- property half_life
dihedral half life
- property style
dihedral style
- property age
dihedral age
- get() TissueForge::Dihedral *
Gets the dihedral of this handle
- Return type:
- Returns:
dihedral, if available
- has(*args) bool
Overload 1: Test whether the bond has an id
Overload 2: Test whether the bond has a particle
- __str__() str
Return str(self).
- __getitem__(index: int)
- __contains__(item)
- __lt__(rhs) bool
Return self<value.
- __gt__(rhs) bool
Return self>value.
- __le__(rhs) bool
Return self<=value.
- __ge__(rhs) bool
Return self>=value.
- __eq__(rhs) bool
Return self==value.
- __ne__(rhs) bool
Return self!=value.
- destroy() HRESULT
Destroy the dihedral
- static items() std::vector< TissueForge::DihedralHandle,std::allocator< TissueForge::DihedralHandle > >
Gets all dihedrals in the universe
- decays() bool
Tests whether this bond decays
- Return type:
boolean
- Returns:
true when the bond should decay
Binding
- tissue_forge.bind.particles(p: _Potential, a: Particle, b: Particle) HRESULT
Bind a potential to a pair of particles
- Parameters:
p (
Potential
) – The potentiala (
Particle
) – The first particleb (
Particle
) – The second particle
- Return type:
int
- Returns:
HRESULT
- tissue_forge.bind.types(p: _Potential, a: ParticleType, b: ParticleType, bound: bool = False) HRESULT
Bind a potential to a pair of particle types.
Automatically updates when running on a CUDA device.
- Parameters:
p (
Potential
) – The potentiala (
ParticleType
) – The first typeb (
ParticleType
) – The second typebound (boolean) – Flag signifying whether this potential exclusively operates on particles of different clusters, optional
- Return type:
int
- Returns:
HRESULT
- tissue_forge.bind.boundary_conditions(p: _Potential, t: ParticleType) HRESULT
Bind a potential to a pair of particle type and all boundary conditions.
Automatically updates when running on a CUDA device.
- Parameters:
p (
Potential
) – The potentialt (
ParticleType
) – The particle type
- Return type:
int
- Returns:
HRESULT
- tissue_forge.bind.boundary_condition(p: _Potential, bc: BoundaryCondition, t: ParticleType) HRESULT
Bind a potential to a pair of particle type and a boundary conditions.
Automatically updates when running on a CUDA device.
- Parameters:
p (
Potential
) – The potentialbc (
BoundaryCondition
) – The boundary conditiont (
ParticleType
) – The particle type
- Return type:
int
- Returns:
HRESULT
- tissue_forge.bind.force(*args) HRESULT
Overload 1:
Bind a force to a particle type
- Parameters:
force (
Force
) – The forcea_type (
ParticleType
) – The particle type
- Return type:
int
- Returns:
HRESULT
Overload 2:
Bind a force to a particle type with magnitude proportional to a species amount
- Parameters:
force (
Force
) – The forcea_type (
ParticleType
) – The particle typecoupling_symbol (string) – The symbol of the species
- Return type:
int
- Returns:
HRESULT
- tissue_forge.bind.bonds(potential, particles, cutoff, pairs=None, half_life=None, bond_energy=None, flags=0)
Reactions and Species
- class tissue_forge.state.Species(*args)
- __str__() str
Return str(self).
- toString() std::string
Get a JSON string representation
- Return type:
string
- Returns:
std::string
- static fromString(str: std::string const &) TissueForge::state::Species *
Create from a JSON string representation.
- Parameters:
str (string) –
- Return type:
- Returns:
Species*
- __reduce__()
Helper for pickle.
- property id: str
- property name: str
- property species_type: str
- property compartment: str
- property initial_amount: float
- property initial_concentration: float
- property substance_units: str
- property spatial_size_units: str
- property units: str
- property has_only_substance_units: bool
- property boundary_condition: bool
- property charge: int
- property constant: bool
- property conversion_factor: str
- class tissue_forge.state.SpeciesValue(state_vector: _state_StateVector, index: uint32_t)
- property boundary_condition: bool
- property initial_amount: float
- property initial_concentration: float
- property constant: bool
- property value: float
- secrete(amount, to=None, distance=None)
Secrete this species into a neighborhood.
Requires either a list of neighboring particles or neighborhood distance.
- Parameters:
amount (float) – Amount to secrete.
to (ParticleList) – Optional list of particles to secrete to.
distance (float) – Neighborhood distance.
- Returns:
Amount actually secreted, accounting for availability and other subtleties.
- Return type:
float
- class tissue_forge.state.SpeciesList
- __str__() str
Return str(self).
- __len__() int
- __getattr__(item: str)
- __setattr__(item: str, value) None
Implement setattr(self, name, value).
- __getitem__(item) _state_Species
- __setitem__(item, value) None
- item(*args) TissueForge::state::Species *
Overload 1:
Get a species by index
- Parameters:
index (int) – index of the species
- Return type:
- Returns:
Species*
Overload 2:
Get a species by name
- Parameters:
s (string) – name of species
- Return type:
- Returns:
Species*
- insert(*args) HRESULT
Overload 1:
Insert a species
- Return type:
int
- Returns:
HRESULT
Overload 2:
Insert a species by name
- Parameters:
s (string) – name of the species
- Return type:
int
- Returns:
HRESULT
- toString() std::string
Get a JSON string representation
- Return type:
string
- Returns:
std::string
- static fromString(str: std::string const &) TissueForge::state::SpeciesList *
Create from a JSON string representation.
- Parameters:
str (string) –
- Return type:
- Returns:
SpeciesList*
- __reduce__()
Helper for pickle.
- class tissue_forge.state.StateVector(*args)
- __str__() str
Return str(self).
- __len__() int
- __getattr__(item: str)
- __setattr__(item: str, value: float) None
Implement setattr(self, name, value).
- __getitem__(item: int)
- __setitem__(item: int, value: float) None
- toString() std::string
Get a JSON string representation
- Return type:
string
- Returns:
std::string
- static fromString(str: std::string const &) TissueForge::state::StateVector *
Create from a JSON string representation.
- Parameters:
str (string) –
- Return type:
- Returns:
StateVector*
- __reduce__()
Helper for pickle.
- species
Species of the state vector
Events
- class tissue_forge.event.Event(invokeExecutor: EventPyInvokePyExecutor, predicateExecutor: EventPyPredicatePyExecutor | None = None)
- invoke() HRESULT
What occurs during an event. Typically, this invokes an underlying specialized method returns 0 if OK and 1 on error.
- property last_fired
Record of last time fired
- predicate() HRESULT
Evaluates an event predicate, returns 0 if the event should not fire, 1 if the event should, and a negative value on error. A predicate without a defined predicate method always returns 0
- remove() void
Designates event for removal
- property thisown
The membership flag
- property times_fired
Record of how many times fired
- tissue_forge.event.on_event(invoke_method, predicate_method=None)
Creates and registers an event using prescribed invoke and predicate python function executors
- Parameters:
invoke_method (PyObject) – an invoke method; evaluated when an event occurs. Takes an
event.Event
instance as argument and returns 0 on success, 1 on errorpredicate_method – optional predicate method; decides if an event occurs. Takes a
Event
instance as argument and returns 1 to trigger event, -1 on error and 0 otherwise
- class tissue_forge.event.TimeEvent(period: FloatP_t const &, invokeExecutor: TimeEventPyInvokePyExecutor, predicateExecutor: TimeEventPyPredicatePyExecutor = None, nextTimeSetter: TissueForge::event::TimeEventNextTimeSetter * = None, start_time: FloatP_t const & = 0, end_time: FloatP_t const & = -1)
- property end_time
End time of evaluations
- eval(time: FloatP_t const &) HRESULT
- property flags
- invoke() HRESULT
What occurs during an event. Typically, this invokes an underlying specialized method returns 0 if OK and 1 on error.
- property last_fired
Record of last time fired
- property next_time
Next time of evaluation
- property period
Period of evaluation
- predicate() HRESULT
Evaluates an event predicate, returns 0 if the event should not fire, 1 if the event should, and a negative value on error. A predicate without a defined predicate method always returns 0
- remove() void
Designates event for removal
- property start_time
Start time of evaluations
- property thisown
The membership flag
- property times_fired
Record of how many times fired
- tissue_forge.event.on_time(period, invoke_method, predicate_method=None, distribution='default', start_time=0.0, end_time=-1.0)
Like
on_event
, but for an event that occurs at regular intervals.- Parameters:
period (float) – period of event
invoke_method (PyObject) – an invoke method; evaluated when an event occurs. Takes an
TimeEvent
instance as argument and returns 0 on success, 1 on errorpredicate_method – optional predicate method; decides if an event occurs. Takes a
TimeEvent
instance as argument and returns 1 to trigger event, -1 on error and 0 otherwisedistribution (str) – distribution by which the next event time is selected
start_time (float) – time after which the event can occur
end_time (float) – time before which the event can occur; a negative value is interpreted as until ‘forever’
- class tissue_forge.event.ParticleEvent(*args)
- eval(time: FloatP_t const &) HRESULT
- property flags
- invoke() HRESULT
What occurs during an event. Typically, this invokes an underlying specialized method returns 0 if OK and 1 on error.
- property last_fired
Record of last time fired
- predicate() HRESULT
Evaluates an event predicate, returns 0 if the event should not fire, 1 if the event should, and a negative value on error. A predicate without a defined predicate method always returns 0
- remove() void
Designates event for removal
- setParticleEventParticleSelector(*args) HRESULT
- property targetParticle
Target particle of an event evaluation
- property targetType
Target particle type of this event
- property thisown
The membership flag
- property times_fired
Record of how many times fired
- tissue_forge.event.on_particle(ptype, invoke_method, predicate_method=None, selector='default', single: bool = False)
Like
on_event
, but for a particle of a particular particle type.- Parameters:
ptype (ParticleType) – the type of particle to select
invoke_method (PyObject) – an invoke method; evaluated when an event occurs. Takes an
ParticleEvent
instance as argument and returns 0 on success, 1 on errorpredicate_method – optional predicate method; decides if an event occurs. Takes a
ParticleEvent
instance as argument and returns 1 to trigger event, -1 on error and 0 otherwiseselector (str) – name of particle selector
single (bool) – flag to only trigger event once and then return
- class tissue_forge.event.ParticleTimeEvent(*args)
- property end_time
Time at which evaluations stop
- eval(time: FloatP_t const &) HRESULT
- property flags
- invoke() HRESULT
What occurs during an event. Typically, this invokes an underlying specialized method returns 0 if OK and 1 on error.
- property last_fired
Record of last time fired
- property next_time
Next time at which an evaluation occurs
- property period
Period of event evaluations
- predicate() HRESULT
Evaluates an event predicate, returns 0 if the event should not fire, 1 if the event should, and a negative value on error. A predicate without a defined predicate method always returns 0
- remove() void
Designates event for removal
- property start_time
Time at which evaluations begin
- property targetParticle
Target particle of an event evaluation
- property targetType
Target particle type of this event
- property thisown
The membership flag
- property times_fired
Record of how many times fired
- tissue_forge.event.on_particletime(ptype, period, invoke_method, predicate_method=None, distribution='default', start_time=0.0, end_time=-1.0, selector='default')
A combination of
on_time
andon_particle
.- Parameters:
ptype (ParticleType) – the type of particle to select
period (float) – period of event
invoke_method (PyObject) – an invoke method; evaluated when an event occurs. Takes an
TimeEvent
instance as argument and returns 0 on success, 1 on errorpredicate_method – optional predicate method; decides if an event occurs. Takes a
TimeEvent
instance as argument and returns 1 to trigger event, -1 on error and 0 otherwisedistribution (str) – distribution by which the next event time is selected
start_time (str) – time after which the event can occur
end_time (float) – time before which the event can occur; a negative value is interpreted as until ‘forever’
selector (str) – name of particle selector
- class tissue_forge.event.KeyEvent(glfw_event: Magnum::Platform::GlfwApplication::KeyEvent * = None)
- static addDelegate(_delegate: TissueForge::event::KeyEventDelegateType *) TissueForge::event::KeyEventDelegateHandle
Adds an event delegate
- Parameters:
_delegate (int) – delegate to add
- Return type:
int
- Returns:
handle for future getting and removing
- static addHandler(_handler: TissueForge::event::KeyEventHandlerType *) TissueForge::event::KeyEventHandlerHandle
Adds an event handler
- Parameters:
_handler (int) – handler to add
- Return type:
int
- Returns:
handle for future getting and removing
- static getDelegate(handle: TissueForge::event::KeyEventDelegateHandle const &) TissueForge::event::KeyEventDelegateType *
Get an event delegate
- Parameters:
handle (int) – delegate handle
- Return type:
int
- Returns:
delegate if handle is valid, otherwise NULL
- static getHandler(handle: TissueForge::event::KeyEventHandlerHandle const &) TissueForge::event::KeyEventHandlerType *
Get an event handler
- Parameters:
handle (int) – handler handle
- Return type:
int
- Returns:
handler if handle is valid, otherwise NULL
- property glfw_event
- static invoke(*args) HRESULT
- keyAlt() bool
- keyCtrl() bool
- keyName() std::string
- keyShift() bool
- property key_alt: bool
Flag for whether Alt key is pressed
- property key_ctrl: bool
Flag for whether Ctrl key is pressed
- property key_name: str
Key pressed for this event
- property key_shift: bool
Flag for whether Shift key is pressed
- static removeDelegate(handle: TissueForge::event::KeyEventDelegateHandle const &) bool
Remove an event delegate
- Parameters:
handle (int) – delegate handle
- Return type:
boolean
- Returns:
true when delegate is removed
- Return type:
boolean
- Returns:
false when handle is invalid
- static removeHandler(handle: TissueForge::event::KeyEventHandlerHandle const &) bool
Remove an event handler
- Parameters:
handle (int) – handler handle
- Return type:
boolean
- Returns:
true when handler is removed
- Return type:
boolean
- Returns:
false when handle is invalid
- property thisown
The membership flag
Lattices
- class tissue_forge.lattice.BondRule(func: Callable[[ParticleHandle, ParticleHandle], BondHandle], part_ids: Tuple[int, int], cell_offset: Tuple[int, int, int])
Simple container for info to create a bond when constructing a lattice
- Parameters:
func – function of func(p1, p2) that accepts two particle handles and returns a newly created bond.
part_ids – pair of particle ids in current current and other unit cell.
cell_offset – offset vector of other unit cell relative to current unit cell.
- class tissue_forge.lattice.unitcell(N: int, a1: List[float], a2: List[float], a3: List[float], dimensions: int = 3, position: List[List[float]] | None = None, types: List[ParticleType] | None = None, bonds: List[BondRule] | None = None)
A unit cell
A unit cell is a box definition (a1, a2, a3, dimensions), and particle properties for N particles. You do not need to specify all particle properties. Any property omitted will be initialized to defaults. The function
create_lattice
initializes the system with many copies of a unit cell.unitcell
is a completely generic unit cell representation. See other classes in thelattice
module for convenience wrappers for common lattices.Example:
uc = lattice.unitcell(N=2, a1=[1, 0, 0], a2=[0.2, 1.2, 0], a3=[-0.2, 0, 1.0], dimensions=3, position=[[0, 0, 0], [0.5, 0.5, 0.5]], types=[A, B])
- Note:
a1, a2, a3 must define a right handed coordinate system.
- Parameters:
N (int) – Number of particles in the unit cell.
a1 (List[float]) – Lattice vector (3-vector).
a2 (List[float]) – Lattice vector (3-vector).
a3 (List[float]) – Lattice vector (3-vector).
dimensions (int) – Dimensionality of the lattice (2 or 3).
position (List[List[float]]) – List of particle positions.
types (List[tf.ParticleType]) – List of particle types
bonds (List[BondRule]) – bond constructors rules
- tissue_forge.lattice.sc(a: float, types: ParticleType | None = None, bond: Callable[[ParticleHandle, ParticleHandle], BondHandle] | List[Callable[[ParticleHandle, ParticleHandle], BondHandle]] | None = None, bond_vector: Tuple[bool] = (True, True, True)) unitcell
Create a unit cell for a simple cubic lattice (3D).
The simple cubic lattice unit cell has one particle:
[0, 0, 0]
And the box matrix:
[[a, 0, 0]
[0, a, 0]
[0, 0, a]]
Example:
uc = tissue_forge.lattice.sc(1.0, A, lambda i, j: tf.Bond.create(pot, i, j, dissociation_energy=100.0))
- Parameters:
a – lattice constant
types – particle type
bond – bond constructor(s)
bond_vector – flags for creating bonds in the 1-, 2-, and 3-directions
- Returns:
a simple cubic lattice unit cell
- tissue_forge.lattice.bcc(a: float, types: ParticleType | List[ParticleType] | None = None, bond: Callable[[ParticleHandle, ParticleHandle], BondHandle] | List[Callable[[ParticleHandle, ParticleHandle], BondHandle]] | None = None, bond_vector: Tuple[bool] = (True, True)) unitcell
Create a unit cell for a body centered cubic lattice (3D).
The body centered cubic lattice unit cell has two particles:
[0, 0, 0]
[a/2, a/2, a/2]
And the box matrix:
[[a, 0, 0]
[0, a, 0]
[0, 0, a]]
Example:
uc = tissue_forge.lattice.bcc(1.0, A, lambda i, j: tf.Bond.create(pot, i, j, dissociation_energy=100.0))
- Parameters:
a – lattice constant
types – particle type or list of particle types
bond – bond constructor(s)
bond_vector – flags for creating bonds - between the corner particles - between the corner and center particles
- Returns:
a body centered cubic lattice unit cell
- tissue_forge.lattice.fcc(a: float, types: ParticleType | List[ParticleType] | None = None, bond: Callable[[ParticleHandle, ParticleHandle], BondHandle] | List[Callable[[ParticleHandle, ParticleHandle], BondHandle]] | None = None, bond_vector: Tuple[bool] = (True, True)) unitcell
Create a unit cell for a face centered cubic lattice (3D).
The face centered cubic lattice unit cell has four particles:
[0, 0, 0]
[0, a/2, a/2]
[a/2, 0, a/2]
[a/2, a/2, 0]]
And the box matrix:
[[a, 0, 0]
[0, a, 0]
[0, 0, a]]
Example:
uc = tissue_forge.lattice.fcc(1.0, A, lambda i, j: tf.Bond.create(pot, i, j, dissociation_energy=100.0))
- Parameters:
a – lattice constant
types – particle type or list of particle types
bond – bond constructor(s)
bond_vector – flags for creating bonds - between the corner particles - between the corner and the center particles
- Returns:
a face centered cubic lattice unit cell
- tissue_forge.lattice.sq(a: float, types: ParticleType | List[ParticleType] | None = None, bond: Callable[[ParticleHandle, ParticleHandle], BondHandle] | List[Callable[[ParticleHandle, ParticleHandle], BondHandle]] | None = None, bond_vector: Tuple[bool] = (True, True, False)) unitcell
Create a unit cell for a square lattice (2D).
The square lattice unit cell has one particle:
[0, 0]
And the box matrix:
[[a, 0]
[0, a]]
Example:
uc = tissue_forge.lattice.sq(1.0, A, lambda i, j: tf.Bond.create(pot, i, j, dissociation_energy=100.0))
- Parameters:
a – lattice constant
types – particle type or list of particle types
bond – bond constructor(s)
bond_vector – flags for creating bonds along the 1-, 2- and 3-directions
- Returns:
a square lattice unit cell
- tissue_forge.lattice.hex2d(a: float, types: ParticleType | List[ParticleType] | None = None, bond: Callable[[ParticleHandle, ParticleHandle], BondHandle] | List[Callable[[ParticleHandle, ParticleHandle], BondHandle]] | None = None, bond_vector: Tuple[bool] = (True, True, False)) unitcell
Create a unit cell for a hexagonal lattice (2D).
The hexagonal lattice unit cell has two particles:
[0, 0]
[0, a*sqrt(3)/2]
And the box matrix:
[[a, 0]
[0, a*sqrt(3)]]
Example:
uc = tissue_forge.lattice.hex2d(1.0, A, lambda i, j: tf.Bond.create(pot, i, j, dissociation_energy=100.0))
- Parameters:
a – lattice constant
types – particle type or list of particle types
bond – bond constructor(s)
bond_vector – flags for creating bonds along the 1-, 2- and 3-directions
- Returns:
a hexagonal lattice unit cell
- tissue_forge.lattice.hcp(a: float, c: float | None = None, types: ParticleType | List[ParticleType] | None = None, bond: Callable[[ParticleHandle, ParticleHandle], BondHandle] | List[Callable[[ParticleHandle, ParticleHandle], BondHandle]] | None = None, bond_vector: Tuple[bool] = (True, True, True)) unitcell
Create a unit cell for a hexagonal close pack lattice (3D).
The hexagonal close pack lattice unit cell has seven particles:
[0, a*sqrt(3)/2, 0]
[a/2, 0, 0]
[a, a*sqrt(3)/2, 0]
[a*3/2, 0, 0]
[a/2, a*2/sqrt(3), c/2]
[a, a/2/sqrt(3), c/2]
[a*3/2, a*2/sqrt(3), c/2]
And the box matrix:
[[2*a, 0, 0]
[0, a*sqrt(3), 0]
[0, 0, c]]
Example:
uc = tissue_forge.lattice.hcp(1.0, 2.0, A, lambda i, j: tf.Bond.create(pot, i, j, dissociation_energy=100.0))
- Parameters:
a – lattice constant
c – height of lattice (default
a
)types – particle type or list of particle types
bond – bond constructor(s)
bond_vector – flags for creating bonds - between the outer particles - between the inner particles - between the outer and inner particles
- Returns:
a hexagonal close pack lattice unit cell
- tissue_forge.lattice.create_lattice(uc: unitcell, n: int | List[int], origin: List[float] | None = None) ndarray
Create a lattice
Takes a unit cell and replicates it the requested number of times in each direction. A generic
unitcell
may have arbitrary vectorsa1
,a2
, anda3
.create_lattice
will rotate the unit cell so thata1
points in thex
direction anda2
is in thexy
plane so that the lattice may be represented as a simulation box. Whenn
is a single value, the lattice is replicatedn
times in each direction. Whenn
is a list, the lattice is replicatedn[i]
times in each ``i``th direction.Examples:
tissue_forge.lattice.create_lattice(uc=tissue_forge.lattice.sc(a=1.0), n=[2,4,2]) tissue_forge.lattice.create_lattice(uc=tissue_forge.lattice.bcc(a=1.0), n=10) tissue_forge.lattice.create_lattice(uc=tissue_forge.lattice.sq(a=1.2), n=[100,10]) tissue_forge.lattice.create_lattice(uc=tissue_forge.lattice.hex2d(a=1.0), n=[100,58])
- Parameters:
uc – unit cell
n – number of unit cells to create along all/each direction(s)
origin – origin to begin creating lattice (default centered about simulation origin)
- Returns:
particles created in every unit cell
Style
- class tissue_forge.rendering.ColorMapper(*args)
- property min_val
minimum value of map
- property max_val
maximum value of map
- property has_map_particle: bool
- property has_map_angle: bool
- property has_map_bond: bool
- property has_map_dihedral: bool
- clear_map_particle() void
Clear the particle map
- clear_map_angle() void
Clear the angle map
- clear_map_bond() void
Clear the bond map
- clear_map_dihedral() void
Clear the dihedral map
- set_map_particle_position_x() void
Set the particle map to x-coordinate of particle position
- set_map_particle_position_y() void
Set the particle map to y-coordinate of particle position
- set_map_particle_position_z() void
Set the particle map to z-coordinate of particle position
- set_map_particle_velocity_x() void
Set the particle map to x-component of particle velocity
- set_map_particle_velocity_y() void
Set the particle map to y-component of particle velocity
- set_map_particle_velocity_z() void
Set the particle map to z-component of particle velocity
- set_map_particle_speed() void
Set the particle map to particle speed
- set_map_particle_force_x() void
Set the particle map to x-component of particle force
- set_map_particle_force_y() void
Set the particle map to y-component of particle force
- set_map_particle_force_z() void
Set the particle map to z-component of particle force
- set_map_particle_species(pType: ParticleType, name: std::string const &) void
Set the particle map to a species value
- Parameters:
pType (
ParticleType
) – particle typename (string) – species name
- set_map_angle_angle() void
Set the angle map to angle
- set_map_angle_angle_eq() void
Set the angle map to angle from equilibrium
- set_map_bond_length() void
Set the bond map to length
- set_map_bond_length_eq() void
Set the bond map to length from equilibrium
- set_map_dihedral_angle() void
Set the dihedral map to angle
- set_map_dihedral_angle_eq() void
Set the dihedral map to angle from equilibrium
- class tissue_forge.rendering.Style(*args)
- property color
Default color
- property visible: bool
Visibility flag
- property colormap: str
Name of color map
- property mapper
Color mapper of this style
- setColor(colorName: std::string const &) HRESULT
Set the color by name
- Parameters:
colorName (string) – name of color
- Return type:
int
- Returns:
HRESULT
- toString() std::string
Get a JSON string representation
- Return type:
string
- Returns:
std::string
- static fromString(str: std::string const &) TissueForge::rendering::Style *
Create from a JSON string representation.
- Parameters:
str (string) –
- Return type:
- Returns:
Style*
- __reduce__()
Helper for pickle.
Rendering
- class tissue_forge.rendering.ClipPlane(i: int)
- property index
Index of the clip plane. Less than zero if clip plane has been destroyed.
- getEquation() TissueForge::fVector4
Get the coefficients of the plane equation of the clip plane
- Return type:
fVector4
- Returns:
fVector4
- setEquation(*args) HRESULT
Overload 1:
Set the coefficients of the plane equation of the clip plane
- Parameters:
pe (
fVector4
) –- Return type:
int
- Returns:
HRESULT
Overload 2:
Set the coefficients of the plane equation of the clip plane using a point on the plane and its normal
- Parameters:
point (
fVector3
) – plane pointnormal (
fVector3
) – plane normal vector
- Return type:
int
- Returns:
HRESULT
- destroy() HRESULT
Destroy the clip plane
- Return type:
int
- Returns:
HRESULT
- class tissue_forge.rendering.ClipPlanes
- static len() int
Get the number of clip planes
- Return type:
int
- Returns:
int
- static getClipPlaneEquation(index: unsigned int const &) TissueForge::fVector4 const &
Get the coefficients of the equation of a clip plane
- Parameters:
index (int) – index of the clip plane
- Return type:
fVector4
- Returns:
const fVector4&
- static setClipPlaneEquation(index: unsigned int const &, pe: fVector4) HRESULT
Set the coefficients of the equation of a clip plane.
The clip plane must already exist
- Parameters:
index (int) – index of the clip plane
pe (
fVector4
) – coefficients of the plane equation of the clip plane
- Return type:
int
- Returns:
HRESULT
- static item(index: unsigned int const &) TissueForge::rendering::ClipPlane
Get a clip plane by index
- Parameters:
index (int) – index of the clip plane
- Return type:
- Returns:
ClipPlane
- static create(*args) TissueForge::rendering::ClipPlane
Overload 1:
Create a clip plane
- Parameters:
pe (
fVector4
) – coefficients of the equation of the plane- Return type:
- Returns:
ClipPlane
Overload 2:
Create a clip plane
- Parameters:
point (
fVector3
) – point on the clip planenormal (
fVector3
) – normal of the clip plane
- Return type:
- Returns:
ClipPlane
System
- tissue_forge.system.print_performance_counters() void
- tissue_forge.system.context_has_current() bool
- tissue_forge.system.context_make_current() HRESULT
- tissue_forge.system.context_release() HRESULT
- tissue_forge.system.camera_move_to(*args) HRESULT
Overload 1:
Set the camera view parameters
- Parameters:
eye (
FVector3
) – camera eyecenter (
FVector3
) – view centerup (
FVector3
) – view upward direction
- Return type:
int
- Returns:
HRESULT
Overload 2:
Set the camera view parameters
- Parameters:
center (
FVector3
) – target camera view center positionrotation (
FQuaternion
) – target camera rotationzoom (float) – target camera zoom
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_view_bottom() HRESULT
Move the camera to view the domain from the bottm
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_view_top() HRESULT
Move the camera to view the domain from the top
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_view_left() HRESULT
Move the camera to view the domain from the left
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_view_right() HRESULT
Move the camera to view the domain from the right
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_view_back() HRESULT
Move the camera to view the domain from the back
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_view_front() HRESULT
Move the camera to view the domain from the front
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_reset() HRESULT
Reset the camera
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_translate_down() HRESULT
Translate the camera down
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_translate_up() HRESULT
Translate the camera up
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_translate_right() HRESULT
Translate the camera right
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_translate_left() HRESULT
Translate the camera left
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_translate_forward() HRESULT
Translate the camera forward
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_translate_backward() HRESULT
Translate the camera backward
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_rotate_down() HRESULT
Rotate the camera down
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_rotate_up() HRESULT
Rotate the camera up
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_rotate_left() HRESULT
Rotate the camera left
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_rotate_right() HRESULT
Rotate the camera right
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_roll_left() HRESULT
Roll the camera left
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_roll_right() HRESULT
Rotate the camera right
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_zoom_in() HRESULT
Zoom the camera in
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_zoom_out() HRESULT
Zoom the camera out
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_zoom_by(delta: float const &) HRESULT
Zoom the camera by an increment in distance.
Positive values zoom in.
- Parameters:
delta (float) – zoom increment
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_zoom_to(distance: float const &) HRESULT
Zoom the camera to a distance.
- Parameters:
distance (float) – zoom distance
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_rotate_to_axis(axis: fVector3, distance: float const &) HRESULT
Rotate the camera to a point from the view center a distance along an axis.
Only rotates the view to the given eye position.
- Parameters:
axis (
FVector3
) – axis from the view centerdistance (float) – distance along the axis
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_rotate_to_euler_angle(angles: fVector3) HRESULT
Rotate the camera to a set of Euler angles.
Rotations are Z-Y-X.
- Parameters:
angles (
FVector3
) –- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_rotate_by_euler_angle(angles: fVector3) HRESULT
Rotate the camera by a set of Euler angles.
Rotations are Z-Y-X.
- Parameters:
angles (
FVector3
) –- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.camera_center() TissueForge::FVector3
Get the current camera view center position
- Return type:
FVector3
- Returns:
FVector3
- tissue_forge.system.camera_rotation() TissueForge::FQuaternion
Get the current camera rotation
- Return type:
FQuaternion
- Returns:
FQuaternion
- tissue_forge.system.camera_zoom() float
Get the current camera zoom
- Return type:
float
- Returns:
float
- tissue_forge.system.get_renderer() TissueForge::rendering::UniverseRenderer *
Get the universe renderer
- Return type:
TissueForge::rendering::UniverseRenderer
- Returns:
struct rendering::UniverseRenderer*
- tissue_forge.system.get_rendering_3d_bonds() bool const
Get whether bonds are renderered with 3D objects
- tissue_forge.system.set_rendering_3d_bonds(_flag: bool const &) void
Set whether bonds are renderered with 3D objects
- tissue_forge.system.toggle_rendering_3d_bonds() void
Toggle whether bonds are renderered with 3D objects
- tissue_forge.system.get_rendering_3d_angles() bool const
Get whether angles are renderered with 3D objects
- tissue_forge.system.set_rendering_3d_angles(_flag: bool const &) void
Set whether angles are renderered with 3D objects
- tissue_forge.system.toggle_rendering_3d_angles() void
Toggle whether angles are renderered with 3D objects
- tissue_forge.system.get_rendering_3d_dihedrals() bool const
Get whether dihedrals are renderered with 3D objects
- tissue_forge.system.set_rendering_3d_dihedrals(_flag: bool const &) void
Set whether dihedrals are renderered with 3D objects
- tissue_forge.system.toggle_rendering_3d_dihedrals() void
Toggle whether dihedrals are renderered with 3D objects
- tissue_forge.system.set_rendering_3d_all(_flag: bool const &) void
Set whether bonds, angle and dihedrals are renderered with 3D objects
- tissue_forge.system.toggle_rendering_3d_all() void
Toggle whether bonds, angle and dihedrals are renderered with 3D objects
- tissue_forge.system.get_ambient_color() TissueForge::FVector3
Get the ambient color
- Return type:
FVector3
- Returns:
FVector3
- tissue_forge.system.set_ambient_color(*args) HRESULT
Overload 1:
Set the ambient color
- Parameters:
color (
FVector3
) –- Return type:
int
- Returns:
HRESULT
Overload 2:
Set the ambient color of a subrenderer
- Parameters:
color (
FVector3
) –srFlag (int) –
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.get_diffuse_color() TissueForge::FVector3
Get the diffuse color
- Return type:
FVector3
- Returns:
FVector3
- tissue_forge.system.set_diffuse_color(*args) HRESULT
Overload 1:
Set the diffuse color
- Parameters:
color (
FVector3
) –- Return type:
int
- Returns:
HRESULT
Overload 2:
Set the diffuse color of a subrenderer
- Parameters:
color (
FVector3
) –srFlag (int) –
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.get_specular_color() TissueForge::FVector3
Get specular color
- Return type:
FVector3
- Returns:
FVector3
- tissue_forge.system.set_specular_color(*args) HRESULT
Overload 1:
Set the specular color
- Parameters:
color (
FVector3
) –- Return type:
int
- Returns:
HRESULT
Overload 2:
Set the specular color of a subrenderer
- Parameters:
color (
FVector3
) –srFlag (int) –
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.get_shininess() float
Get the shininess
- Return type:
float
- Returns:
float
- tissue_forge.system.set_shininess(*args) HRESULT
Overload 1:
Set the shininess
- Parameters:
shininess (float) –
- Return type:
int
- Returns:
HRESULT
Overload 2:
Set the shininess of a subrenderer
- Parameters:
shininess (float) –
srFlag (int) –
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.get_grid_color() TissueForge::FVector3
Get the grid color
- Return type:
FVector3
- Returns:
FVector3
- tissue_forge.system.set_grid_color(color: fVector3) HRESULT
Set the grid color
- Parameters:
color (
FVector3
) –- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.get_scene_box_color() TissueForge::FVector3
Get the scene box color
- Return type:
FVector3
- Returns:
FVector3
- tissue_forge.system.set_scene_box_color(color: fVector3) HRESULT
Set the scene box color
- Parameters:
color (
FVector3
) –- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.get_light_direction() TissueForge::FVector3
Get the light direction
- Return type:
FVector3
- Returns:
FVector3
- tissue_forge.system.set_light_direction(*args) HRESULT
Overload 1:
Set the light direction
- Parameters:
lightDir (
FVector3
) –- Return type:
int
- Returns:
HRESULT
Overload 2:
Set the light direction of a subrenderer
- Parameters:
lightDir (
FVector3
) –srFlag (int) –
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.get_light_color() TissueForge::FVector3
Get the light color
- Return type:
FVector3
- Returns:
FVector3
- tissue_forge.system.set_light_color(*args) HRESULT
Overload 1:
Set the light color
- Parameters:
color (
FVector3
) –- Return type:
int
- Returns:
HRESULT
Overload 2:
Set the light color of a subrenderer
- Parameters:
color (
FVector3
) –srFlag (int) –
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.get_background_color() TissueForge::FVector3
Get the background color
- Return type:
FVector3
- Returns:
FVector3
- tissue_forge.system.set_background_color(color: fVector3) HRESULT
Set the background color
- Parameters:
color (
FVector3
) –- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.decorated() bool
Test whether the rendered scene is decorated
- Return type:
boolean
- Returns:
true
- Return type:
boolean
- Returns:
false
- tissue_forge.system.decorate_scene(decorate: bool const &) HRESULT
Set flag to draw/not draw scene decorators (e.g., grid)
- Parameters:
decorate (boolean) – flag; true says to decorate
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.showing_discretization() bool
Test whether discretization is current shown
- Return type:
boolean
- Returns:
true
- Return type:
boolean
- Returns:
false
- tissue_forge.system.show_discretization(show: bool const &) HRESULT
Set flag to draw/not draw discretization
- Parameters:
show (boolean) – flag; true says to show
- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.get_discretizationColor() TissueForge::FVector3
Get the current color of the discretization grid
- Return type:
FVector3
- Returns:
FVector3
- tissue_forge.system.set_discretizationColor(color: fVector3) HRESULT
Set the color of the discretization grid
- Parameters:
color (
FVector3
) –- Return type:
int
- Returns:
HRESULT
- tissue_forge.system.performance_counters() std::string
- tissue_forge.system.egl_info() std::string
Get EGL info
- Return type:
string
- Returns:
std::string
- tissue_forge.system.image_data() PyObject *
- tissue_forge.system.is_terminal_interactive() bool
Test whether Tissue Forge is running in an interactive terminal
- Return type:
boolean
- Returns:
true if running in an interactive terminal
- Return type:
boolean
- Returns:
false
- tissue_forge.system.is_jupyter_notebook() bool
Test whether Tissue Forge is running in a Jupyter notebook
- Return type:
boolean
- Returns:
true if running in a Jupyter notebook
- Return type:
boolean
- Returns:
false
- tissue_forge.system.jwidget_init(args: PyObject *, kwargs: PyObject *) PyObject *
- tissue_forge.system.jwidget_run(args: PyObject *, kwargs: PyObject *) PyObject *
- tissue_forge.system.color_mapper_names() std::vector< std::string,std::allocator< std::string > >
Get all available color mapper names
- tissue_forge.system.add_render_arrow(*args) std::pair< int,TissueForge::rendering::ArrowData * >
Overload 1:
Adds a vector visualization specification.
The passed pointer is borrowed. The client is responsible for maintaining the underlying data. The returned integer can be used to reference the arrow when doing subsequent operations with the renderer (e.g., removing an arrow from the scene).
- Parameters:
arrow (
ArrowData
) – pointer to visualization specs- Return type:
int
- Returns:
id of arrow according to the renderer
Overload 2:
Adds a vector visualization specification.
The passed pointer is borrowed. The client is responsible for maintaining the underlying data. The returned integer can be used to reference the arrow when doing subsequent operations with the renderer (e.g., removing an arrow from the scene).
- Parameters:
position (
FVector3
) – position of vectorcomponents (
FVector3
) – components of vectorstyle (
Style
) – style of vectorscale (float) – scale of vector; defaults to 1.0
- Return type:
std::pair< int,TissueForge::rendering::ArrowData * >
- Returns:
id of arrow according to the renderer and arrow
- tissue_forge.system.remove_render_arrow(arrowId: int const &) HRESULT
Removes a vector visualization specification.
The removed pointer is only forgotten. The client is responsible for clearing the underlying data.
- Parameters:
arrowId (int) – id of arrow according to the renderer
- tissue_forge.system.get_render_arrow(arrowId: int const &) TissueForge::rendering::ArrowData *
Gets a vector visualization specification.
- Parameters:
arrowId (int) – id of arrow according to the renderer
- tissue_forge.system.cpu_info() dict
Dictionary of CPU info
- tissue_forge.system.compile_flags() dict
Dictionary of CPU info
- tissue_forge.system.gl_info() dict
Dictionary of OpenGL info
- tissue_forge.system.screenshot(filepath: str, decorate: bool | None = None, bgcolor=None)
Save a screenshot of the current scene
- Parameters:
filepath (str) – path of file to save
decorate (bool) – flag to decorate the scene in the screenshot
bgcolor (FVector3 or [float, float, float] or (float, float, float) or float) – background color of the scene in the screenshot
- Return type:
int
- Returns:
HRESULT
Logging
- class tissue_forge.Logger
The Tissue Forge logger.
A set of static method for setting the logging level.
- static setLevel(*args, **kwargs) void
Set the Level objectsets the logging level to one a value from Logger::Level
- Parameters:
level (int) – logging level
- static getLevel() int
Get the Level objectget the current logging level.
- Return type:
int
- Returns:
int
- static disableLogging() void
Suppresses all logging output
- static enableConsoleLogging(*args, **kwargs) void
turns on console logging at the given level.
- Parameters:
level (int) – logging level
- static disableConsoleLogging() void
stops logging to the console, but file logging may continue.
- static enableFileLogging(*args, **kwargs) void
turns on file logging to the given file as the given level.
If fileName is an empty string, then nothing occurs.
- Parameters:
fileName (string) – path to log file
level (int) – logging level
- static disableFileLogging() void
turns off file logging, but has no effect on console logging.
- static getCurrentLevelAsString() std::string
get the textural form of the current logging level.
- Return type:
string
- Returns:
std::string
- static getFileName() std::string
Get the File Name objectget the name of the currently used log file.
- Return type:
string
- Returns:
std::string
- static levelToString(level: int) std::string
gets the textual form of a logging level Enum for a given value.
- static stringToLevel(str: std::string const &) TissueForge::LogLevel
parses a string and returns a Logger::Level
- static log(level: TissueForge::LogLevel, msg: std::string const &) void
logs a message to the log.
- Parameters:
level (int) – logging level
msg (string) – log message
Error Handling
- class tissue_forge.Error
- property err
Error code
- property lineno
Originating line number
- property fname
Originating file name
- property func
Originating function name
- __str__() str
Return str(self).
- tissue_forge.err_occurred() bool
Check whether there is an error indicator.
- tissue_forge.err_clear() void
Clear the error indicators. If no error indicator is set, there is no effect.
- tissue_forge.err_get_all() std::vector< TissueForge::Error,std::allocator< TissueForge::Error > >
Get all error indicators
- tissue_forge.err_get_first() TissueForge::Error
Get the first error
- tissue_forge.err_clear_first() void
Clear the first error
- tissue_forge.err_pop_first() TissueForge::Error
Get and clear the first error
Utilities
- tissue_forge.random_point(kind: int, dr: float | None = None, phi0: float | None = None, phi1: float | None = None)
Get the coordinates of a random point in a kind of shape.
Currently supports
PointsType.Sphere
,PointsType.Disk
,PointsType.SolidCube
andPointsType.SolidSphere
.- Parameters:
kind – kind of shape
dr – thickness parameter; only applicable to solid sphere kind
phi0 – angle lower bound; only applicable to solid sphere kind
phi1 – angle upper bound; only applicable to solid sphere kind
- Returns:
coordinates of random points
- Return type:
- tissue_forge.random_points(kind: int, n: int = 1, dr: float | None = None, phi0: float | None = None, phi1: float | None = None)
Get the coordinates of random points in a kind of shape.
Currently supports
PointsType.Sphere
,PointsType.Disk
,PointsType.SolidCube
andPointsType.SolidSphere
.- Parameters:
kind – kind of shape
n – number of points
dr – thickness parameter; only applicable to solid sphere kind
phi0 – angle lower bound; only applicable to solid sphere kind
phi1 – angle upper bound; only applicable to solid sphere kind
- Returns:
coordinates of random points
- Return type:
list of
FVector3
- tissue_forge.points(kind: TissueForge::PointsType const &, n: unsigned int const & = 1) std::vector< TissueForge::FVector3,std::allocator< TissueForge::FVector3 > >
Get the coordinates of uniform points in a kind of shape.
Currently supports ring and sphere.
- Parameters:
kind (int) – kind of shape
n (int) – number of points
- Return type:
std::vector< TissueForge::FVector3,std::allocator< TissueForge::FVector3 > >
- Returns:
std::vector<FVector3>
- tissue_forge.filled_cube_uniform(corner1, corner2, num_parts_x: int = 2, num_parts_y: int = 2, num_parts_z: int = 2)
Get the coordinates of a uniformly filled cube.
- Parameters:
corner1 (list of float or
FVector3
) – first corner of cubecorner2 (list of float or
FVector3
) – second corner of cubenum_parts_x – number of particles along x-direction of filling axes (>=2)
num_parts_y – number of particles along y-direction of filling axes (>=2)
num_parts_z – number of particles along z-direction of filling axes (>=2)
- Returns:
coordinates of uniform points
- Return type:
list of
FVector3
- tissue_forge.filled_cube_random(corner1, corner2, num_particles: int)
Get the coordinates of a randomly filled cube.
- tissue_forge.icosphere(subdivisions: int, phi0: float, phi1: float)
Get the coordinates of an icosphere.
- Parameters:
subdivisions – number of subdivisions
phi0 – angle lower bound
phi1 – angle upper bound
- Returns:
vertices and indices
- Return type:
(list of
FVector3
, list of int)
- tissue_forge.color3_names()
Get the names of all available colors
- Return type:
list of str
- tissue_forge.random_vector(mean: FloatP_t, std: FloatP_t) TissueForge::FVector3
Generates a randomly oriented vector with random magnitude with given mean and standard deviation according to a normal distribution.
- Parameters:
mean (float) – magnitude mean
std (float) – magnitude standard deviation
- Return type:
- Returns:
FVector3
- tissue_forge.random_unit_vector() TissueForge::FVector3
Generates a randomly oriented unit vector.
- Return type:
- Returns:
FVector3
- tissue_forge.get_seed() unsigned int
Get the current seed for the pseudo-random number generator
- tissue_forge.set_seed(_seed: unsigned int const * = None) HRESULT
Set the current seed for the pseudo-random number generator
- Parameters:
_seed (int) –
- Return type:
int
- Returns:
HRESULT
Metrics
- tissue_forge.metrics.relative_position(pos: fVector3, origin: fVector3, comp_bc: bool const & = True) TissueForge::FVector3
Computes the relative position with respect to an origin while optionally account for boundary conditions.
If boundaries along a dimension are periodic, then this chooses the relative coordinate closest to the origin.
- Parameters:
pos (
FVector3
) – absolute positionorigin (
FVector3
) – origincomp_bc (boolean) – flag to compensate for boundary conditions; default true
- Return type:
FVector3
- Returns:
FVector3 relative position with respect to the given origin
- tissue_forge.metrics.neighborhood_particles(position: fVector3, dist: FloatP_t const &, comp_bc: bool const & = True) TissueForge::ParticleList
find all particles in a neighborhood defined by a point and distance
- tissue_forge.metrics.calculate_virial(origin: FloatP_t *, radius: FloatP_t, typeIds: std::set< short, std::less< short >, std::allocator< short > > const &, tensor: FloatP_t *) HRESULT
[in] origin of the sphere where we will comptute the local virial tensor. [in] include all partices a given radius in calculation. [in] vector of type ids to indlude in calculation, if empty, includes all particles. [out] result vector, writes a 3x3 matrix in a row-major in the given location.
If periodoc, we don’t include the periodic image cells, because we only calculate the forces within the simulation volume.
- tissue_forge.metrics.particles_virial(parts: int32_t *, nr_parts: uint16_t, flags: uint32_t, tensor: FloatP_t *) HRESULT
calculate the virial tensor for a specific list of particles. currently uses center of mass as origin, may change in the future with different flags.
flags currently ignored.
- tissue_forge.metrics.particles_radius_of_gyration(parts: int32_t *, nr_parts: uint16_t, result: FloatP_t *) HRESULT
- Parameters:
result: – pointer to float to store result.
- tissue_forge.metrics.particles_center_of_mass(parts: int32_t *, nr_parts: uint16_t, result: FloatP_t *) HRESULT
- Parameters:
result: – pointer to float[3] to store result
- tissue_forge.metrics.particles_center_of_geometry(parts: int32_t *, nr_parts: uint16_t, result: FloatP_t *) HRESULT
- Parameters:
result: – pointer to float[3] to store result.
- tissue_forge.metrics.particles_moment_of_inertia(parts: int32_t *, nr_parts: uint16_t, result: FloatP_t *) HRESULT
- Parameters:
result: – pointer to float[9] to store result.
- tissue_forge.metrics.cartesian_to_spherical(postion: fVector3, origin: fVector3) TissueForge::FVector3
converts cartesian to spherical, writes spherical coords in to result array. return FVector3{radius, theta, phi};
- tissue_forge.metrics.particle_neighbors(part: Particle, radius: FloatP_t, typeIds: std::set< short, std::less< short >, std::allocator< short > > const *, nr_parts: uint16_t *, parts: int32_t **) HRESULT
Searches and enumerates a location of space for all particles there.
Allocates a buffer, and stores the results there.
- Parameters:
part (
Particle
) – the particleradius (float) – [optional] the radius of the neighborhood
typeIds (std::set< short,std::less< short >,std::allocator< short > >) – [optional] set of type ids to include. If not given, gets all other parts within radius.
nr_parts (int) – [out] number of parts
parts (int) – [out] newly allocated buffer of particle ids.
- tissue_forge.metrics.eigenvals(*args) TissueForge::FVector4
Overload 1:
Compute the eigenvalues of a 3x3 matrix
- Parameters:
mat (
FMatrix3
) – the matrixsymmetric (boolean) – flag signifying whether the matrix is symmetric
- Return type:
FVector3
- Returns:
eigenvalues
Overload 2:
Compute the eigenvalues of a 4x4 matrix
- Parameters:
mat (
FMatrix4
) – the matrixsymmetric (boolean) – flag signifying whether the matrix is symmetric
- Return type:
FVector4
- Returns:
eigenvalues
- tissue_forge.metrics.eigenvecs_vals(*args) std::pair< TissueForge::FVector4,TissueForge::FMatrix4 >
Overload 1:
Compute the eigenvectors and eigenvalues of a 3x3 matrix
- Parameters:
mat (
FMatrix3
) – the matrixsymmetric (boolean) – flag signifying whether the matrix is symmetric
- Return type:
std::pair< TissueForge::FVector3,TissueForge::FMatrix3 >
- Returns:
eigenvalues, eigenvectors
Overload 2:
Compute the eigenvectors and eigenvalues of a 4x4 matrix
- Parameters:
mat (
FMatrix4
) – the matrixsymmetric (boolean) – flag signifying whether the matrix is symmetric
- Return type:
std::pair< TissueForge::FVector4,TissueForge::FMatrix4 >
- Returns:
eigenvalues, eigenvectors
Basic Tissue Forge Types
Tissue Forge uses some basic types that provide support and convenience
methods for particular operations, especially concerning vector and
tensor operations. Some of these types are completely native to
Tissue Forge, and others constructed partially or completely from
types distributed in various Tissue Forge dependencies (e.g.,
FVector3
from Vector3
, from
Magnum.
- class tissue_forge.dVector2(*args)
A 2D vector with
double
elements- static xAxis(*args, **kwargs) TissueForge::types::TVector2< double >
Get a vector in the X- (first-) direction of specified length
- static yAxis(*args, **kwargs) TissueForge::types::TVector2< double >
Get a vector in the Y- (second-) direction of specified length
- static xScale(scale: double) TissueForge::types::TVector2< double >
Get a scaling vector in the X- (first-) direction
- static yScale(scale: double) TissueForge::types::TVector2< double >
Get a scaling vector in the Y- (second-) direction
- x(*args) double
Overload 1: Get the X (first) component
Overload 2: Get the X (first) component
- y(*args) double
Overload 1: Get the Y (second) component
Overload 2: Get the Y (second) component
- flipped() TissueForge::types::TVector2< double >
- dot(*args) double
- angle(other)
angle made with another vector
- __len__() int
- __iadd__(*args) TissueForge::types::TVector2< double > &
- __add__(*args) TissueForge::types::TVector2< double >
- __isub__(*args) TissueForge::types::TVector2< double > &
- __sub__(*args) TissueForge::types::TVector2< double >
- __imul__(*args) TissueForge::types::TVector2< double > &
- __mul__(*args) TissueForge::types::TVector2< double >
- __itruediv__(*args)
- __truediv__(*args)
- length()
length of vector
- normalized()
vector normalized
- resized(length)
resize be a length
- projected(other)
project onto another vector
- projectedOntoNormalized(other)
project onto a normalized vector
- distance(line_start_pt, line_end_pt)
distance from a line defined by two points
- __getitem__(index: int)
- __setitem__(index: int, val)
- as_list() list
convert to a python list
- __str__() str
Return str(self).
- class tissue_forge.fVector2(*args)
A 2D vector with
float
elements- static xAxis(*args, **kwargs) TissueForge::types::TVector2< float >
Get a vector in the X- (first-) direction of specified length
- static yAxis(*args, **kwargs) TissueForge::types::TVector2< float >
Get a vector in the Y- (second-) direction of specified length
- static xScale(scale: float) TissueForge::types::TVector2< float >
Get a scaling vector in the X- (first-) direction
- static yScale(scale: float) TissueForge::types::TVector2< float >
Get a scaling vector in the Y- (second-) direction
- x(*args) float
Overload 1: Get the X (first) component
Overload 2: Get the X (first) component
- y(*args) float
Overload 1: Get the Y (second) component
Overload 2: Get the Y (second) component
- flipped() TissueForge::types::TVector2< float >
- dot(*args) float
- angle(other)
angle made with another vector
- __len__() int
- __iadd__(*args) TissueForge::types::TVector2< float > &
- __add__(*args) TissueForge::types::TVector2< float >
- __isub__(*args) TissueForge::types::TVector2< float > &
- __sub__(*args) TissueForge::types::TVector2< float >
- __imul__(*args) TissueForge::types::TVector2< float > &
- __mul__(*args) TissueForge::types::TVector2< float >
- __itruediv__(*args)
- __truediv__(*args)
- length()
length of vector
- normalized()
vector normalized
- resized(length)
resize be a length
- projected(other)
project onto another vector
- projectedOntoNormalized(other)
project onto a normalized vector
- distance(line_start_pt, line_end_pt)
distance from a line defined by two points
- __getitem__(index: int)
- __setitem__(index: int, val)
- as_list() list
convert to a python list
- __str__() str
Return str(self).
- class tissue_forge.iVector2(*args)
A 2D vector with
int
elements- static xAxis(*args, **kwargs) TissueForge::types::TVector2< int >
Get a vector in the X- (first-) direction of specified length
- static yAxis(*args, **kwargs) TissueForge::types::TVector2< int >
Get a vector in the Y- (second-) direction of specified length
- static xScale(scale: int) TissueForge::types::TVector2< int >
Get a scaling vector in the X- (first-) direction
- static yScale(scale: int) TissueForge::types::TVector2< int >
Get a scaling vector in the Y- (second-) direction
- x(*args) int
Overload 1: Get the X (first) component
Overload 2: Get the X (first) component
- y(*args) int
Overload 1: Get the Y (second) component
Overload 2: Get the Y (second) component
- flipped() TissueForge::types::TVector2< int >
- dot(*args) int
- __len__() int
- __iadd__(*args) TissueForge::types::TVector2< int > &
- __add__(*args) TissueForge::types::TVector2< int >
- __isub__(*args) TissueForge::types::TVector2< int > &
- __sub__(*args) TissueForge::types::TVector2< int >
- __imul__(*args) TissueForge::types::TVector2< int > &
- __mul__(*args) TissueForge::types::TVector2< int >
- __itruediv__(*args)
- __truediv__(*args)
- __getitem__(index: int)
- __setitem__(index: int, val)
- as_list() list
convert to a python list
- __str__() str
Return str(self).
- class tissue_forge.dVector3(*args)
A 3D vector with
double
elements- static xAxis(*args, **kwargs) TissueForge::types::TVector3< double >
- static yAxis(*args, **kwargs) TissueForge::types::TVector3< double >
- static zAxis(*args, **kwargs) TissueForge::types::TVector3< double >
- static xScale(scale: double) TissueForge::types::TVector3< double >
- static yScale(scale: double) TissueForge::types::TVector3< double >
- static zScale(scale: double) TissueForge::types::TVector3< double >
- x(*args) double
Overload 1: Get the X (first) component
Overload 2: Get the X (first) component
- y(*args) double
Overload 1: Get the Y (second) component
Overload 2: Get the Y (second) component
- z(*args) double
Overload 1: Get the Z (third) component
Overload 2: Get the Z (third) component
- r(*args) double
Overload 1: Get the red (first) component
Overload 2: Get the red (first) component
- g(*args) double
Overload 1: Get the green (second) component
Overload 2: Get the green (second) component
- b(*args) double
Overload 1: Get the blue (third) component
Overload 2: Get the blue (third) component
- xy()
- flipped() TissueForge::types::TVector3< double >
- dot(*args) double
- cross(other: dVector3) TissueForge::types::TVector3< double >
Get the cross product with another vector
- angle(other)
angle made with another vector
- __len__() int
- __iadd__(*args) TissueForge::types::TVector3< double > &
- __add__(*args) TissueForge::types::TVector3< double >
- __isub__(*args) TissueForge::types::TVector3< double > &
- __sub__(*args) TissueForge::types::TVector3< double >
- __imul__(*args) TissueForge::types::TVector3< double > &
- __mul__(*args) TissueForge::types::TVector3< double >
- __itruediv__(*args)
- __truediv__(*args)
- length()
length of vector
- normalized()
vector normalized
- resized(length)
resize be a length
- projected(other)
project onto another vector
- projectedOntoNormalized(other)
project onto a normalized vector
- distance(line_start_pt, line_end_pt)
distance from a line defined by two points
- __getitem__(index: int)
- __setitem__(index: int, val)
- as_list() list
convert to a python list
- __str__() str
Return str(self).
- class tissue_forge.fVector3(*args)
A 3D vector with
float
elements- static xAxis(*args, **kwargs) TissueForge::types::TVector3< float >
- static yAxis(*args, **kwargs) TissueForge::types::TVector3< float >
- static zAxis(*args, **kwargs) TissueForge::types::TVector3< float >
- static xScale(scale: float) TissueForge::types::TVector3< float >
- static yScale(scale: float) TissueForge::types::TVector3< float >
- static zScale(scale: float) TissueForge::types::TVector3< float >
- x(*args) float
Overload 1: Get the X (first) component
Overload 2: Get the X (first) component
- y(*args) float
Overload 1: Get the Y (second) component
Overload 2: Get the Y (second) component
- z(*args) float
Overload 1: Get the Z (third) component
Overload 2: Get the Z (third) component
- r(*args) float
Overload 1: Get the red (first) component
Overload 2: Get the red (first) component
- g(*args) float
Overload 1: Get the green (second) component
Overload 2: Get the green (second) component
- b(*args) float
Overload 1: Get the blue (third) component
Overload 2: Get the blue (third) component
- xy()
- flipped() TissueForge::types::TVector3< float >
- dot(*args) float
- cross(other: fVector3) TissueForge::types::TVector3< float >
Get the cross product with another vector
- angle(other)
angle made with another vector
- __len__() int
- __iadd__(*args) TissueForge::types::TVector3< float > &
- __add__(*args) TissueForge::types::TVector3< float >
- __isub__(*args) TissueForge::types::TVector3< float > &
- __sub__(*args) TissueForge::types::TVector3< float >
- __imul__(*args) TissueForge::types::TVector3< float > &
- __mul__(*args) TissueForge::types::TVector3< float >
- __itruediv__(*args)
- __truediv__(*args)
- length()
length of vector
- normalized()
vector normalized
- resized(length)
resize be a length
- projected(other)
project onto another vector
- projectedOntoNormalized(other)
project onto a normalized vector
- distance(line_start_pt, line_end_pt)
distance from a line defined by two points
- __getitem__(index: int)
- __setitem__(index: int, val)
- as_list() list
convert to a python list
- __str__() str
Return str(self).
- class tissue_forge.iVector3(*args)
A 3D vector with
int
elements- static xAxis(*args, **kwargs) TissueForge::types::TVector3< int >
- static yAxis(*args, **kwargs) TissueForge::types::TVector3< int >
- static zAxis(*args, **kwargs) TissueForge::types::TVector3< int >
- static xScale(scale: int) TissueForge::types::TVector3< int >
- static yScale(scale: int) TissueForge::types::TVector3< int >
- static zScale(scale: int) TissueForge::types::TVector3< int >
- x(*args) int
Overload 1: Get the X (first) component
Overload 2: Get the X (first) component
- y(*args) int
Overload 1: Get the Y (second) component
Overload 2: Get the Y (second) component
- z(*args) int
Overload 1: Get the Z (third) component
Overload 2: Get the Z (third) component
- r(*args) int
Overload 1: Get the red (first) component
Overload 2: Get the red (first) component
- g(*args) int
Overload 1: Get the green (second) component
Overload 2: Get the green (second) component
- b(*args) int
Overload 1: Get the blue (third) component
Overload 2: Get the blue (third) component
- xy(*args) TissueForge::types::TVector2< int > const
Overload 1: Get the x-y (first-second) components
Overload 2: Get the x-y (first-second) components
- flipped() TissueForge::types::TVector3< int >
- dot(*args) int
- cross(other: iVector3) TissueForge::types::TVector3< int >
Get the cross product with another vector
- __len__() int
- __iadd__(*args) TissueForge::types::TVector3< int > &
- __add__(*args) TissueForge::types::TVector3< int >
- __isub__(*args) TissueForge::types::TVector3< int > &
- __sub__(*args) TissueForge::types::TVector3< int >
- __imul__(*args) TissueForge::types::TVector3< int > &
- __mul__(*args) TissueForge::types::TVector3< int >
- __itruediv__(*args)
- __truediv__(*args)
- __getitem__(index: int)
- __setitem__(index: int, val)
- as_list() list
convert to a python list
- __str__() str
Return str(self).
- class tissue_forge.dVector4(*args)
A 4D vector with
double
elements- x(*args) double
Overload 1: Get the X (first) component
Overload 2: Get the X (first) component
- y(*args) double
Overload 1: Get the Y (second) component
Overload 2: Get the Y (second) component
- z(*args) double
Overload 1: Get the Z (third) component
Overload 2: Get the Z (third) component
- w(*args) double
Overload 1: Get the W (fourth) component
Overload 2: Get the W (fourth) component
- r(*args) double
Overload 1: Get the red (first) component
Overload 2: Get the red (first) component
- g(*args) double
Overload 1: Get the green (second) component
Overload 2: Get the green (second) component
- b(*args) double
Overload 1: Get the blue (third) component
Overload 2: Get the blue (third) component
- a(*args) double
Overload 1: Get the alpha (fourth) component
Overload 2: Get the alpha (fourth) component
- xyz()
- rgb(*args) TissueForge::types::TVector3< double > const
Overload 1: Get the red-green-blue (first-second-third) components
Overload 2: Get the red-green-blue (first-second-third) components
- xy(*args) TissueForge::types::TVector2< double > const
Overload 1: Get the x-y (first-second) components
Overload 2: Get the x-y (first-second) components
- flipped() TissueForge::types::TVector4< double >
- dot(*args) double
- angle(other)
angle made with another vector
- __len__() int
- __iadd__(*args) TissueForge::types::TVector4< double > &
- __add__(*args) TissueForge::types::TVector4< double >
- __isub__(*args) TissueForge::types::TVector4< double > &
- __sub__(*args) TissueForge::types::TVector4< double >
- __imul__(*args) TissueForge::types::TVector4< double > &
- __mul__(*args) TissueForge::types::TVector4< double >
- __itruediv__(*args)
- __truediv__(*args)
- length()
length of vector
- normalized()
vector normalized
- resized(length)
resize be a length
- projected(other)
project onto another vector
- projectedOntoNormalized(other)
project onto a normalized vector
- distance(point)
distance from a point
- distanceScaled(point)
scaled distance from a point
- classmethod planeEquation(*args)
get a plane equation
- __getitem__(index: int)
- __setitem__(index: int, val)
- as_list() list
convert to a python list
- __str__() str
Return str(self).
- class tissue_forge.fVector4(*args)
A 4D vector with
float
elements- x(*args) float
Overload 1: Get the X (first) component
Overload 2: Get the X (first) component
- y(*args) float
Overload 1: Get the Y (second) component
Overload 2: Get the Y (second) component
- z(*args) float
Overload 1: Get the Z (third) component
Overload 2: Get the Z (third) component
- w(*args) float
Overload 1: Get the W (fourth) component
Overload 2: Get the W (fourth) component
- r(*args) float
Overload 1: Get the red (first) component
Overload 2: Get the red (first) component
- g(*args) float
Overload 1: Get the green (second) component
Overload 2: Get the green (second) component
- b(*args) float
Overload 1: Get the blue (third) component
Overload 2: Get the blue (third) component
- a(*args) float
Overload 1: Get the alpha (fourth) component
Overload 2: Get the alpha (fourth) component
- xyz()
- rgb(*args) TissueForge::types::TVector3< float > const
Overload 1: Get the red-green-blue (first-second-third) components
Overload 2: Get the red-green-blue (first-second-third) components
- xy(*args) TissueForge::types::TVector2< float > const
Overload 1: Get the x-y (first-second) components
Overload 2: Get the x-y (first-second) components
- flipped() TissueForge::types::TVector4< float >
- dot(*args) float
- angle(other)
angle made with another vector
- __len__() int
- __iadd__(*args) TissueForge::types::TVector4< float > &
- __add__(*args) TissueForge::types::TVector4< float >
- __isub__(*args) TissueForge::types::TVector4< float > &
- __sub__(*args) TissueForge::types::TVector4< float >
- __imul__(*args) TissueForge::types::TVector4< float > &
- __mul__(*args) TissueForge::types::TVector4< float >
- __itruediv__(*args)
- __truediv__(*args)
- length()
length of vector
- normalized()
vector normalized
- resized(length)
resize be a length
- projected(other)
project onto another vector
- projectedOntoNormalized(other)
project onto a normalized vector
- distance(point)
distance from a point
- distanceScaled(point)
scaled distance from a point
- classmethod planeEquation(*args)
get a plane equation
- __getitem__(index: int)
- __setitem__(index: int, val)
- as_list() list
convert to a python list
- __str__() str
Return str(self).
- class tissue_forge.iVector4(*args)
A 4D vector with
int
elements- x(*args) int
Overload 1: Get the X (first) component
Overload 2: Get the X (first) component
- y(*args) int
Overload 1: Get the Y (second) component
Overload 2: Get the Y (second) component
- z(*args) int
Overload 1: Get the Z (third) component
Overload 2: Get the Z (third) component
- w(*args) int
Overload 1: Get the W (fourth) component
Overload 2: Get the W (fourth) component
- r(*args) int
Overload 1: Get the red (first) component
Overload 2: Get the red (first) component
- g(*args) int
Overload 1: Get the green (second) component
Overload 2: Get the green (second) component
- b(*args) int
Overload 1: Get the blue (third) component
Overload 2: Get the blue (third) component
- a(*args) int
Overload 1: Get the alpha (fourth) component
Overload 2: Get the alpha (fourth) component
- xyz(*args) TissueForge::types::TVector3< int > const
Overload 1: Get the x-y-z (first-second-third) components
Overload 2: Get the x-y-z (first-second-third) components
- rgb(*args) TissueForge::types::TVector3< int > const
Overload 1: Get the red-green-blue (first-second-third) components
Overload 2: Get the red-green-blue (first-second-third) components
- xy(*args) TissueForge::types::TVector2< int > const
Overload 1: Get the x-y (first-second) components
Overload 2: Get the x-y (first-second) components
- flipped() TissueForge::types::TVector4< int >
- dot(*args) int
- __len__() int
- __iadd__(*args) TissueForge::types::TVector4< int > &
- __add__(*args) TissueForge::types::TVector4< int >
- __isub__(*args) TissueForge::types::TVector4< int > &
- __sub__(*args) TissueForge::types::TVector4< int >
- __imul__(*args) TissueForge::types::TVector4< int > &
- __mul__(*args) TissueForge::types::TVector4< int >
- __itruediv__(*args)
- __truediv__(*args)
- __getitem__(index: int)
- __setitem__(index: int, val)
- as_list() list
convert to a python list
- __str__() str
Return str(self).
- class tissue_forge.dMatrix3(*args)
A 3x3 square matrix with
double
elements- static rotation(angle: double) TissueForge::types::TMatrix3< double >
Initialize a rotation matrix
- static shearingX(amount: double) TissueForge::types::TMatrix3< double >
Initialize a shearing matrix along the X (first) direction
- static shearingY(amount: double) TissueForge::types::TMatrix3< double >
Initialize a shearing matrix along the Y (second) direction
- isRigidTransformation() bool
Test whether the matrix is a rigid transformation
- invertedRigid() TissueForge::types::TMatrix3< double >
Get the inverted rigid transformation. Must be a rigid transformation.
- __neg__() TissueForge::types::TMatrix3< double >
- __imul__(number: double) TissueForge::types::TMatrix3< double > &
- __mul__(*args) TissueForge::types::TVector3< double >
- __itruediv__(*args)
- __truediv__(*args)
- flippedCols() TissueForge::types::TMatrix3< double >
- flippedRows() TissueForge::types::TMatrix3< double >
- row(row: std::size_t) TissueForge::types::TVector3< double >
- __mul__(*args) TissueForge::types::TVector3< double >
- transposed() TissueForge::types::TMatrix3< double >
- diagonal() TissueForge::types::TVector3< double >
- inverted() TissueForge::types::TMatrix3< double >
- invertedOrthogonal() TissueForge::types::TMatrix3< double >
- __len__() int
- __getitem__(index: int)
- __setitem__(index: int, val)
- as_lists() list
convert to a list of python lists
- __str__() str
Return str(self).
- class tissue_forge.fMatrix3(*args)
A 3x3 square matrix with
float
elements- static rotation(angle: float) TissueForge::types::TMatrix3< float >
Initialize a rotation matrix
- static shearingX(amount: float) TissueForge::types::TMatrix3< float >
Initialize a shearing matrix along the X (first) direction
- static shearingY(amount: float) TissueForge::types::TMatrix3< float >
Initialize a shearing matrix along the Y (second) direction
- isRigidTransformation() bool
Test whether the matrix is a rigid transformation
- invertedRigid() TissueForge::types::TMatrix3< float >
Get the inverted rigid transformation. Must be a rigid transformation.
- __neg__() TissueForge::types::TMatrix3< float >
- __imul__(number: float) TissueForge::types::TMatrix3< float > &
- __mul__(*args) TissueForge::types::TVector3< float >
- __itruediv__(*args)
- __truediv__(*args)
- flippedCols() TissueForge::types::TMatrix3< float >
- flippedRows() TissueForge::types::TMatrix3< float >
- row(row: std::size_t) TissueForge::types::TVector3< float >
- __mul__(*args) TissueForge::types::TVector3< float >
- transposed() TissueForge::types::TMatrix3< float >
- diagonal() TissueForge::types::TVector3< float >
- inverted() TissueForge::types::TMatrix3< float >
- invertedOrthogonal() TissueForge::types::TMatrix3< float >
- __len__() int
- __getitem__(index: int)
- __setitem__(index: int, val)
- as_lists() list
convert to a list of python lists
- __str__() str
Return str(self).
- class tissue_forge.dMatrix4(*args)
A 4x4 square matrix with
double
elements- static rotationX(angle: double) TissueForge::types::TMatrix4< double >
Initialize a rotation matrix about the X (first) axis
- static rotationY(angle: double) TissueForge::types::TMatrix4< double >
Initialize a rotation matrix about the Y (second) axis
- static rotationZ(angle: double) TissueForge::types::TMatrix4< double >
Initialize a rotation matrix about the Z (third) axis
- static reflection(normal: dVector3) TissueForge::types::TMatrix4< double >
Initialize a reflection matrix about a plane using the normalized plane normal
- static shearingXY(amountX: double, amountY: double) TissueForge::types::TMatrix4< double >
Initialize a shearing matrix about the X (first) and Y (second) axes
- static shearingXZ(amountX: double, amountZ: double) TissueForge::types::TMatrix4< double >
Initialize a shearing matrix about the X (first) and Z (third) axes
- static shearingYZ(amountY: double, amountZ: double) TissueForge::types::TMatrix4< double >
Initialize a shearing matrix about the Y (second) and Z (third) axes
- static orthographicProjection(size: dVector2, near: double, far: double) TissueForge::types::TMatrix4< double >
Initialize an orthographic projection matrix
- Parameters:
size (TissueForge::types::TVector2< double >) – size of the view
near (float) – distance to near clipping plane
far (float) – distance for far clipping plane
- static perspectiveProjection(*args) TissueForge::types::TMatrix4< double >
Overload 1:
Initialize an perspective projection matrix
- Parameters:
size (TissueForge::types::TVector2< double >) – size of the near clipping plane
near (float) – distance to near clipping plane
far (float) – distance for far clipping plane
Overload 2:
Initialize a perspective projection matrix
- Parameters:
fov (float) – horizontal angle of the field of view
aspectRatio (float) – horizontal:vertical field of view aspect ratio
near (float) – distance to near clipping plane
far (float) – distance for far clipping plane
Overload 3:
Initialize a perspective projection matrix
- Parameters:
bottomLeft (TissueForge::types::TVector2< double >) – bottom-left point of field of view
topRight (TissueForge::types::TVector2< double >) – top-right point of field of view
near (float) – distance to near clipping plane
far (float) – distance for far clipping plane
- static lookAt(eye: dVector3, target: dVector3, up: dVector3) TissueForge::types::TMatrix4< double >
Initialize a matrix oriented towards a point
- Parameters:
eye (TissueForge::types::TVector3< double >) – location of view
target (TissueForge::types::TVector3< double >) – location of target point
up (TissueForge::types::TVector3< double >) – upward-normal of view
- isRigidTransformation() bool
Test whether the matrix is a rigid transformation
- rotationScaling() TissueForge::types::TMatrix3< double >
Get the rotation and scaling matrix
- rotationShear() TissueForge::types::TMatrix3< double >
Get the rotation and shear matrix
- rotation(*args) TissueForge::types::TMatrix3< double >
Overload 1: Initialize a rotation matrix from a rotation angle and normalized axis of rotation
Overload 2: Get the rotation matrix
- rotationNormalized() TissueForge::types::TMatrix3< double >
Get the normalized rotation matrix
- scalingSquared() TissueForge::types::TVector3< double >
Get the squared scaling vector
- scaling(*args) TissueForge::types::TVector3< double >
Overload 1: Initialize a scaling matrix from a scaling vector
Overload 2: Get the scaling vector
- uniformScalingSquared() double
Get the uniform squared scaling vector
- uniformScaling() double
Get the uniform scaling vector
- normalMatrix() TissueForge::types::TMatrix3< double >
Get the normal matrix
- right(*args) TissueForge::types::TVector3< double >
Overload 1: Get the rightward-pointing vector
Overload 2: Get the rightward-pointing vector
- up(*args) TissueForge::types::TVector3< double >
Overload 1: Get the upward-pointing vector
Overload 2: Get the upward-pointing vector
- backward(*args) TissueForge::types::TVector3< double >
Overload 1: Get the backward-pointing vector
Overload 2: Get the backward-pointing vector
- translation(*args) TissueForge::types::TVector3< double >
Overload 1: Initialize a translation matrix from a translation vector
Overload 2: Get the translation vector
Overload 3: Get the translation vector
- invertedRigid() TissueForge::types::TMatrix4< double >
Get the inverted rigid transformation matrix. Must be a rigid transformation matrix.
- __neg__() TissueForge::types::TMatrix4< double >
- __imul__(number: double) TissueForge::types::TMatrix4< double > &
- __itruediv__(*args)
- __truediv__(*args)
- flippedCols() TissueForge::types::TMatrix4< double >
- flippedRows() TissueForge::types::TMatrix4< double >
- row(row: std::size_t) TissueForge::types::TVector4< double >
- __mul__(*args) TissueForge::types::TVector4< double >
- transposed() TissueForge::types::TMatrix4< double >
- diagonal() TissueForge::types::TVector4< double >
- inverted() TissueForge::types::TMatrix4< double >
- invertedOrthogonal() TissueForge::types::TMatrix4< double >
- __len__() int
- __getitem__(index: int)
- __setitem__(index: int, val)
- as_lists() list
convert to a list of python lists
- __str__() str
Return str(self).
- class tissue_forge.fMatrix4(*args)
A 4x4 square matrix with
float
elements- static rotationX(angle: float) TissueForge::types::TMatrix4< float >
Initialize a rotation matrix about the X (first) axis
- static rotationY(angle: float) TissueForge::types::TMatrix4< float >
Initialize a rotation matrix about the Y (second) axis
- static rotationZ(angle: float) TissueForge::types::TMatrix4< float >
Initialize a rotation matrix about the Z (third) axis
- static reflection(normal: fVector3) TissueForge::types::TMatrix4< float >
Initialize a reflection matrix about a plane using the normalized plane normal
- static shearingXY(amountX: float, amountY: float) TissueForge::types::TMatrix4< float >
Initialize a shearing matrix about the X (first) and Y (second) axes
- static shearingXZ(amountX: float, amountZ: float) TissueForge::types::TMatrix4< float >
Initialize a shearing matrix about the X (first) and Z (third) axes
- static shearingYZ(amountY: float, amountZ: float) TissueForge::types::TMatrix4< float >
Initialize a shearing matrix about the Y (second) and Z (third) axes
- static orthographicProjection(size: fVector2, near: float, far: float) TissueForge::types::TMatrix4< float >
Initialize an orthographic projection matrix
- Parameters:
size (TissueForge::types::TVector2< float >) – size of the view
near (float) – distance to near clipping plane
far (float) – distance for far clipping plane
- static perspectiveProjection(*args) TissueForge::types::TMatrix4< float >
Overload 1:
Initialize an perspective projection matrix
- Parameters:
size (TissueForge::types::TVector2< float >) – size of the near clipping plane
near (float) – distance to near clipping plane
far (float) – distance for far clipping plane
Overload 2:
Initialize a perspective projection matrix
- Parameters:
fov (float) – horizontal angle of the field of view
aspectRatio (float) – horizontal:vertical field of view aspect ratio
near (float) – distance to near clipping plane
far (float) – distance for far clipping plane
Overload 3:
Initialize a perspective projection matrix
- Parameters:
bottomLeft (TissueForge::types::TVector2< float >) – bottom-left point of field of view
topRight (TissueForge::types::TVector2< float >) – top-right point of field of view
near (float) – distance to near clipping plane
far (float) – distance for far clipping plane
- static lookAt(eye: fVector3, target: fVector3, up: fVector3) TissueForge::types::TMatrix4< float >
Initialize a matrix oriented towards a point
- Parameters:
eye (TissueForge::types::TVector3< float >) – location of view
target (TissueForge::types::TVector3< float >) – location of target point
up (TissueForge::types::TVector3< float >) – upward-normal of view
- isRigidTransformation() bool
Test whether the matrix is a rigid transformation
- rotationScaling() TissueForge::types::TMatrix3< float >
Get the rotation and scaling matrix
- rotationShear() TissueForge::types::TMatrix3< float >
Get the rotation and shear matrix
- rotation(*args) TissueForge::types::TMatrix3< float >
Overload 1: Initialize a rotation matrix from a rotation angle and normalized axis of rotation
Overload 2: Get the rotation matrix
- rotationNormalized() TissueForge::types::TMatrix3< float >
Get the normalized rotation matrix
- scalingSquared() TissueForge::types::TVector3< float >
Get the squared scaling vector
- scaling(*args) TissueForge::types::TVector3< float >
Overload 1: Initialize a scaling matrix from a scaling vector
Overload 2: Get the scaling vector
- uniformScalingSquared() float
Get the uniform squared scaling vector
- uniformScaling() float
Get the uniform scaling vector
- normalMatrix() TissueForge::types::TMatrix3< float >
Get the normal matrix
- right(*args) TissueForge::types::TVector3< float >
Overload 1: Get the rightward-pointing vector
Overload 2: Get the rightward-pointing vector
- up(*args) TissueForge::types::TVector3< float >
Overload 1: Get the upward-pointing vector
Overload 2: Get the upward-pointing vector
- backward(*args) TissueForge::types::TVector3< float >
Overload 1: Get the backward-pointing vector
Overload 2: Get the backward-pointing vector
- translation(*args) TissueForge::types::TVector3< float >
Overload 1: Initialize a translation matrix from a translation vector
Overload 2: Get the translation vector
Overload 3: Get the translation vector
- invertedRigid() TissueForge::types::TMatrix4< float >
Get the inverted rigid transformation matrix. Must be a rigid transformation matrix.
- __neg__() TissueForge::types::TMatrix4< float >
- __imul__(number: float) TissueForge::types::TMatrix4< float > &
- __itruediv__(*args)
- __truediv__(*args)
- flippedCols() TissueForge::types::TMatrix4< float >
- flippedRows() TissueForge::types::TMatrix4< float >
- row(row: std::size_t) TissueForge::types::TVector4< float >
- __mul__(*args) TissueForge::types::TVector4< float >
- transposed() TissueForge::types::TMatrix4< float >
- diagonal() TissueForge::types::TVector4< float >
- inverted() TissueForge::types::TMatrix4< float >
- invertedOrthogonal() TissueForge::types::TMatrix4< float >
- __len__() int
- __getitem__(index: int)
- __setitem__(index: int, val)
- as_lists() list
convert to a list of python lists
- __str__() str
Return str(self).
- class tissue_forge.dQuaternion(*args)
A quaternion with
double
elements- static rotation(angle: double, normalizedAxis: dVector3) TissueForge::types::TQuaternion< double >
Initialize from a rotation angle and normalized axis of rotation
- static fromMatrix(matrix: dMatrix3) TissueForge::types::TQuaternion< double >
Initialize from an orthogonal rotation matrix
- data(*args) double const *
Overload 1: Get the underlying array
Overload 2: Get the underlying array
- __eq__(other: dQuaternion) bool
Return self==value.
- __ne__(other: dQuaternion) bool
Return self!=value.
- isNormalized() bool
Test whether the quaternion is normalized
- vector() TissueForge::types::TVector3< double > const
Get the 3-component vector
- scalar() double
Get the scalar
- angle(*args) double
Overload 1: Get the angle. Quaternion should be normalized.
Overload 2: Get the angle
- axis() TissueForge::types::TVector3< double >
Get the rotation axis. Quaternion should be normalized.
- toMatrix() TissueForge::types::TMatrix3< double >
Get the rotation matrix
- toEuler() TissueForge::types::TVector3< double >
Get the Euler angles
- __neg__() TissueForge::types::TQuaternion< double >
- __iadd__(other: dQuaternion) TissueForge::types::TQuaternion< double > &
- __add__(other: dQuaternion) TissueForge::types::TQuaternion< double >
- __isub__(other: dQuaternion) TissueForge::types::TQuaternion< double > &
- __sub__(other: dQuaternion) TissueForge::types::TQuaternion< double >
- __imul__(scalar: double) TissueForge::types::TQuaternion< double > &
- __itruediv__(*args)
- __truediv__(*args)
- __mul__(*args) TissueForge::types::TQuaternion< double >
- dot() double
Get the squared length
- length() double
Get the length
- normalized() TissueForge::types::TQuaternion< double >
Get the normalized quaternion
- conjugated() TissueForge::types::TQuaternion< double >
Get the conjugated quaternion
- inverted() TissueForge::types::TQuaternion< double >
Get the inverted quaternion
- invertedNormalized() TissueForge::types::TQuaternion< double >
Get the inverted and normalized quaternion
- transformVectorNormalized(vector: dVector3) TissueForge::types::TVector3< double >
Transform a normalized vector
- __getitem__(index: int)
- __setitem__(index: int, val)
- as_list() list
convert to a python list
- __str__() str
Return str(self).
- class tissue_forge.fQuaternion(*args)
A quaternion with
float
elements- static rotation(angle: float, normalizedAxis: fVector3) TissueForge::types::TQuaternion< float >
Initialize from a rotation angle and normalized axis of rotation
- static fromMatrix(matrix: fMatrix3) TissueForge::types::TQuaternion< float >
Initialize from an orthogonal rotation matrix
- data(*args) float const *
Overload 1: Get the underlying array
Overload 2: Get the underlying array
- __eq__(other: fQuaternion) bool
Return self==value.
- __ne__(other: fQuaternion) bool
Return self!=value.
- isNormalized() bool
Test whether the quaternion is normalized
- vector() TissueForge::types::TVector3< float > const
Get the 3-component vector
- scalar() float
Get the scalar
- angle(*args) float
Overload 1: Get the angle. Quaternion should be normalized.
Overload 2: Get the angle
- axis() TissueForge::types::TVector3< float >
Get the rotation axis. Quaternion should be normalized.
- toMatrix() TissueForge::types::TMatrix3< float >
Get the rotation matrix
- toEuler() TissueForge::types::TVector3< float >
Get the Euler angles
- __neg__() TissueForge::types::TQuaternion< float >
- __iadd__(other: fQuaternion) TissueForge::types::TQuaternion< float > &
- __add__(other: fQuaternion) TissueForge::types::TQuaternion< float >
- __isub__(other: fQuaternion) TissueForge::types::TQuaternion< float > &
- __sub__(other: fQuaternion) TissueForge::types::TQuaternion< float >
- __imul__(scalar: float) TissueForge::types::TQuaternion< float > &
- __itruediv__(*args)
- __truediv__(*args)
- __mul__(*args) TissueForge::types::TQuaternion< float >
- dot() float
Get the squared length
- length() float
Get the length
- normalized() TissueForge::types::TQuaternion< float >
Get the normalized quaternion
- conjugated() TissueForge::types::TQuaternion< float >
Get the conjugated quaternion
- inverted() TissueForge::types::TQuaternion< float >
Get the inverted quaternion
- invertedNormalized() TissueForge::types::TQuaternion< float >
Get the inverted and normalized quaternion
- transformVectorNormalized(vector: fVector3) TissueForge::types::TVector3< float >
Transform a normalized vector
- __getitem__(index: int)
- __setitem__(index: int, val)
- as_list() list
convert to a python list
- __str__() str
Return str(self).
- tissue_forge.FQuaternion
alias of
fQuaternion
File I/O
- tissue_forge.io.fromFile3DF(filePath: std::string const &) TissueForge::io::ThreeDFStructure *
Tissue Forge import/export interface
Load a 3D format file
- Parameters:
filePath (string) – path of file
- Return type:
- Returns:
ThreeDFStructure* 3D format data container
- tissue_forge.io.toFile3DF(format: std::string const &, filePath: std::string const &, pRefinements: unsigned int const & = 0) HRESULT
Export engine state to a 3D format file
- Parameters:
format (string) – format of file
filePath (string) – path of file
pRefinements (int) – mesh refinements applied when generating meshes
- Return type:
int
- Returns:
HRESULT
- tissue_forge.io.toFile(saveFilePath: std::string const &) HRESULT
Save a simulation to file
- Parameters:
saveFilePath (string) – absolute path to file
- Return type:
int
- Returns:
HRESULT
- tissue_forge.io.toString() std::string
Return a simulation state as a JSON string
- Return type:
string
- Returns:
std::string
- tissue_forge.io.mapImportParticleId(pId: unsigned int const &) int
Get the id of a particle according to import data that corresponds to a particle id of current data.
Only valid between initialization and the first simulation step, after which the import summary data is purged.
- Parameters:
pId (int) – id of particle in exported data
- Return type:
int
- Returns:
int >=0 if particle is found; -1 otherwise
- tissue_forge.io.mapImportParticleTypeId(pId: unsigned int const &) int
Get the id of a particle type according to import data that corresponds to a particle type id of current data.
Only valid between initialization and the first simulation step, after which the import summary data is purged.
- Parameters:
pId (int) – id of particle type in exported data
- Return type:
int
- Returns:
int >=0 if particle type is found; -1 otherwise
- class tissue_forge.io.ThreeDFStructure
-
- property vertices: vectorThreeDFVertexData_p
Constituent vertices
- property edges: vectorThreeDFEdgeData_p
Constituent edges
- property faces: vectorThreeDFFaceData_p
Constituent faces
- property meshes: vectorThreeDFMeshData_p
Constituent meshes
- property num_vertices: int
Number of constituent vertices
- property num_edges: int
Number of constituent edges
- property num_faces: int
Number of constituent faces
- property num_meshes: int
Number of constituent meshes
- property vRadiusDef
Default radius applied to vertices when generating meshes from point clouds
- fromFile(filePath: std::string const &) HRESULT
Load from file
- Parameters:
filePath (string) – file absolute path
- Return type:
int
- Returns:
HRESULT
- toFile(format: std::string const &, filePath: std::string const &) HRESULT
Write to file
- Parameters:
format (string) – output format of file
filePath (string) – file absolute path
- Return type:
int
- Returns:
HRESULT
- flush() HRESULT
Flush stucture. All scheduled processes are executed.
- extend(s: _io_ThreeDFStructure) HRESULT
Extend a structure
- Parameters:
s (
ThreeDFStructure
) – stucture to extend with
- clear() HRESULT
Clear all data of the structure
- Return type:
int
- Returns:
HRESULT
- has(*args) bool
Overload 1:
Test whether a vertex is a constituent
- Parameters:
v (
ThreeDFVertexData
) – vertex to test- Return type:
boolean
- Returns:
true
- Return type:
boolean
- Returns:
false
Overload 2:
Test whether an edge is a constituent
- Parameters:
e (
ThreeDFEdgeData
) – edge to test- Return type:
boolean
- Returns:
true
- Return type:
boolean
- Returns:
false
Overload 3:
Test whether a face is a constituent
- Parameters:
f (
ThreeDFFaceData
) – face to test- Return type:
boolean
- Returns:
true
- Return type:
boolean
- Returns:
false
Overload 4:
Test whether a mesh is a constituent
- Parameters:
m (
ThreeDFMeshData
) – mesh to test- Return type:
boolean
- Returns:
true
- Return type:
boolean
- Returns:
false
- add(*args) void
Overload 1:
Add a vertex
- Parameters:
v (
ThreeDFVertexData
) – vertex to add
Overload 2:
Add an edge and all constituent data
- Parameters:
e (
ThreeDFEdgeData
) – edge to add
Overload 3:
Add a face and all constituent data
- Parameters:
f (
ThreeDFFaceData
) – face to add
Overload 4:
Add a mesh and all constituent data
- Parameters:
m (
ThreeDFMeshData
) – mesh to add
- remove(*args) void
Overload 1:
Remove a vertex
- Parameters:
v (
ThreeDFVertexData
) – vertex to remove
Overload 2:
Remove a edge and all constituent data
- Parameters:
e (
ThreeDFEdgeData
) – edge to remove
Overload 3:
Remove a face and all constituent data
- Parameters:
f (
ThreeDFFaceData
) – face to remove
Overload 4:
Remove a mesh and all constituent data
- Parameters:
m (
ThreeDFMeshData
) – mesh to remove
- translate(displacement: fVector3) HRESULT
Translate the structure by a displacement
- Parameters:
displacement (
FVector3
) –- Return type:
int
- Returns:
HRESULT
- translateTo(position: fVector3) HRESULT
Translate the structure to a position
- Parameters:
position (
FVector3
) –- Return type:
int
- Returns:
HRESULT
- rotateAt(rotMat: fMatrix3, rotPt: fVector3) HRESULT
Rotate the structure about a point
- Parameters:
rotMat (
FMatrix3
) –rotPt (
FVector3
) –
- Return type:
int
- Returns:
HRESULT
- rotate(rotMat: fMatrix3) HRESULT
Rotate the structure about its centroid
- Parameters:
rotMat (
FMatrix3
) –- Return type:
int
- Returns:
HRESULT
- scaleFrom(*args) HRESULT
Overload 1:
Scale the structure about a point
- Parameters:
scales (
FVector3
) –scalePt (
FVector3
) –
- Return type:
int
- Returns:
HRESULT
Overload 2:
Scale the structure uniformly about a point
- Parameters:
scale (float) –
scalePt (
FVector3
) –
- Return type:
int
- Returns:
HRESULT
- scale(*args) HRESULT
Overload 1:
Scale the structure about its centroid
- Parameters:
scales (
FVector3
) –- Return type:
int
- Returns:
HRESULT
Overload 2:
Scale the structure uniformly about its centroid
- Parameters:
scale (float) –
- Return type:
int
- Returns:
HRESULT
- class tissue_forge.io.ThreeDFMeshData
- property structure
Parent structure
- property id
ID, if any. Unique to its structure and type
- property name
Mesh name
- property renderData
Rendering data
- property vertices: vectorThreeDFVertexData_p
Constituent vertices
- property edges: vectorThreeDFEdgeData_p
Constituent edges
- property faces: vectorThreeDFFaceData_p
Constituent faces
- property num_vertices: int
Number of constituent vertices
- property num_edges: int
Number of constituent edges
- property num_faces: int
Number of constituent faces
- has(*args) bool
Overload 1:
Test whether a vertex is a constituent
- Parameters:
v (
ThreeDFVertexData
) – vertex to test- Return type:
boolean
- Returns:
true
- Return type:
boolean
- Returns:
false
Overload 2:
Test whether an edge is a constituent
- Parameters:
e (
ThreeDFEdgeData
) – edge to test- Return type:
boolean
- Returns:
true
- Return type:
boolean
- Returns:
false
Overload 3:
Test whether a face is a constituent
- Parameters:
f (
ThreeDFFaceData
) – face to test- Return type:
boolean
- Returns:
true
- Return type:
boolean
- Returns:
false
- _in(s: _io_ThreeDFStructure) bool
Test whether in a structure
- Parameters:
s (
ThreeDFStructure
) – structure to test- Return type:
boolean
- Returns:
true
- Return type:
boolean
- Returns:
false
- is_in(*args, **kwargs) bool
Alias of :meth:_in
- translate(displacement: fVector3) HRESULT
Translate the mesh by a displacement
- Parameters:
displacement (
FVector3
) –- Return type:
int
- Returns:
HRESULT
- translateTo(position: fVector3) HRESULT
Translate the mesh to a position
- Parameters:
position (
FVector3
) –- Return type:
int
- Returns:
HRESULT
- rotateAt(rotMat: fMatrix3, rotPt: fVector3) HRESULT
Rotate the mesh about a point
- Parameters:
rotMat (
FMatrix3
) –rotPt (
FVector3
) –
- Return type:
int
- Returns:
HRESULT
- rotate(rotMat: fMatrix3) HRESULT
Rotate the mesh about its centroid
- Parameters:
rotMat (
FMatrix3
) –- Return type:
int
- Returns:
HRESULT
- scaleFrom(*args) HRESULT
Overload 1:
Scale the mesh about a point
- Parameters:
scales (
FVector3
) –scalePt (
FVector3
) –
- Return type:
int
- Returns:
HRESULT
Overload 2:
Scale the mesh uniformly about a point
- Parameters:
scale (float) –
scalePt (
FVector3
) –
- Return type:
int
- Returns:
HRESULT
- scale(*args) HRESULT
Overload 1:
Scale the mesh about its centroid
- Parameters:
scales (
FVector3
) –- Return type:
int
- Returns:
HRESULT
Overload 2:
Scale the mesh uniformly about its centroid
- Parameters:
scale (float) –
- Return type:
int
- Returns:
HRESULT
- class tissue_forge.io.ThreeDFFaceData
- property structure
Parent structure
- property normal
Face normal
- property id
ID, if any. Unique to its structure and type
- property vertices: vectorThreeDFVertexData_p
Constituent vertices
- property edges: vectorThreeDFEdgeData_p
Constituent edges
- property meshes: vectorThreeDFMeshData_p
Parent meshes
- property num_vertices: int
Number of constituent vertices
- property num_edges: int
Number of constituent edges
- property num_meshes: int
Number of parent meshes
- has(*args) bool
Overload 1:
Test whether a vertex is a constituent
- Parameters:
v (
ThreeDFVertexData
) – vertex to test- Return type:
boolean
- Returns:
true
- Return type:
boolean
- Returns:
false
Overload 2:
Test whether an edge is a constituent
- Parameters:
e (
ThreeDFEdgeData
) – edge to test- Return type:
boolean
- Returns:
true
- Return type:
boolean
- Returns:
false
- _in(*args) bool
Overload 1:
Test whether in a mesh
- Parameters:
m (
ThreeDFMeshData
) – mesh to test- Return type:
boolean
- Returns:
true
- Return type:
boolean
- Returns:
false
Overload 2:
Test whether in a structure
- Parameters:
s (
ThreeDFStructure
) – structure to test- Return type:
boolean
- Returns:
true
- Return type:
boolean
- Returns:
false
- is_in(*args, **kwargs) bool
Alias of :meth:_in
- class tissue_forge.io.ThreeDFEdgeData(_va: _io_ThreeDFVertexData, _vb: _io_ThreeDFVertexData)
- property structure
Parent structure
- property id
ID, if any. Unique to its structure and type
- property vertices: vectorThreeDFVertexData_p
Constituent vertices
- property faces: vectorThreeDFFaceData_p
Constituent faces
- property meshes: vectorThreeDFMeshData_p
Parent meshes
- property num_vertices: int
Number of constituent vertices
- property num_faces: int
Number of parent faces
- property num_meshes: int
Number of parent meshes
- has(v: _io_ThreeDFVertexData) bool
Test whether a vertex is a constituent
- Parameters:
v (
ThreeDFVertexData
) – vertex to test- Return type:
boolean
- Returns:
true
- Return type:
boolean
- Returns:
false
- _in(*args) bool
Overload 1:
Test whether in a face
- Parameters:
f (
ThreeDFFaceData
) – face to test- Return type:
boolean
- Returns:
true
- Return type:
boolean
- Returns:
false
Overload 2:
Test whether in a mesh
- Parameters:
m (
ThreeDFMeshData
) – mesh to test- Return type:
boolean
- Returns:
true
- Return type:
boolean
- Returns:
false
Overload 3:
Test whether in a structure
- Parameters:
s (
ThreeDFStructure
) – structure to test- Return type:
boolean
- Returns:
true
- Return type:
boolean
- Returns:
false
- is_in(*args, **kwargs) bool
Alias of :meth:_in
- class tissue_forge.io.ThreeDFVertexData(_position: fVector3, _structure: _io_ThreeDFStructure | None = None)
- property structure
Parent structure
- property position
Global position
- property id
ID, if any. Unique to its structure and type
- property edges: vectorThreeDFEdgeData_p
Parent edges
- property faces: vectorThreeDFFaceData_p
Parent faces
- property meshes: vectorThreeDFMeshData_p
Parent meshes
- property num_edges: int
Number of parent edges
- property num_faces: int
Number of parent faces
- property num_meshes: int
Number of parent meshes
- _in(*args) bool
Overload 1:
Test whether in an edge
- Parameters:
e (
ThreeDFEdgeData
) – edge to test- Return type:
boolean
- Returns:
true
- Return type:
boolean
- Returns:
false
Overload 2:
Test whether in a face
- Parameters:
f (
ThreeDFFaceData
) – face to test- Return type:
boolean
- Returns:
true
- Return type:
boolean
- Returns:
false
Overload 3:
Test whether in a mesh
- Parameters:
m (
ThreeDFMeshData
) – mesh to test- Return type:
boolean
- Returns:
true
- Return type:
boolean
- Returns:
false
Overload 4:
Test whether in a structure
- Parameters:
s (
ThreeDFStructure
) – structure to test- Return type:
boolean
- Returns:
true
- Return type:
boolean
- Returns:
false
- is_in(*args, **kwargs) bool
Alias of :meth:_in
GPU-Accelerated Modules
Note
This section of the Tissue Forge API is only available in CUDA-supported installations.