diff --git a/rocolib/builders/BoatWithMountBuilder.py b/rocolib/builders/BoatWithMountBuilder.py index 7c4a0204213888edb34cd7e0a8e64db285dcccc6..29dec83584dcb2a5778d01bb9209ab6f09266f03 100644 --- a/rocolib/builders/BoatWithMountBuilder.py +++ b/rocolib/builders/BoatWithMountBuilder.py @@ -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 diff --git a/rocolib/library/BoatWithMount.yaml b/rocolib/library/BoatWithMount.yaml index 250214fc6eedf1797692ee25a6c779f42d0664a0..df03a9aca4140b57d1a66aaf02f4c0d426ca5553 100644 --- a/rocolib/library/BoatWithMount.yaml +++ b/rocolib/library/BoatWithMount.yaml @@ -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: diff --git a/rocolib/library/DCHolderBoat.py b/rocolib/library/DCHolderBoat.py new file mode 100644 index 0000000000000000000000000000000000000000..bef592ec70bdf309a53269431b47ee16381cfdf4 --- /dev/null +++ b/rocolib/library/DCHolderBoat.py @@ -0,0 +1,42 @@ +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()