piece_start¶
Python reference for nagasim.appearance.piece_start. Provisional: it may change between minor versions, see Appearance.
Where a conveyor piece starts on the floor: its position and heading.
The pose is the block's layout_position and layout_rotation, in plan
coordinates: x east and y south in metres, and a heading in degrees clockwise on screen,
0 pointing east and 90 south. A piece is drawn from here along its path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
document
|
ModelDocument
|
The model, |
required |
name
|
str
|
The CONVEYOR block's name. |
required |
Returns:
| Type | Description |
|---|---|
Pose or None
|
|
See Also
nagasim.appearance.piece_segments : The pieces of path laid from this pose. nagasim.appearance.piece_pose : The pose at a distance along the path.
Examples:
>>> from nagasim.appearance import ModelDocument, piece_start
>>> doc = ModelDocument({"blocks": [{"name": "Belt", "type": "CONVEYOR",
... "layout_position": [2, 3], "layout_rotation": 90,
... "params": {"type": "roller", "path": [{"straight": 4}]}}]})
>>> piece_start(doc, "Belt")
Pose(x=2.0, y=3.0, heading=90.0)
>>> piece_start(doc, "Missing") is None
True