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

boats

parent 028c23ac
No related merge requests found
Showing with 962 additions and 28 deletions
from svggen.api.component import Component
c = Component()
# BOX
c.addParameter("depth", 50)
c.addParameter("width", 60)
c.addParameter("height", 30)
c.addSubcomponent("top","Rectangle")
c.addSubcomponent("fore","Rectangle")
c.addSubcomponent("rear","Rectangle")
c.addSubcomponent("port","Rectangle")
c.addSubcomponent("star","Rectangle")
c.addConstraint(("top","w"), "depth")
c.addConstraint(("top","l"), "width")
c.addConstraint(("fore","w"), "height")
c.addConstraint(("fore","l"), "width")
c.addConstraint(("rear","w"), "height")
c.addConstraint(("rear","l"), "width")
c.addConnection(("rear", "t"), ("top", "b"), angle=90)
c.addConnection(("top", "t"), ("fore", "b"), angle=90)
c.addConstraint(("port","w"), "depth")
c.addConstraint(("port","l"), "height")
c.addConstraint(("star","w"), "depth")
c.addConstraint(("star","l"), "height")
c.addConnection(("port", "r"), ("top", "l"), angle=90)
c.addConnection(("top", "r"), ("star", "l"), angle=90)
# Interface to floats
c.addParameter("length", 200)
c.addSubcomponent("portsplit","SplitEdge")
c.addSubcomponent("starsplit","SplitEdge")
c.addConstraint(("portsplit","botlength"), ("length", "depth"), "[sum(x)]")
c.addConstraint(("portsplit","toplength"), ("length", "depth"), "[x[0]/2., x[1], x[0]/2.]")
c.addConnection(("portsplit", "topedge1"), ("port", "l"))
c.addConstraint(("starsplit","botlength"), ("length", "depth"), "[sum(x)]")
c.addConstraint(("starsplit","toplength"), ("length", "depth"), "[x[0]/2., x[1], x[0]/2.]")
c.addConnection(("starsplit", "topedge1"), ("star", "r"))
c.inheritInterface("portedge", ("portsplit", "botedge0"))
c.inheritInterface("staredge", ("starsplit", "botedge0"))
c.toYaml("library/Cabin.yaml")
from svggen.api.component import Component
c = Component()
# BOX
c.addSubcomponent("boat","BoatBase", inherit=True, prefix=None)
c.addParameter("n", 3)
c.addSubcomponent("portsplit","SplitEdge")
c.addSubcomponent("starsplit","SplitEdge")
c.addConstraint(("portsplit","botlength"), ("length", "n"), "[x[0]]")
c.addConstraint(("portsplit","toplength"), ("length", "n"), "[x[0]/(2.*x[1]+1.)] * (2*x[1]+1)")
c.addConstraint(("starsplit","toplength"), ("length", "n"), "[x[0]]")
c.addConstraint(("starsplit","botlength"), ("length", "n"), "[x[0]/(2.*x[1]+1.)] * (2*x[1]+1)")
c.addConnection(("portsplit", "botedge0"), ("boat", "portedge"), angle=90)
c.addConnection(("starsplit", "topedge0"), ("boat", "staredge"), angle=90, tabWidth=10)
for i in range(10):
nm = "seat%d"%i
c.addSubcomponent(nm, "Rectangle")
c.addConstraint((nm, "l"), ("width", "n"), "(%d < x[1]) and x[0] or 0" % i)
c.addConstraint((nm, "w"), ("length", "n"), "x[0]/(2.*x[1]+1.)")
c.addConnection(("portsplit", "topedge%d" % (2*i+1)), (nm, "l"))
c.addConnection(("starsplit", "botedge%d" % (2*i+1)), (nm, "r"))
c.toYaml("library/Canoe.yaml")
from svggen.api.component import Component
c = Component()
# BOX
c.addSubcomponent("cabin","Cabin", inherit=True, prefix=None, invert=True)
c.addSubcomponent("port","BoatBase")
c.addSubcomponent("star","BoatBase")
c.addConstraint(("port","length"), ("length", "depth"), "sum(x)")
c.addConstraint(("port","width"), ("length", "depth"), "sum(x)/10.")
c.addConstraint(("port","depth"), ("length", "depth"), "sum(x)/20.")
c.addConstraint(("port","bow"), "length", "x/2.")
c.addConstraint(("port","stern"), "length", "x/8.")
c.addConstraint(("star","length"), ("length", "depth"), "sum(x)")
c.addConstraint(("star","width"), ("length", "depth"), "sum(x)/10.")
c.addConstraint(("star","depth"), ("length", "depth"), "sum(x)/20.")
c.addConstraint(("star","bow"), "length", "x/2.")
c.addConstraint(("star","stern"), "length", "x/8.")
c.addConnection(("cabin", "portedge"), ("port", "staredge"))
c.addConnection(("cabin", "staredge"), ("star", "portedge"))
c.toYaml("library/Catamaran.yaml")
from svggen.api.component import Component
c = Component()
# BOX
c.addParameter("n", 6)
c.addParameter("spacing", 25)
for i in range(3):
c.addSubcomponent("boat%d"%i,"BoatBase", inherit=True, prefix=None)
c.addSubcomponent("portsplit%d"%i,"SplitEdge")
c.addSubcomponent("starsplit%d"%i,"SplitEdge")
c.addConstraint(("portsplit%d"%i,"botlength"), ("length", "n"), "[x[0]]")
c.addConstraint(("portsplit%d"%i,"toplength"), ("length", "n"), "[x[0]/(1.*x[1])] * x[1]")
c.addConstraint(("starsplit%d"%i,"toplength"), ("length", "n"), "[x[0]]")
c.addConstraint(("starsplit%d"%i,"botlength"), ("length", "n"), "[x[0]/(1.*x[1])] * x[1]")
c.addConnection(("portsplit%d"%i, "botedge0"), ("boat%d"%i, "portedge"), angle=-90)
c.addConnection(("starsplit%d"%i, "topedge0"), ("boat%d"%i, "staredge"), angle=-90)
for i in range(10):
nm = "seat%d"%i
c.addSubcomponent(nm, "Rectangle")
c.addConstraint((nm, "l"), ("spacing", "n"), "(%d < x[1]) and x[0] or 0" % i)
c.addConstraint((nm, "w"), ("length", "n"), "x[0]/(1.*x[1])")
if (i % 2):
c.addConnection(("starsplit0", "botedge%d" % i), (nm, "l"))
c.addConnection(("portsplit1", "topedge%d" % i), (nm, "r"))
else:
c.addConnection(("starsplit1", "botedge%d" % i), (nm, "l"))
c.addConnection(("portsplit2", "topedge%d" % i), (nm, "r"))
c.toYaml("library/Trimaran.yaml")
from svggen.api.component import Component
c = Component()
# BOX
c.addSubcomponent("cabin","Cabin", inherit=True, prefix=None)
c.addSubcomponent("boat","BoatBase")
c.addConstraint(("boat","length"), ("length", "depth"), "sum(x)")
c.addConstraint(("boat","width"), "width")
c.addConstraint(("boat","depth"), "width", "x/3.")
c.addConstraint(("boat","bow"), "length", "x/2.")
c.addConstraint(("boat","stern"), "length", "x/8.")
c.addConnection(("cabin", "portedge"), ("boat", "portedge"), angle=0)
c.addConnection(("cabin", "staredge"), ("boat", "staredge"), angle=0, tabWidth=10)
c.toYaml("library/Tug.yaml")
...@@ -6,25 +6,22 @@ import svggen.utils.mymath as math ...@@ -6,25 +6,22 @@ import svggen.utils.mymath as math
class BoatBase(Component): class BoatBase(Component):
_test_params = { _test_params = { }
"length": 100,
"width": 20,
"height": 10,
"bow": 35,
"stern": 5,
}
def define(self): def define(self):
self.addParameter("length", 100) self.addParameter("length", 250)
self.addParameter("width", 30) self.addParameter("width", 50)
self.addParameter("height", 20) self.addParameter("depth", 20)
self.addParameter("bow", 15) self.addParameter("bow", 45)
self.addParameter("stern", 5) self.addParameter("stern", 0)
self.addInterface("staredge", EdgePort(self, None))
self.addInterface("portedge", EdgePort(self, None))
def assemble(self): def assemble(self):
l = self.getParameter("length") l = self.getParameter("length")
w = self.getParameter("width") w = self.getParameter("width")
h = self.getParameter("height") h = self.getParameter("depth")
b = self.getParameter("bow") b = self.getParameter("bow")
s = self.getParameter("stern") s = self.getParameter("stern")
...@@ -37,40 +34,46 @@ class BoatBase(Component): ...@@ -37,40 +34,46 @@ class BoatBase(Component):
rt = Rectangle("", l, h) rt = Rectangle("", l, h)
graph.attachFace("bt.e2", rt, "e0", prefix="rt", angle=90) graph.attachFace("bt.e2", rt, "e0", prefix="rt", angle=90)
def point(lbl, b, edge, flip=False): def point(lbl, d, edge, flip=False):
lb = math.sqrt(h*h+b*b) lb = math.sqrt(h*h+d*d)
ab = math.rad2deg(math.arctan2(h,b)) ab = math.rad2deg(math.arctan2(h,d))
f = Face("", ((w/2.,0), (0, lb), (-w/2., 0))) f = Face("", ((w/2.,0), (0, lb), (-w/2., 0)))
graph.attachFace("bt."+edge, f, "e0", prefix=lbl, angle=ab) graph.attachFace("bt."+edge, f, "e0", prefix=lbl, angle=ab)
lb = math.sqrt(w*w/4.+b*b) lb = math.sqrt(w*w/4.+d*d)
ab = math.rad2deg(math.arctan2(w/2.,b)) ab = math.rad2deg(math.arctan2(w/2.,d))
f1 = RightTriangle("", h, lb); e1 = "e0" f1 = RightTriangle("", h, lb); e1 = "e0"
f1a = RightTriangle("", h, lb) #f1a = Face("", ((h, 0), (0, lb), (0,0*lb/2.)))
f1b = RightTriangle("", lb, h) #f1b = Face("", ((lb, 0), (0, h), (0*lb/2.,0)))
f2 = RightTriangle("", lb, h); e2 = "e2" f2 = RightTriangle("", lb, h); e2 = "e2"
f2a = RightTriangle("", lb, h) #f2a = Face("", ((lb, 0), (0, h), (0*lb/2.,0)))
f2b = RightTriangle("", h, lb) #f2b = Face("", ((h, 0), (0, lb), (0,0*lb/2.)))
if flip: if flip:
f1, f2 = f2, f1 f1, f2 = f2, f1
f1a, f2a = f2a, f1a #f1a, f2a = f2a, f1a
f1b, f2b = f2b, f1b #f1b, f2b = f2b, f1b
e1, e2 = e2, e1 e1, e2 = e2, e1
#graph.attachFace(lbl+".e2", f1, "e1", prefix=lbl+"rt", angle=ab)
graph.attachFace("rt."+edge, f1, e1, prefix=lbl+"rt", angle=ab) graph.attachFace("rt."+edge, f1, e1, prefix=lbl+"rt", angle=ab)
graph.attachFace(lbl+"rt.e1", f1a, "e1", prefix=lbl+"rta", angle=180) #graph.attachFace(lbl+"rt.e1", f1a, "e1", prefix=lbl+"rta", angle=180)
graph.attachFace(lbl+"rta."+e2, f1b, e1, prefix=lbl+"rtb", angle=-180) #graph.attachFace(lbl+"rta."+e2, f1b, e1, prefix=lbl+"rtb", angle=-180)
#graph.attachFace(lbl+".e1", f2, "e1", prefix=lbl+"lt", angle=ab)
graph.attachFace("lt."+edge, f2, e2, prefix=lbl+"lt", angle=ab) graph.attachFace("lt."+edge, f2, e2, prefix=lbl+"lt", angle=ab)
graph.attachFace(lbl+"lt.e1", f2a, "e1", prefix=lbl+"lta", angle=180) #graph.attachFace(lbl+"lt.e1", f2a, "e1", prefix=lbl+"lta", angle=180)
graph.attachFace(lbl+"lta."+e1, f2b, e2, prefix=lbl+"ltb", angle=-180) #graph.attachFace(lbl+"lta."+e1, f2b, e2, prefix=lbl+"ltb", angle=-180)
point("bow", b, "e1") point("bow", b, "e1")
point("stern", s, "e3", flip=True) point("stern", s, "e3", flip=True)
self.composables["graph"] = graph self.composables["graph"] = graph
self.setInterface("staredge", EdgePort(self, "rt.e2"))
self.setInterface("portedge", EdgePort(self, "lt.e0"))
if __name__ == "__main__": if __name__ == "__main__":
h = BoatBase() h = BoatBase()
h._make_test() h._make_test()
......
connections:
connection0:
- [rear, t]
- [top, b]
- {angle: 90}
connection1:
- [top, t]
- [fore, b]
- {angle: 90}
connection2:
- [port, r]
- [top, l]
- {angle: 90}
connection3:
- [top, r]
- [star, l]
- {angle: 90}
connection4:
- [portsplit, topedge1]
- [port, l]
- {}
connection5:
- [starsplit, topedge1]
- [star, r]
- {}
interfaces:
portedge: {interface: botedge0, subcomponent: portsplit}
staredge: {interface: botedge0, subcomponent: starsplit}
metadata:
depth: {default: 50}
height: {default: 30}
length: {default: 200}
width: {default: 60}
parameters: {depth: 50, height: 30, length: 200, width: 60}
subcomponents:
fore:
classname: Rectangle
kwargs: {}
parameters:
l: {parameter: width}
w: {parameter: height}
port:
classname: Rectangle
kwargs: {}
parameters:
l: {parameter: height}
w: {parameter: depth}
portsplit:
classname: SplitEdge
kwargs: {}
parameters:
botlength:
function: '[sum(x)]'
parameter: [length, depth]
toplength:
function: '[x[0]/2., x[1], x[0]/2.]'
parameter: [length, depth]
rear:
classname: Rectangle
kwargs: {}
parameters:
l: {parameter: width}
w: {parameter: height}
star:
classname: Rectangle
kwargs: {}
parameters:
l: {parameter: height}
w: {parameter: depth}
starsplit:
classname: SplitEdge
kwargs: {}
parameters:
botlength:
function: '[sum(x)]'
parameter: [length, depth]
toplength:
function: '[x[0]/2., x[1], x[0]/2.]'
parameter: [length, depth]
top:
classname: Rectangle
kwargs: {}
parameters:
l: {parameter: width}
w: {parameter: depth}
connections:
connection0:
- [portsplit, botedge0]
- [boat, portedge]
- {angle: 90}
connection1:
- [starsplit, topedge0]
- [boat, staredge]
- {angle: 90, tabWidth: 10}
connection10:
- [portsplit, topedge9]
- [seat4, l]
- {}
connection11:
- [starsplit, botedge9]
- [seat4, r]
- {}
connection12:
- [portsplit, topedge11]
- [seat5, l]
- {}
connection13:
- [starsplit, botedge11]
- [seat5, r]
- {}
connection14:
- [portsplit, topedge13]
- [seat6, l]
- {}
connection15:
- [starsplit, botedge13]
- [seat6, r]
- {}
connection16:
- [portsplit, topedge15]
- [seat7, l]
- {}
connection17:
- [starsplit, botedge15]
- [seat7, r]
- {}
connection18:
- [portsplit, topedge17]
- [seat8, l]
- {}
connection19:
- [starsplit, botedge17]
- [seat8, r]
- {}
connection2:
- [portsplit, topedge1]
- [seat0, l]
- {}
connection20:
- [portsplit, topedge19]
- [seat9, l]
- {}
connection21:
- [starsplit, botedge19]
- [seat9, r]
- {}
connection3:
- [starsplit, botedge1]
- [seat0, r]
- {}
connection4:
- [portsplit, topedge3]
- [seat1, l]
- {}
connection5:
- [starsplit, botedge3]
- [seat1, r]
- {}
connection6:
- [portsplit, topedge5]
- [seat2, l]
- {}
connection7:
- [starsplit, botedge5]
- [seat2, r]
- {}
connection8:
- [portsplit, topedge7]
- [seat3, l]
- {}
connection9:
- [starsplit, botedge7]
- [seat3, r]
- {}
interfaces: {}
metadata:
bow: {default: 45}
depth: {default: 20}
length: {default: 250}
n: {default: 3}
stern: {default: 0}
width: {default: 50}
parameters: {bow: 45, depth: 20, length: 250, n: 3, stern: 0, width: 50}
subcomponents:
boat:
classname: BoatBase
kwargs: {}
parameters:
bow: {parameter: bow}
depth: {parameter: depth}
length: {parameter: length}
stern: {parameter: stern}
width: {parameter: width}
portsplit:
classname: SplitEdge
kwargs: {}
parameters:
botlength:
function: '[x[0]]'
parameter: [length, n]
toplength:
function: '[x[0]/(2.*x[1]+1.)] * (2*x[1]+1)'
parameter: [length, n]
seat0:
classname: Rectangle
kwargs: {}
parameters:
l:
function: (0 < x[1]) and x[0] or 0
parameter: &id001 [width, n]
w:
function: x[0]/(2.*x[1]+1.)
parameter: &id002 [length, n]
seat1:
classname: Rectangle
kwargs: {}
parameters:
l:
function: (1 < x[1]) and x[0] or 0
parameter: *id001
w:
function: x[0]/(2.*x[1]+1.)
parameter: *id002
seat2:
classname: Rectangle
kwargs: {}
parameters:
l:
function: (2 < x[1]) and x[0] or 0
parameter: *id001
w:
function: x[0]/(2.*x[1]+1.)
parameter: *id002
seat3:
classname: Rectangle
kwargs: {}
parameters:
l:
function: (3 < x[1]) and x[0] or 0
parameter: *id001
w:
function: x[0]/(2.*x[1]+1.)
parameter: *id002
seat4:
classname: Rectangle
kwargs: {}
parameters:
l:
function: (4 < x[1]) and x[0] or 0
parameter: *id001
w:
function: x[0]/(2.*x[1]+1.)
parameter: *id002
seat5:
classname: Rectangle
kwargs: {}
parameters:
l:
function: (5 < x[1]) and x[0] or 0
parameter: *id001
w:
function: x[0]/(2.*x[1]+1.)
parameter: *id002
seat6:
classname: Rectangle
kwargs: {}
parameters:
l:
function: (6 < x[1]) and x[0] or 0
parameter: *id001
w:
function: x[0]/(2.*x[1]+1.)
parameter: *id002
seat7:
classname: Rectangle
kwargs: {}
parameters:
l:
function: (7 < x[1]) and x[0] or 0
parameter: *id001
w:
function: x[0]/(2.*x[1]+1.)
parameter: *id002
seat8:
classname: Rectangle
kwargs: {}
parameters:
l:
function: (8 < x[1]) and x[0] or 0
parameter: *id001
w:
function: x[0]/(2.*x[1]+1.)
parameter: *id002
seat9:
classname: Rectangle
kwargs: {}
parameters:
l:
function: (9 < x[1]) and x[0] or 0
parameter: *id001
w:
function: x[0]/(2.*x[1]+1.)
parameter: *id002
starsplit:
classname: SplitEdge
kwargs: {}
parameters:
botlength:
function: '[x[0]/(2.*x[1]+1.)] * (2*x[1]+1)'
parameter: [length, n]
toplength:
function: '[x[0]]'
parameter: [length, n]
connections:
connection0:
- [cabin, portedge]
- [port, staredge]
- {}
connection1:
- [cabin, staredge]
- [star, portedge]
- {}
interfaces: {}
metadata:
depth: {default: 50}
height: {default: 30}
length: {default: 200}
width: {default: 60}
parameters: {depth: 50, height: 30, length: 200, width: 60}
subcomponents:
cabin:
classname: Cabin
kwargs: {invert: true}
parameters:
depth: {parameter: depth}
height: {parameter: height}
length: {parameter: length}
width: {parameter: width}
port:
classname: BoatBase
kwargs: {}
parameters:
bow: {function: x/2., parameter: length}
depth:
function: sum(x)/20.
parameter: [length, depth]
length:
function: sum(x)
parameter: [length, depth]
stern: {function: x/8., parameter: length}
width:
function: sum(x)/10.
parameter: [length, depth]
star:
classname: BoatBase
kwargs: {}
parameters:
bow: {function: x/2., parameter: length}
depth:
function: sum(x)/20.
parameter: [length, depth]
length:
function: sum(x)
parameter: [length, depth]
stern: {function: x/8., parameter: length}
width:
function: sum(x)/10.
parameter: [length, depth]
connections:
connection0:
- [portsplit0, botedge0]
- [boat0, portedge]
- {angle: -90}
connection1:
- [starsplit0, topedge0]
- [boat0, staredge]
- {angle: -90}
connection10:
- [starsplit1, botedge2]
- [seat2, l]
- {}
connection11:
- [portsplit2, topedge2]
- [seat2, r]
- {}
connection12:
- [starsplit0, botedge3]
- [seat3, l]
- {}
connection13:
- [portsplit1, topedge3]
- [seat3, r]
- {}
connection14:
- [starsplit1, botedge4]
- [seat4, l]
- {}
connection15:
- [portsplit2, topedge4]
- [seat4, r]
- {}
connection16:
- [starsplit0, botedge5]
- [seat5, l]
- {}
connection17:
- [portsplit1, topedge5]
- [seat5, r]
- {}
connection18:
- [starsplit1, botedge6]
- [seat6, l]
- {}
connection19:
- [portsplit2, topedge6]
- [seat6, r]
- {}
connection2:
- [portsplit1, botedge0]
- [boat1, portedge]
- {angle: -90}
connection20:
- [starsplit0, botedge7]
- [seat7, l]
- {}
connection21:
- [portsplit1, topedge7]
- [seat7, r]
- {}
connection22:
- [starsplit1, botedge8]
- [seat8, l]
- {}
connection23:
- [portsplit2, topedge8]
- [seat8, r]
- {}
connection24:
- [starsplit0, botedge9]
- [seat9, l]
- {}
connection25:
- [portsplit1, topedge9]
- [seat9, r]
- {}
connection3:
- [starsplit1, topedge0]
- [boat1, staredge]
- {angle: -90}
connection4:
- [portsplit2, botedge0]
- [boat2, portedge]
- {angle: -90}
connection5:
- [starsplit2, topedge0]
- [boat2, staredge]
- {angle: -90}
connection6:
- [starsplit1, botedge0]
- [seat0, l]
- {}
connection7:
- [portsplit2, topedge0]
- [seat0, r]
- {}
connection8:
- [starsplit0, botedge1]
- [seat1, l]
- {}
connection9:
- [portsplit1, topedge1]
- [seat1, r]
- {}
interfaces: {}
metadata:
bow: {default: 45}
depth: {default: 20}
length: {default: 250}
n: {default: 6}
spacing: {default: 25}
stern: {default: 0}
width: {default: 50}
parameters: {bow: 45, depth: 20, length: 250, n: 6, spacing: 25, stern: 0, width: 50}
subcomponents:
boat0:
classname: BoatBase
kwargs: {}
parameters:
bow: {parameter: bow}
depth: {parameter: depth}
length: {parameter: length}
stern: {parameter: stern}
width: {parameter: width}
boat1:
classname: BoatBase
kwargs: {}
parameters:
bow: {parameter: bow}
depth: {parameter: depth}
length: {parameter: length}
stern: {parameter: stern}
width: {parameter: width}
boat2:
classname: BoatBase
kwargs: {}
parameters:
bow: {parameter: bow}
depth: {parameter: depth}
length: {parameter: length}
stern: {parameter: stern}
width: {parameter: width}
portsplit0:
classname: SplitEdge
kwargs: {}
parameters:
botlength:
function: '[x[0]]'
parameter: &id001 [length, n]
toplength:
function: '[x[0]/(1.*x[1])] * x[1]'
parameter: &id002 [length, n]
portsplit1:
classname: SplitEdge
kwargs: {}
parameters:
botlength:
function: '[x[0]]'
parameter: *id001
toplength:
function: '[x[0]/(1.*x[1])] * x[1]'
parameter: *id002
portsplit2:
classname: SplitEdge
kwargs: {}
parameters:
botlength:
function: '[x[0]]'
parameter: *id001
toplength:
function: '[x[0]/(1.*x[1])] * x[1]'
parameter: *id002
seat0:
classname: Rectangle
kwargs: {}
parameters:
l:
function: (0 < x[1]) and x[0] or 0
parameter: &id003 [spacing, n]
w:
function: x[0]/(1.*x[1])
parameter: &id004 [length, n]
seat1:
classname: Rectangle
kwargs: {}
parameters:
l:
function: (1 < x[1]) and x[0] or 0
parameter: *id003
w:
function: x[0]/(1.*x[1])
parameter: *id004
seat2:
classname: Rectangle
kwargs: {}
parameters:
l:
function: (2 < x[1]) and x[0] or 0
parameter: *id003
w:
function: x[0]/(1.*x[1])
parameter: *id004
seat3:
classname: Rectangle
kwargs: {}
parameters:
l:
function: (3 < x[1]) and x[0] or 0
parameter: *id003
w:
function: x[0]/(1.*x[1])
parameter: *id004
seat4:
classname: Rectangle
kwargs: {}
parameters:
l:
function: (4 < x[1]) and x[0] or 0
parameter: *id003
w:
function: x[0]/(1.*x[1])
parameter: *id004
seat5:
classname: Rectangle
kwargs: {}
parameters:
l:
function: (5 < x[1]) and x[0] or 0
parameter: *id003
w:
function: x[0]/(1.*x[1])
parameter: *id004
seat6:
classname: Rectangle
kwargs: {}
parameters:
l:
function: (6 < x[1]) and x[0] or 0
parameter: *id003
w:
function: x[0]/(1.*x[1])
parameter: *id004
seat7:
classname: Rectangle
kwargs: {}
parameters:
l:
function: (7 < x[1]) and x[0] or 0
parameter: *id003
w:
function: x[0]/(1.*x[1])
parameter: *id004
seat8:
classname: Rectangle
kwargs: {}
parameters:
l:
function: (8 < x[1]) and x[0] or 0
parameter: *id003
w:
function: x[0]/(1.*x[1])
parameter: *id004
seat9:
classname: Rectangle
kwargs: {}
parameters:
l:
function: (9 < x[1]) and x[0] or 0
parameter: *id003
w:
function: x[0]/(1.*x[1])
parameter: *id004
starsplit0:
classname: SplitEdge
kwargs: {}
parameters:
botlength:
function: '[x[0]/(1.*x[1])] * x[1]'
parameter: &id005 [length, n]
toplength:
function: '[x[0]]'
parameter: &id006 [length, n]
starsplit1:
classname: SplitEdge
kwargs: {}
parameters:
botlength:
function: '[x[0]/(1.*x[1])] * x[1]'
parameter: *id005
toplength:
function: '[x[0]]'
parameter: *id006
starsplit2:
classname: SplitEdge
kwargs: {}
parameters:
botlength:
function: '[x[0]/(1.*x[1])] * x[1]'
parameter: *id005
toplength:
function: '[x[0]]'
parameter: *id006
connections:
connection0:
- [cabin, portedge]
- [boat, portedge]
- {angle: 0}
connection1:
- [cabin, staredge]
- [boat, staredge]
- {angle: 0, tabWidth: 10}
interfaces: {}
metadata:
depth: {default: 50}
height: {default: 30}
length: {default: 200}
width: {default: 60}
parameters: {depth: 50, height: 30, length: 200, width: 60}
subcomponents:
boat:
classname: BoatBase
kwargs: {}
parameters:
bow: {function: x/2., parameter: length}
depth: {function: x/3., parameter: width}
length:
function: sum(x)
parameter: [length, depth]
stern: {function: x/8., parameter: length}
width: {parameter: width}
cabin:
classname: Cabin
kwargs: {}
parameters:
depth: {parameter: depth}
height: {parameter: height}
length: {parameter: length}
width: {parameter: width}
from svggen.library import getComponent
def test_make(display=False):
f = getComponent("Cabin")
f.makeOutput("output/cabin", tree=True, display=display)
if __name__ == '__main__':
test_make(display=False)
from svggen.library import getComponent
def test_make(display=False):
f = getComponent("Canoe")
f.makeOutput("output/canoe", tree=True, display=display)
if __name__ == '__main__':
test_make(display=False)
from svggen.library import getComponent
def test_make(display=False):
f = getComponent("Catamaran")
f.makeOutput("output/catamaran", tree=True, display=display)
if __name__ == '__main__':
test_make(display=False)
from svggen.library import getComponent
def test_make(display=False):
f = getComponent("Trimaran")
f.makeOutput("output/trimaran", tree=True, display=display)
if __name__ == '__main__':
test_make(display=False)
from svggen.library import getComponent
def test_make(display=False):
f = getComponent("Tug")
f.makeOutput("output/tug", tree=True, display=display)
if __name__ == '__main__':
test_make(display=False)
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