stk.cage.AngledVertex

class stk.cage.AngledVertex(id, position, use_neighbor_placement=True, aligner_edge=0)[source]

Bases: _CageVertex

Parameters:
  • id (int) – The id of the vertex.

  • position (ndarray) – The position of the vertex.

  • use_neighbor_placement (bool) – If True, the position of the vertex will be updated based on the neighboring functional groups.

  • aligner_edge (int) – The edge which is used to align the BuildingBlock placed on the vertex. The first FunctionalGroup is rotated such that it lies exactly on this Edge. Must be between 0 and the number of edges the vertex is connected to.

Methods

clone

Return a clone.

get_aligner_edge

Return the aligner edge of the vertex.

get_cell

Get the cell of the lattice in which the vertex is found.

get_id

Get the id.

get_position

Get the position.

init_at_center

Initialize a _CageVertex in the middle of vertices.

map_functional_groups_to_edges

Map functional groups to edges.

place_building_block

Place building_block on the Vertex.

use_neighbor_placement

True if the position should be updated based on neighbors.

with_aligner_edge

Return a clone with a different aligner_edge.

with_position

Get a clone at a certain position.

with_scale

Get a clone with a scaled position.

with_use_neighbor_placement

Return a clone with a different use_neighbor_placement.

clone()

Return a clone.

Returns:

The clone.

get_aligner_edge()

Return the aligner edge of the vertex.

Returns:

The aligner edge.

Return type:

int

get_cell()

Get the cell of the lattice in which the vertex is found.

Returns:

The cell of the lattice in which the vertex is found.

Return type:

ndarray

get_id()

Get the id.

Returns:

The id.

Return type:

int

get_position()

Get the position.

Returns:

The position of the Vertex.

Return type:

ndarray

classmethod init_at_center(id, vertices)

Initialize a _CageVertex in the middle of vertices.

Parameters:
  • id (int) – The id of the initialized vertex.

  • vertices (tuple[Vertex, ...]) – The vertices at whose center this one needs to be.

Returns:

The new vertex.

Return type:

Self

map_functional_groups_to_edges(building_block, edges)[source]

Map functional groups to edges.

Each functional group in building_block needs to be assigned to an edge in edges.

Parameters:
  • building_blockBuildingBlock The building block which is needs to have functional groups assigned to edges.

  • edges – The edges to which the vertex is attached.

Returns:

A mapping from the id of a functional group in building_block to the id of the edge in edges it is assigned to.

place_building_block(building_block, edges)[source]

Place building_block on the Vertex.

Parameters:
  • building_block – The building block molecule which is to be placed on the vertex.

  • edges – The edges to which the vertex is attached.

Returns:

The position matrix of building_block after being placed.

use_neighbor_placement()

True if the position should be updated based on neighbors.

Returns:

True if the position of the vertex should be updated based on the positions of functional groups on neighboring vertices.

Return type:

bool

with_aligner_edge(aligner_edge)

Return a clone with a different aligner_edge.

Parameters:

aligner_edge (int) – The aligner edge of the clone.

Returns:

The clone. Has the same type as the original instance.

Return type:

Self

with_position(position)

Get a clone at a certain position.

Parameters:

position (ndarray) – The desired position of the clone.

Returns:

The clone.

Return type:

Self

with_scale(scale)

Get a clone with a scaled position.

Parameters:

scale (float | tuple[float, float, float]) – The value by which the position of the Vertex is scaled. Can be a single number if all axes are scaled by the same amount or a tuple of three numbers if each axis is scaled by a different value.

Returns:

The clone.

Return type:

Self

with_use_neighbor_placement(use_neighbor_placement)

Return a clone with a different use_neighbor_placement.

Parameters:

use_neighbor_placement (bool) – True if the position should be updated based on neighbors.

Returns:

The clone. Has the same type as the original instance.

Return type:

Self