stk.cof.UnaligningVertex
- class stk.cof.UnaligningVertex(id, position, aligner_edge=0, cell=(0, 0, 0))[source]
Bases:
_CofVertex
Just places a building block, does not align.
Initialize a
_CofVertex
.- Parameters:
id (
int
) – The id of the vertex.aligner_edge (
int
, optional) – The edge which is used to align theBuildingBlock
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.cell (
tuple
ofint
, optional) – The cell of the lattice in which the vertex is found.
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
_CofVertex
in the middle of vertices.Initialize a
_CofVertex
at the center of vertices.Map functional groups to edges.
Place building_block on the
Vertex
.Get a clone at a certain position.
Get a clone with a scaled position.
- 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.
- classmethod init_at_center(id, vertices, aligner_edge=0, cell=(0, 0, 0))[source]
Initialize a
_CofVertex
in the middle of vertices.- Parameters:
id (
int
) – The id of the initialized vertex.vertices (
tuple
ofVertex
) – The vertices at whose center this one needs to be.aligner_edge (
int
, optional) – The edge which is used to align theBuildingBlock
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.cell (
tuple
ofint
, optional) – The cell of the lattice in which the vertex is found.
- Returns:
The new vertex.
- Return type:
_CofVertex
- classmethod init_at_shifted_center(id, vertices, cell_shifts, lattice_constants, aligner_edge=0, cell=(0, 0, 0))[source]
Initialize a
_CofVertex
at the center of vertices.The vertices are shifted according to the lattice constants and cell shifts.
- Parameters:
id (
int
) – The id of the initialized vertex.vertices (
tuple
ofVertex
) – The vertices at whose center this one needs to be.cell_shifts (
tuple
ofint
) – The number of cells shifted in the x, y and z directions.lattice_constants (
tuple
ofnumpy.ndarray
) – The a, b and c lattice constants.aligner_edge (
int
, optional) – The edge which is used to align theBuildingBlock
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.cell (
tuple
ofint
, optional) – The cell of the lattice in which the vertex is found.
- Returns:
The new vertex.
- Return type:
_CofVertex
- 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.
- with_position(position)
Get a clone at a certain position.
- with_scale(scale)
Get a clone with a scaled position.