Ejemplo n.º 1
0
    # model = Model()
    # model.append(Triangle(Point(0,0,0),Point(0,5,4),Point(0,-5,4)))
    # model.append(Triangle(Point(2,0,0),Point(2,-5,4),Point(2,5,4)))

    if True:
        lines = 20
        layers = 4
        x0 = -7.0
        x1 = +7.0
        y0 = -7.0
        y1 = +7.0
        z0 = 2.0
        z1 = 4.0
        pc = PushCutter(c, model, SimpleCutter())
        # pc = PushCutter(c, model, ZigZagCutter())
        # pc = PushCutter(c, model, PolygonCutter())

        dx = 0
        if lines > 1:
            dy = float(y1 - y0) / (lines - 1)
        else:
            dy = INFINITE
        if layers > 1:
            dz = float(z1 - z0) / (layers - 1)
        else:
            dz = INFINITE

        pathlist = pc.GenerateToolPath(x0, x1, y0, y1, z0, z1, dx, dy, dz)
        c.moveto(Point(x0, y0, z0))
        ShowTestScene(model, c, pathlist)
Ejemplo n.º 2
0
        print "cl=", cl

    if False:
        samples = 50
        x0 = -5.0
        x1 = +5.0
        y0 = -5.0
        y1 = +5.0
        z = 10
        pathlist = []
        for i in range(0, samples):
            x = x0 + i * ((x1 - x0) / samples)
            p = Path()
            for j in range(0, samples):
                y = y0 + j * ((y1 - y0) / samples)
                c.moveto(Point(x, y, z))
                cl = c.drop(t)
                if cl:
                    p.append(cl)
                else:
                    p.append(Point(x, y, 0))
            pathlist.append(p)
        c.moveto(Point(x0, y0, z))
        ShowTestScene(t, c, pathlist)

    if True:
        samples = 50
        layers = 10
        x0 = -5.0
        x1 = +5.0
        y0 = -3.0
Ejemplo n.º 3
0
        print "cl=", cl

    if False:
        samples = 50
        x0 = -5.0
        x1 = +5.0
        y0 = -5.0
        y1 = +5.0
        z = 10
        pathlist = []
        for i in range(0,samples):
            x = x0 + i * ((x1-x0) / samples)
            p = Path()
            for j in range(0,samples):
                y = y0 + j * ((y1-y0) / samples)
                c.moveto(Point(x,y,z))
                cl = c.drop(t)
                if cl:
                    p.append(cl)
                else:
                    p.append(Point(x,y,0))
            pathlist.append(p)
        c.moveto(Point(x0,y0,z))
        ShowTestScene(t, c, pathlist)

    if True:
        samples = 50
        layers = 10
        x0 = -5.0
        x1 = +5.0
        y0 = -3.0
Ejemplo n.º 4
0
    #model = Model()
    #model.append(Triangle(Point(0,0,0),Point(0,5,4),Point(0,-5,4)))
    #model.append(Triangle(Point(2,0,0),Point(2,-5,4),Point(2,5,4)))

    if True:
        lines = 20
        layers = 4
        x0 = -7.0
        x1 = +7.0
        y0 = -7.0
        y1 = +7.0
        z0 = 2.0
        z1 = 4.0
        pc = PushCutter(c, model, SimpleCutter())
        #pc = PushCutter(c, model, ZigZagCutter())
        #pc = PushCutter(c, model, PolygonCutter())

        dx = 0
        if lines > 1:
            dy = float(y1 - y0) / (lines - 1)
        else:
            dy = INFINITE
        if layers > 1:
            dz = float(z1 - z0) / (layers - 1)
        else:
            dz = INFINITE

        pathlist = pc.GenerateToolPath(x0, x1, y0, y1, z0, z1, dx, dy, dz)
        c.moveto(Point(x0, y0, z0))
        ShowTestScene(model, c, pathlist)