length_factor¶
Python reference for nagasim.appearance.length_factor. Provisional: it may change between minor versions, see Appearance.
Metres per length unit of one conveyor piece.
A piece's path, part lengths and stored guide openings are in its length_unit, else the
model's (simulation.length_unit); multiply by this to get metres.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
document
|
ModelDocument
|
The model, |
required |
params
|
dict
|
The CONVEYOR block's params. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Metres per unit: 1.0 in a metre model, 0.001 in a millimetre one. |
See Also
nagasim.appearance.look_of : Takes this factor to give openings in metres. nagasim.appearance.piece_length_m : A piece's length already in metres.
Examples:
>>> from nagasim.appearance import length_factor
>>> from nagasim.appearance import ModelDocument
>>> length_factor(ModelDocument({"simulation": {"length_unit": "millimeters"}}), {})
0.001