Skip to content
Snippets Groups Projects
Commit a62ef52e authored by mehtank's avatar mehtank
Browse files

explicit angle in Extension

parent fe3c951b
Branches
No related merge requests found
from svggen.api.component import Component
from svggen.api.Function import Function
c = Component()
c.addParameter("l")
c.addParameter("w")
c.addParameter("angle", 180)
c.addSubcomponent("top", "Rectangle")
c.addSubcomponent("bot", "Rectangle")
......@@ -15,7 +18,7 @@ c.addConstraint(("bot", "l"), "w")
c.addConstraint(("bot", "w"), "l", "x/2")
c.addConnection(("top", "b"),
("bot", "t"), angle=180)
("bot", "t"), angle=Function(params="angle", fnstring="x"))
c.inheritInterface("t", ("top", "t"))
c.inheritInterface("b", ("bot", "b"))
......
......@@ -2,11 +2,15 @@ connections:
connection0:
- [top, b]
- [bot, t]
- {angle: 180}
- angle: {parameter: angle}
interfaces:
b: {interface: b, subcomponent: bot}
t: {interface: t, subcomponent: top}
parameters: {l: null, w: null}
metadata:
angle: {default: 180}
l: {default: null}
w: {default: null}
parameters: {angle: 180, l: null, w: null}
subcomponents:
bot:
classname: Rectangle
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment