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 firstFunctionalGroup
is rotated such that it lies exactly on thisEdge
. Must be between0
and the number of edges the vertex is connected to.
Methods
Return a clone.
Return the aligner edge of the vertex.
Get the cell of the lattice in which the vertex is found.
Get the id.
Get the position.
Initialize a
_CageVertex
in the middle of vertices.Map functional groups to edges.
Place building_block on the
Vertex
.True
if the position should be updated based on neighbors.Return a clone with a different aligner_edge.
Get a clone at a certain position.
Get a clone with a scaled position.
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:
- 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:
- classmethod init_at_center(id, vertices)
Initialize a
_CageVertex
in the middle of vertices.
- 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_block –
BuildingBlock
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:
- with_aligner_edge(aligner_edge)
Return a clone with a different aligner_edge.
- with_position(position)
Get a clone at a certain position.
- with_scale(scale)
Get a clone with a scaled position.