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 and PointsType.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:

FVector3

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 and PointsType.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 cube

  • corner2 (list of float or FVector3) – second corner of cube

  • num_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.

Parameters:
  • corner1 (list of float or FVector3) – first corner of cube

  • corner2 (list of float or FVector3) – second corner of cube

  • num_particles – number of particles

Returns:

coordinates of random points

Return type:

list of FVector3

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:

FVector3

Returns:

FVector3

tissue_forge.random_unit_vector() TissueForge::FVector3

Generates a randomly oriented unit vector.

Return type:

FVector3

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