stk.polymer.UnaligningVertex

class stk.polymer.UnaligningVertex(id, position, flip)[source]

Bases: LinearVertex

Just places a building block, does not align.

Initialize a LinearVertex instance.

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

  • position (tuple[float, float, float] | ndarray) – The position of the vertex.

  • flip (bool) – If True any building block placed by the vertex will have its orientation along the chain flipped.

Methods

clone

Return a clone.

get_cell

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

get_flip

Return whether the vertex flips building blocks it places.

get_id

Get the id.

get_position

Get the position.

map_functional_groups_to_edges

Map functional groups to edges.

place_building_block

Place building_block on the Vertex.

with_position

Get a clone at a certain position.

with_scale

Get a clone with a scaled position.

clone()

Return a clone.

Returns:

The clone.

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

Return whether the vertex flips building blocks it places.

Returns:

True if the vertex flips building blocks it places.

Return type:

bool

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

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) – BuildingBlock The building block which is needs to have functional groups assigned to edges.

  • edges (tuple[Edge, ...]) – 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.

Return type:

dict[int, int]

place_building_block(building_block, edges)[source]

Place building_block on the Vertex.

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

  • edges (tuple[Edge, ...]) – The edges to which the vertex is attached.

Returns:

The position matrix of building_block after being placed.

Return type:

ndarray

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