File I/O

tissue_forge.io.fromFile3DF(filePath)

Tissue Forge import/export interface

Load a 3D format file

Parameters:

filePath (string) – path of file

Return type:

ThreeDFStructure

Returns:

ThreeDFStructure* 3D format data container

tissue_forge.io.toFile3DF(format, filePath, pRefinements=0)

Export engine state to a 3D format file

Parameters:
  • format (string) – format of file

  • filePath (string) – path of file

  • pRefinements (int, optional) – mesh refinements applied when generating meshes

Return type:

int

Returns:

HRESULT

tissue_forge.io.toFile(saveFilePath)

Save a simulation to file

Parameters:

saveFilePath (string) – absolute path to file

Return type:

int

Returns:

HRESULT

tissue_forge.io.toString()

Return a simulation state as a JSON string

Return type:

string

Returns:

std::string

tissue_forge.io.mapImportParticleId(pId)

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)

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.ThreeDFRenderData
property color
class tissue_forge.io.ThreeDFStructure
property centroid: fVector3

Centroid of all constituent data

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)

Load from file

Parameters:

filePath (string) – file absolute path

Return type:

int

Returns:

HRESULT

toFile(format, filePath)

Write to file

Parameters:
  • format (string) – output format of file

  • filePath (string) – file absolute path

Return type:

int

Returns:

HRESULT

flush()

Flush stucture. All scheduled processes are executed.

extend(s)

Extend a structure

Parameters:

s (ThreeDFStructure) – stucture to extend with

clear()

Clear all data of the structure

Return type:

int

Returns:

HRESULT

has(*args)

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)

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)

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)

Translate the structure by a displacement

Parameters:

displacement (FVector3)

Return type:

int

Returns:

HRESULT

translateTo(position)

Translate the structure to a position

Parameters:

position (FVector3)

Return type:

int

Returns:

HRESULT

rotateAt(rotMat, rotPt)

Rotate the structure about a point

Parameters:
  • rotMat (FMatrix3)

  • rotPt (FVector3)

Return type:

int

Returns:

HRESULT

rotate(rotMat)

Rotate the structure about its centroid

Parameters:

rotMat (FMatrix3)

Return type:

int

Returns:

HRESULT

scaleFrom(*args)

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)

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

property centroid: fVector3

Centroid of all constituent data

has(*args)

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)

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)

Translate the mesh by a displacement

Parameters:

displacement (FVector3)

Return type:

int

Returns:

HRESULT

translateTo(position)

Translate the mesh to a position

Parameters:

position (FVector3)

Return type:

int

Returns:

HRESULT

rotateAt(rotMat, rotPt)

Rotate the mesh about a point

Parameters:
  • rotMat (FMatrix3)

  • rotPt (FVector3)

Return type:

int

Returns:

HRESULT

rotate(rotMat)

Rotate the mesh about its centroid

Parameters:

rotMat (FMatrix3)

Return type:

int

Returns:

HRESULT

scaleFrom(*args)

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)

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)

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)

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, _vb)
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)

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)

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, _structure=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)

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