Vertex¶
- class Vertex(pos)[source]¶
Bases:
ShapeObject
“Vertex” inherits from “ShapeObject”
Inits Vertex
- Parameters:
pos (List[Union[float, int]]) – position of vertex
Methods
- add_parent(parent)¶
Adds parent
- Parameters:
parent (ShapeObject) – Adds parent
- Return type:
None
- static create_id()¶
Creates int as unique ID for ShapeObject instance. ShapeObject class tracks which IDs have previously been used and are thus not available.
- Returns:
Unique ID
- Return type:
int
- set_position(pos)[source]¶
Sets global position of Vertex
- Parameters:
pos (List[Union[float, int]]) – global position
- shallowcopy()[source]¶
Returns a shallow copy of the Vertex.
A shallow copy creates a new Vertex with only the position being copied
- Returns:
Shallow copy of vertex
- Return type:
Attributes
- last_id = 0¶
- position¶
Return position of vertex