Skip to content
Snippets Groups Projects
Commit 52274905 authored by pjil27's avatar pjil27
Browse files

Boat files: BoatWithMount.yaml updated and DCHolderBoat.py added

parent 3bbc9d50
Branches
No related merge requests found
......@@ -39,9 +39,9 @@ c.addConnection(("boat", "portedge"), ("split1", "topedge0"))
c.addConnection(("mount0", "beam.botedge2"), ("split0", "botedge4"), angle=-180)
c.addConnection(("mount1", "beam.botedge2"), ("split1", "botedge5"), angle=-180)
c.addConnection(("rect0", "l"), ("split0", "botedge6"), angle=-180, tabWidth=8)
c.addConnection(("rect0", "l"), ("split0", "botedge6"), tabWidth=8)
c.addConnection(("rect0", "r"), ("mount2", "beam.botedge2"), angle=-90)
c.addConnection(("rect1", "r"), ("mount2", "beam.topedge2"), angle=-90)
c.addConnection(("rect1", "l"), ("split1", "botedge3"), angle=-180, tabWidth=8)
c.addConnection(("rect1", "l"), ("split1", "botedge3"), tabWidth=8)
c.toLibrary("BoatWithMount")
\ No newline at end of file
......@@ -28,8 +28,7 @@ connections:
- l
- - split0
- botedge6
- angle: -180
tabWidth: 8
- tabWidth: 8
connection5:
- - rect0
- r
......@@ -47,8 +46,7 @@ connections:
- l
- - split1
- botedge3
- angle: -180
tabWidth: 8
- tabWidth: 8
interfaces: {}
parameters:
depth:
......
from rocolib.api.components import FoldedComponent
from rocolib.api.composables.graph.Face import RegularNGon2
from rocolib.api.composables.graph.Face import Rectangle
class Tire(FoldedComponent):
def define(self):
self.addParameter("n", 6, valueType="int")
self.addParameter("radius", 25, paramType="length")
self.addParameter("twidth", 50, paramType="length")
self.addParameter("slength", 25, paramType="length")
#calculation for slength: float(2 * r * np.cos(np.deg2rad(60)))
#Slength is the side of the rectangle that will attach to the edge of the nonagon
self.addFaceInterface("face0", "f0")
#Hardcoded 9 edge interfaces
for i in range(6):
try:
self.setEdgeInterface("e%d" % i, "e%d" % i, "radius")
except KeyError:
self.addEdgeInterface("e%d" % i, "e%d" % i, "radius")
def assemble(self):
n = self.getParameter("n")
r = self.getParameter("radius")
tw = self.getParameter("twidth")
sl = self.getParameter("slength")
hexagon = RegularNGon2("", n, r)
support = []
for i in range(2):
support.append(Rectangle("r%d" %i, tw, sl))
fromEdge = None
self.attachEdge(fromEdge, support[0], "e2", prefix="r0")
self.attachEdge(fromEdge, support[1], "e2", prefix="r1")
self.attachEdge("r0.e1", hexagon, "e0", prefix="hex")
self.mergeEdge("r1.e1", "hex.e2")
if __name__ == "__main__":
Tire.test()
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