Closed vvoovv closed 1 year ago
The resulting output is
Could you please post the desired (correct) result? I am no more used to read PML code.
If the alternatives are reversed for claddingColor
facade(item.gable and 2.5 < item.width < 12.) {
claddingColor: green | if (item.front) green;
}
then it works correctly:
styles = [
Facade(
condition = lambda item : item.gable and 2.5 < item.width < 12.,
claddingColor = Value(Alternatives(
Constant((0.0, 0.502, 0.0, 1.0)),
Conditional(
lambda item: item.front,
Constant((0.0, 0.502, 0.0, 1.0))
)
))
)
]
So the desired output should be:
styles = [
Facade(
condition = lambda item : item.gable and 2.5 < item.width < 12.,
claddingColor = Value(Alternatives(
Conditional(
lambda item: item.front,
Constant((0.0, 0.502, 0.0, 1.0))
),
Constant((0.0, 0.502, 0.0, 1.0))
))
)
]
The following PML code (attached as a text file here) generates incorrect Python code:
Fixed. Committed to the branch 'pml'.
Thank you very much! It works.
I'll add some unit tests to the repository to cover those cases.
Added unit tests at _tests/testconditional.py.
The following PML code (attached as a text file here) generates incorrect Python code:
The resulting output is