Vertex
- class tissue_forge.models.vertex.solver.Vertex
The mesh vertex is a volume of a mesh centered at a point in a space.
- property id: int
- property bodies
bodies defined by the vertex
- property surfaces
surfaces defined by the vertex
- property pid: int
id of underlying particle
- property connected_vertices
connected vertices
- property area: float
area of the vertex
- property volume: float
volume of the vertex
- property mass: float
mass of the vertex
- property position
position of the vertex
- property velocity
velocity of the vertex
- static create(*args)
Overload 1:
Create a vertex
- Parameters:
_pid (int) – id of underlying particle
Overload 2:
Create a vertex
- Parameters:
position (
FVector3) – position of vertex
Overload 3:
Create a vertex
- Parameters:
vdata (
ThreeDFVertexData) – a vertex
Overload 4:
Create vertices
- Parameters:
_pids (std::vector< unsigned int,std::allocator< unsigned int > >) – ids of underlying particles
Overload 5:
Create vertices
- Parameters:
positions (std::vector< TissueForge::FVector3,std::allocator< TissueForge::FVector3 > >) – positions of vertices
Overload 6:
Create vertices
- Parameters:
vdata (std::vector< TissueForge::io::ThreeDFVertexData *,std::allocator< TissueForge::io::ThreeDFVertexData * > >) – vertices
- static destroy(*args)
Destroy instances
- Parameters:
toDestroy (std::vector< TissueForge::models::vertex::Vertex *,std::allocator< TissueForge::models::vertex::Vertex * > >) – instances to destroy
- validate()
- position_changed()
- defines(*args)
- toString()
Get a JSON string representation
- insert(*args)
Overload 1:
Insert a surface at a location in the list of surfaces
- Parameters:
s (
Surface) – surface to insertidx (int) – location in the list of surfaces
Overload 2:
Insert a surface before another surface
Overload 3:
Inserts a vertex between two vertices
Overload 4:
Insert a vertex between a vertex and each of a set of vertices
- classmethod insert_c(pos, v1, v2=None, verts=None)
Create a vertex and inserts it between a vertices and either another vertex or a set of vertices.
- Parameters:
pos – position of new vertex
v1 – first vertex or its handle
v2 – second vertex of its handle
verts – set of vertices
- Returns:
handle to newly created vertex, if any
- replace(*args)
Overload 1:
Replace a surface at a location in the list of surfaces
- Parameters:
toInsert (
Surface) – a surfaceidx (int) – a location in the list of surfaces
Overload 2:
Replace a surface with another surface
Overload 3:
Replace a surface
- Parameters:
toReplace (
Surface) – surface to replace
Overload 4:
Replace a body
- Parameters:
toReplace (
Body) – a body
- classmethod replace_c(pos, surface=None, body=None)
Create a vertex and replace either a surface or body with it
- Parameters:
pos – position of new vertex
surface – surface to replace or its handle
body – body to replace or its handle
- Returns:
handle to newly created vertex, if any
- find_surface(dir)
Find a surface defined by this vertex
- Parameters:
dir (
FVector3) – direction to look with respect to the vertex
- find_body(dir)
Find a body defined by this vertex
- Parameters:
dir (
FVector3) – direction to look with respect to the vertex
- update_connected_vertices()
Update internal connected vertex data
Get the surfaces that this vertex and another vertex both define
- Parameters:
other (
Vertex) – another vertex
- update_properties()
Update the properties of the underlying particle
- particle()
Get a handle to the underlying particle, if any
- set_position(pos, updateChildren=1)
Set the current position
- Parameters:
pos (
FVector3) – positionupdateChildren (boolean, optional) – flag indicating whether to update dependent objects
- static transfer_bonds_to(*args)
Overload 1:
Transfer all bonds to another vertex
- Parameters:
other (
Vertex) – another vertex
Overload 2:
Transfer all bonds to other vertices
- Parameters:
targets (std::vector< std::pair< TissueForge::models::vertex::Vertex *,TissueForge::models::vertex::Vertex * >,std::allocator< std::pair< TissueForge::models::vertex::Vertex *,TissueForge::models::vertex::Vertex * > > >) – target vertices; first element is source, second element is target
- replace(*args)
Overload 1:
Replace a surface at a location in the list of surfaces
- Parameters:
toInsert (
Surface) – a surfaceidx (int) – a location in the list of surfaces
Overload 2:
Replace a surface with another surface
Overload 3:
Replace a surface
- Parameters:
toReplace (
Surface) – surface to replace
Overload 4:
Replace a body
- Parameters:
toReplace (
Body) – a body
- static merge(*args)
Overload 1:
Merge with a vertex.
The passed vertex is destroyed.
- Parameters:
toRemove (
Vertex) – vertex to removelenCf (float, optional) – distance coefficient in [0, 1] for where to place the vertex, from the kept vertex to the removed vertex
Overload 2:
Merge sets of vertices.
The first instance of each list absorbs the remaining vertices.
- Parameters:
toMerge (std::vector< std::vector< TissueForge::models::vertex::Vertex *,std::allocator< TissueForge::models::vertex::Vertex * > >,std::allocator< std::vector< TissueForge::models::vertex::Vertex *,std::allocator< TissueForge::models::vertex::Vertex * > > > >) – sets of vertices to merge
lenCf (float, optional) – distance coefficient in [0, 1] for where to place the vertex, from the kept vertex to the removed vertex
- insert(*args)
Overload 1:
Insert a surface at a location in the list of surfaces
- Parameters:
s (
Surface) – surface to insertidx (int) – location in the list of surfaces
Overload 2:
Insert a surface before another surface
Overload 3:
Inserts a vertex between two vertices
Overload 4:
Insert a vertex between a vertex and each of a set of vertices
- split(sep)
Split a vertex into an edge
The vertex must define at least one surface.
New topology is governed by a cut plane at the midpoint of, and orthogonal to, the new edge. Each first-order neighbor vertex is connected to the vertex of the new edge on the same side of the cut plane.
- Parameters:
sep (
FVector3) – separation distance- Return type:
- Returns:
newly created vertex
- __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.models.vertex.solver.VertexHandle(_id=-1)
A handle to a
Vertex.The engine allocates
Vertexmemory in blocks, andVertexvalues get moved around all the time, so their addresses change.This is a safe way to work with a
Vertex.- property id
- property bodies
bodies defined by the vertex
- property surfaces
surfaces defined by the vertex
- property pid: int
id of underlying particle
- property connected_vertices
connected vertices
- property area: float
area of the vertex
- property volume: float
volume of the vertex
- property mass: float
mass of the vertex
- property position
position of the vertex
- property velocity
velocity of the vertex
- defines(*args)
Overload 1:
Test whether defines a surface
- Parameters:
s (
SurfaceHandle) – a surface- Return type:
boolean
- Returns:
true if defines a surface
Overload 2:
Test whether defines a body
- Parameters:
b (
BodyHandle) – a body- Return type:
boolean
- Returns:
true if defines a body
- destroy()
Destroy the vertex
- validate()
Validate the vertex
- position_changed()
Update internal data due to a change in position
- toString()
Get a JSON string representation
- static fromString(s)
Create an instance from a JSON string representation
- Parameters:
s (string) – JSON string
- add(s)
Add a surface
- Parameters:
s (
SurfaceHandle) – surface to add
- remove(s)
Remove a surface
- Parameters:
s (
SurfaceHandle) – surface to remove
- find_surface(dir)
Find a surface defined by this vertex
- Parameters:
dir (
FVector3) – direction to look with respect to the vertex
- find_body(dir)
Find a body defined by this vertex
- Parameters:
dir (
FVector3) – direction to look with respect to the vertex
- update_connected_vertices()
Update internal connected vertex data
Get the surfaces that this vertex and another vertex both define
- Parameters:
other (
VertexHandle) – another vertex
- update_properties()
Update the properties of the underlying particle
- particle()
Get a handle to the underlying particle, if any
- set_position(pos, updateChildren=1)
Set the current position
- Parameters:
pos (
FVector3) – positionupdateChildren (boolean, optional) – flag indicating whether to update dependent objects
- transfer_bonds_to(other)
Transfer all bonds to another vertex
- Parameters:
other (
VertexHandle) – another vertex
- merge(toRemove, lenCf=0.5)
Merge with a vertex.
The passed vertex is destroyed.
- Parameters:
toRemove (
VertexHandle) – vertex to removelenCf (float, optional) – distance coefficient in [0, 1] for where to place the vertex, from the kept vertex to the removed vertex
- split(sep)
Split a vertex into an edge
The vertex must define at least one surface.
New topology is governed by a cut plane at the midpoint of, and orthogonal to, the new edge. Each first-order neighbor vertex is connected to the vertex of the new edge on the same side of the cut plane.
- Parameters:
sep (
FVector3) – separation distance- Return type:
- Returns:
newly created vertex
- __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.