-
Notifications
You must be signed in to change notification settings - Fork 0
Conditional and FromStyleBlockAttr #1
Comments
It returns the value if the conditions is True, otherwise it returns None. |
It can be represented in PML as:
|
How to represent it in blosm nodes? |
Conditional nodeInput sockets:
Output sockets:
|
From Style Block nodeInput sockets: Output sockets:
Properties:
|
From OSM nodeInput sockets: Output sockets:
Properties:
|
Alternatives nodeInput sockets (probably 7 values is enough):
Output sockets:
|
FromAttr("roof:material", FromAttr.String, CladdingMaterials),
Conditional(
lambda roof: roof.footprint.getStyleBlockAttr("roofShape") == "flat",
RandomWeighted(( ("concrete", 1), ("gravel", 1) ))
),
Conditional(
lambda roof: roof.footprint.getStyleBlockAttr("roofShape") == "dome",
Constant("glass")
),
)))
FromStyleBlockAttr("claddingMaterial", FromStyleBlockAttr.Footprint)
And finally: |
Per Building nodeInput sockets:
Output sockets:
|
Per Footprint nodeInput sockets:
Output sockets:
|
I do not really understand the term item in the condition. The proposition in PML is
while the corrsponding Python code becomes
How can a translator find that the item is roof here? Where does this context come from? |
Any variable can be used in the Python's lambda syntax: I'd suggest always use the variable item in the Python code. |
To be continued at prochitecture/pml#6 |
The text was updated successfully, but these errors were encountered: