Beispiel #1
0
    def render(self):
        x, y, h = self.x, self.y, self.h
        t = self.thickness


        t1, t2, t3, t4 = self.topEdges(self.top_edge)
        b = self.edges.get(self.bottom_edge, self.edges["F"])

        d2 = Bolts(2)
        d3 = Bolts(3)

        d2 = d3 = None


        with self.saved_context():
            self.rectangularWall(x, h, [b, "F", t1, "F"],
                                 bedBolts=[d2], move="up")
            self.rectangularWall(x, h, [b, "F", t3, "F"],
                                 bedBolts=[d2], move="up")

            if self.bottom_edge != "e":
                self.rectangularWall(x, y, "ffff", bedBolts=[d2, d3, d2, d3], move="up")
            if self.top_edge in "fF":
                self.set_source_color(Color.RED)
                self.rectangularWall(x+4*t, y+4*t, callback=[
                    lambda:self.top_hole(x, y, self.top_edge)], move="up")
                self.set_source_color(Color.BLACK)
            self.drawAddOnLid(x, y, self.lid)

        self.rectangularWall(x, h, [b, "F", t3, "F"],
                             bedBolts=[d2], move="right only")
        self.rectangularWall(y, h, [b, "f", t2, "f"],
                             bedBolts=[d3], move="up")
        self.rectangularWall(y, h, [b, "f", t4, "f"],
                             bedBolts=[d3], move="up")
Beispiel #2
0
    def render(self):
        x, y, h = self.x, self.y, self.h
        t = self.thickness

        self.open()

        t1, t2, t3, t4 = self.topEdges(self.top_edge)
        b = self.edges.get(self.bottom_edge, self.edges["F"])

        d2 = Bolts(2)
        d3 = Bolts(3)

        d2 = d3 = None

        self.rectangularWall(y,
                             h, [b, "f", t2, "f"],
                             bedBolts=[d3],
                             move="right")
        self.rectangularWall(x, h, [b, "F", t1, "F"], bedBolts=[d2], move="up")
        self.rectangularWall(x, h, [b, "F", t3, "F"], bedBolts=[d2])
        self.rectangularWall(y,
                             h, [b, "f", t4, "f"],
                             bedBolts=[d3],
                             move="left")
        self.rectangularWall(x,
                             h, [b, "F", t3, "F"],
                             bedBolts=[d2],
                             move="up only")

        if self.bottom_edge != "e":
            self.rectangularWall(x,
                                 y,
                                 "ffff",
                                 bedBolts=[d2, d3, d2, d3],
                                 move="right")
        if (self.drawLid(x, y, self.top_edge, [d2, d3])
                and self.bottom_edge != "e"):
            self.rectangularWall(x, y, "ffff", move="left only")
        if self.top_edge in "fF":
            self.ctx.set_source_rgb(1., 0, 0)
            self.rectangularWall(
                x + 4 * t,
                y + 4 * t,
                callback=[lambda: self.top_hole(x, y, self.top_edge)],
                move="right")
            self.ctx.set_source_rgb(0, 0, 0)
        self.drawAddOnLid(x, y, self.lid)

        self.close()
Beispiel #3
0
    def render(self):
        x, y, h = self.x, self.y, self.h

        self.open()

        t1, t2, t3, t4 = self.topEdges(self.top_edge)
        b = self.edges.get(self.bottom_edge, self.edges["F"])

        d2 = Bolts(2)
        d3 = Bolts(3)

        d2 = d3 = None

        self.rectangularWall(y,
                             h, [b, "f", t2, "f"],
                             bedBolts=[d3],
                             move="right")
        self.rectangularWall(x, h, [b, "F", t1, "F"], bedBolts=[d2], move="up")
        self.rectangularWall(x, h, [b, "F", t3, "F"], bedBolts=[d2])
        self.rectangularWall(y,
                             h, [b, "f", t4, "f"],
                             bedBolts=[d3],
                             move="left")
        self.rectangularWall(x,
                             h, [b, "F", t3, "F"],
                             bedBolts=[d2],
                             move="up only")

        self.rectangularWall(x,
                             y,
                             "ffff",
                             bedBolts=[d2, d3, d2, d3],
                             move="right")
        if self.drawLid(x, y, self.top_edge, [d2, d3]):
            self.rectangularWall(x, y, "ffff", move="left only")
        self.drawAddOnLid(x, y, self.lid)

        self.close()
Beispiel #4
0
    def render(self):
        x, y, h = self.x, self.y, self.h

        self.open()
        # generate g,G finger joints with default settings
        s = edges.FingerJointSettings(self.thickness)
        g = edges.FingerJointEdge(self, s)
        g.char = 'a'
        self.addPart(g)
        G = edges.FingerJointEdgeCounterPart(self, s)
        G.char = 'A'
        self.addPart(G)

        b = self.edges.get(self.bottom_edge, self.edges["F"])
        t1 = t2 = t3 = t4 = self.edges.get(self.top_edge, self.edges["e"])

        if t1.char == "i":
            t2 = t4 = "e"
            t3 = "j"
        elif t1.char == "k":
            t2 = t4 = "e"
        elif t1.char == "L":
            t1 = "M"
            t2 = "e"
            t3 = "N"
        elif t1.char == "v":
            t2 = t3 = t4 = "e"

        self.edges["k"].settings.setValues(self.thickness, outset=True)

        d2 = Bolts(2)
        d3 = Bolts(3)

        d2 = d3 = None

        self.rectangularWall(y, h, [b, "f", t2, "f"],
                             bedBolts=[d3], move="right")
        self.rectangularWall(x, h, [b, "F", t1, "F"],
                             bedBolts=[d2], move="up")
        self.rectangularWall(x, h, [b, "F", t3, "F"],
                             bedBolts=[d2])
        self.rectangularWall(y, h, [b, "f", t4, "f"],
                             bedBolts=[d3], move="left")
        self.rectangularWall(x, h, [b, "F", t3, "F"],
                             bedBolts=[d2], move="up only")
        
        self.rectangularWall(x, y, "ffff", bedBolts=[d2, d3, d2, d3], move="right")

        if self.top_edge == "c":
            self.rectangularWall(x, y, "CCCC", bedBolts=[d2, d3, d2, d3], move="up")
        elif self.top_edge == "f":
            self.rectangularWall(x, y, "FFFF", move="up")
        elif self.top_edge == "L":
            self.rectangularWall(x, y, "nlmE", move="up")
        elif self.top_edge == "i":
            self.rectangularWall(x, y, "IEJe", move="up")
        elif self.top_edge == "k":
            lx = x/2.0-0.1*self.thickness
            self.edges['k'].settings.setValues(self.thickness, grip_length=5)
            self.rectangularWall(lx, y, "IeJe", move="right")
            self.rectangularWall(lx, y, "IeJe", move="up")
        elif self.top_edge == "v":
            self.rectangularWall(x, y, "VEEE", move="up")
            self.rectangularWall(x, y, "VEEE", move="left only")
            self.edges["v"].parts()
        else:
            self.rectangularWall(x, y, "CCCC", bedBolts=[d2, d3, d2, d3], move="up only")
            
        if self.lid == "flat":
            self.rectangularWall(x, y, "eeee")
            self.rectangularWall(x, y, "EEEE", move="left")
        elif self.lid == "chest":
            self.side()
            self.side(move="left up")
            self.top()

        self.close()