Fix variable expression calculation

dev
jaseg 2023-05-08 23:11:51 +02:00
rodzic b1e189eed2
commit b5ff6a966b
2 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -167,7 +167,7 @@ class VariableExpression(Expression):
def optimized(self, variable_binding={}):
if self.number in variable_binding:
return ConstantExpression(expr(variable_binding[self.number]).optimized(variable_binding))
return expr(variable_binding[self.number]).optimized(variable_binding)
return self
def __eq__(self, other):

Wyświetl plik

@ -715,14 +715,14 @@ def _demo():
#pattern3 = EmptyProtoArea(copper_fill=True)
#stack = TwoSideLayout(pattern2, pattern3)
#pattern2 = PatternProtoArea(2.54, obj=PoweredProto(), margin=1)
#pattern3 = PatternProtoArea(2.54, obj=RFGroundProto())
pattern = PatternProtoArea(2.54, obj=RFGroundProto())
#stack = PropLayout([pattern2, pattern3], 'h', [0.5, 0.5])
#pattern = PropLayout([pattern1, stack], 'h', [0.5, 0.5])
#pattern = PatternProtoArea(2.54, obj=ManhattanPads(2.54))
#pattern = PatternProtoArea(2.54*1.5, obj=THTFlowerProto())
#pattern = PatternProtoArea(2.54, obj=THTPad.circle(0, 0, 0.9, 1.8, paste=False))
#pattern = PatternProtoArea(2.54, obj=PoweredProto())
pattern = PatternProtoArea(2.54, obj=AlioCell(), margin=2)
#pattern = PatternProtoArea(2.54, obj=AlioCell(), margin=2)
pb = ProtoBoard(50, 47, pattern, mounting_hole_dia=3.2, mounting_hole_offset=5)
#pb = ProtoBoard(10, 10, pattern1)
print(pb.pretty_svg())