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) TissueForge::models::vertex::VertexHandle

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

destroy() HRESULT
validate() bool
position_changed() HRESULT
defines(*args) bool
toString() std::string

Get a JSON string representation

add(s: _vertex_solver_Surface) HRESULT

Add a surface

Parameters:

s (Surface) – surface to add

insert(*args) HRESULT

Overload 1:

Insert a surface at a location in the list of surfaces

Parameters:
  • s (Surface) – surface to insert

  • idx (int) – location in the list of surfaces


Overload 2:

Insert a surface before another surface

Parameters:
  • s (Surface) – a surface

  • before (Surface) – surface to insert before


Overload 3:

Inserts a vertex between two vertices

Parameters:
  • v1 (Vertex) – first vertex

  • v2 (Vertex) – second vertex


Overload 4:

Insert a vertex between a vertex and each of a set of vertices

Parameters:
  • vf (Vertex) – a vertex

  • nbs (std::vector< TissueForge::models::vertex::Vertex *,std::allocator< TissueForge::models::vertex::Vertex * > >) – 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

remove(s: _vertex_solver_Surface) HRESULT

Remove a surface

Parameters:

s (Surface) – surface to remove

replace(*args) HRESULT

Overload 1:

Replace a surface at a location in the list of surfaces

Parameters:
  • toInsert (Surface) – a surface

  • idx (int) – a location in the list of surfaces


Overload 2:

Replace a surface with another surface

Parameters:
  • toInsert (Surface) – surface to insert

  • toRemove (Surface) – surface to remove


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: fVector3) TissueForge::models::vertex::Surface *

Find a surface defined by this vertex

Parameters:

dir (FVector3) – direction to look with respect to the vertex

find_body(dir: fVector3) TissueForge::models::vertex::Body *

Find a body defined by this vertex

Parameters:

dir (FVector3) – direction to look with respect to the vertex

update_connected_vertices() void

Update internal connected vertex data

shared_surfaces(other: _vertex_solver_Vertex) std::vector< TissueForge::models::vertex::Surface *,std::allocator< TissueForge::models::vertex::Surface * > >

Get the surfaces that this vertex and another vertex both define

Parameters:

other (Vertex) – another vertex

update_properties() HRESULT

Update the properties of the underlying particle

particle() TissueForge::ParticleHandle *

Get a handle to the underlying particle, if any

set_position(pos: fVector3, updateChildren: bool const & = True) HRESULT

Set the current position

Parameters:
  • pos (FVector3) – position

  • updateChildren (boolean) – flag indicating whether to update dependent objects

transfer_bonds_to(other: _vertex_solver_Vertex) HRESULT

Transfer all bonds to another vertex

Parameters:

other (Vertex) – another vertex

replace(*args) HRESULT

Overload 1:

Replace a surface at a location in the list of surfaces

Parameters:
  • toInsert (Surface) – a surface

  • idx (int) – a location in the list of surfaces


Overload 2:

Replace a surface with another surface

Parameters:
  • toInsert (Surface) – surface to insert

  • toRemove (Surface) – surface to remove


Overload 3:

Replace a surface

Parameters:

toReplace (Surface) – surface to replace


Overload 4:

Replace a body

Parameters:

toReplace (Body) – a body

merge(toRemove: _vertex_solver_Vertex, lenCf: FloatP_t const & = 0.5) HRESULT

Merge with a vertex.

The passed vertex is destroyed.

Parameters:
  • toRemove (Vertex) – vertex to remove

  • lenCf (float) – distance coefficient in [0, 1] for where to place the vertex, from the kept vertex to the removed vertex

insert(*args) HRESULT

Overload 1:

Insert a surface at a location in the list of surfaces

Parameters:
  • s (Surface) – surface to insert

  • idx (int) – location in the list of surfaces


Overload 2:

Insert a surface before another surface

Parameters:
  • s (Surface) – a surface

  • before (Surface) – surface to insert before


Overload 3:

Inserts a vertex between two vertices

Parameters:
  • v1 (Vertex) – first vertex

  • v2 (Vertex) – second vertex


Overload 4:

Insert a vertex between a vertex and each of a set of vertices

Parameters:
  • vf (Vertex) – a vertex

  • nbs (std::vector< TissueForge::models::vertex::Vertex *,std::allocator< TissueForge::models::vertex::Vertex * > >) – a set of vertices

split(sep: fVector3) TissueForge::models::vertex::Vertex *

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:

Vertex

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: int const & = -1)

A handle to a Vertex.

The engine allocates Vertex memory in blocks, and Vertex values get moved around all the time, so their addresses change.

This is a safe way to work with a Vertex.

property id
property vertex

underlying Vertex instance, if any

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) bool

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() HRESULT

Destroy the vertex

validate() bool

Validate the vertex

position_changed() HRESULT

Update internal data due to a change in position

toString() std::string

Get a JSON string representation

static fromString(s: std::string const &) TissueForge::models::vertex::VertexHandle

Create an instance from a JSON string representation

Parameters:

s (string) – JSON string

add(s: _vertex_solver_SurfaceHandle) HRESULT

Add a surface

Parameters:

s (SurfaceHandle) – surface to add

remove(s: _vertex_solver_SurfaceHandle) HRESULT

Remove a surface

Parameters:

s (SurfaceHandle) – surface to remove

find_surface(dir: fVector3) TissueForge::models::vertex::SurfaceHandle

Find a surface defined by this vertex

Parameters:

dir (FVector3) – direction to look with respect to the vertex

find_body(dir: fVector3) TissueForge::models::vertex::BodyHandle

Find a body defined by this vertex

Parameters:

dir (FVector3) – direction to look with respect to the vertex

update_connected_vertices() void

Update internal connected vertex data

shared_surfaces(other: _vertex_solver_VertexHandle) std::vector< TissueForge::models::vertex::SurfaceHandle,std::allocator< TissueForge::models::vertex::SurfaceHandle > >

Get the surfaces that this vertex and another vertex both define

Parameters:

other (VertexHandle) – another vertex

update_properties() HRESULT

Update the properties of the underlying particle

particle() TissueForge::ParticleHandle *

Get a handle to the underlying particle, if any

set_position(pos: fVector3, updateChildren: bool const & = True) HRESULT

Set the current position

Parameters:
  • pos (FVector3) – position

  • updateChildren (boolean) – flag indicating whether to update dependent objects

transfer_bonds_to(other: _vertex_solver_VertexHandle) HRESULT

Transfer all bonds to another vertex

Parameters:

other (VertexHandle) – another vertex

merge(toRemove: _vertex_solver_VertexHandle, lenCf: FloatP_t const & = 0.5) HRESULT

Merge with a vertex.

The passed vertex is destroyed.

Parameters:
  • toRemove (VertexHandle) – vertex to remove

  • lenCf (float) – distance coefficient in [0, 1] for where to place the vertex, from the kept vertex to the removed vertex

split(sep: fVector3) TissueForge::models::vertex::VertexHandle

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:

VertexHandle

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.