示例#1
0
文件: sgg_tests.py 项目: gntech/pycnc
def test_dds_panel():
    t = Tool(diameter=3.125, stepover=0.85, stepdown=0.9, feed=325, safety_z=10)
    operations = []
    operations.append(pocket_rectangle(x=0, y=-2, z0=0, z1=-4, a=86, b=46, theta=0, dogbone=False, tool=t))
    operations.append(pocket_rectangle(x=0, y=0, z0=-4, z1=-10, a=70, b=30.75, theta=0, dogbone=False, tool=t))
    operations.append(pocket_rectangle(x=0, y=0, z0=-10, z1=-13.5, a=64, b=16, theta=0, dogbone=False, tool=t))
    gcode_writer(operations, t, "tests/output/dds-panel.nc")
示例#2
0
文件: sgg_tests.py 项目: gntech/pycnc
def test_pocket_circle():
    t = Tool(diameter=3.125, stepover=0.8, stepdown=1.5, feed=275, safety_z=20)
    operations = []
    operations.append(pocket_circle(x=0, y=0, z0=0, z1=-2, d=19, tool=t))
    operations.append(pocket_circle(x=0, y=0, z0=-2, z1=-11, d=8, tool=t))
    gcode_writer(operations, t, "tests/output/work-table-1x_test.nc")
    operations = []
    for x in [0.0, 72.5, 145.0, 217.5, 290.0]:
        for y in [0, 90, 180, 270, 360, 450, 540]:
            operations.append(pocket_circle(x=x, y=y, z0=0, z1=-2, d=19, tool=t))
            operations.append(pocket_circle(x=x, y=y, z0=-2, z1=-22, d=8, tool=t))

    gcode_writer(operations, t, "tests/output/work-table-35x.nc")
示例#3
0
文件: sgg_tests.py 项目: gntech/pycnc
def test_engrave_numbers():
    t = Tool(diameter=3.125, stepover=0.8, stepdown=0.5, feed=250, safety_z=20)
    operations = []
    operations += engrave_num(num=235, x=0, y=0, theta=0, height=20, \
                              space=15.5, tool=t)
    operations += engrave_num(num=18, x=0, y=20, theta=0, height=20, \
                              space=10, tool=t)
    operations += engrave_num(num=9, x=0, y=-20, theta=0, height=20, \
                              space=10, tool=t)
    operations += engrave_num(num=235, x=500, y=1000, theta=10, height=20, \
                              space=10, tool=t)
    operations += engrave_num(num=9, x=0, y=0, theta=0, height=20, \
                              space=10, tool=t)
    operations += engrave_num(num=9, x=100, y=0, theta=0, height=20, \
                              space=10, tool=t)
    operations += engrave_num(num=9, x=-100, y=0, theta=0, height=20, \
                              space=10, tool=t)
    gcode_writer(operations, t, "tests/output/eng_num_test.nc")
    pil_visualizer(operations, "tests/output/eng_num_test.png")
示例#4
0
文件: sgg_tests.py 项目: gntech/pycnc
def test_table_chairs():
    t = Tool(diameter=3.125, stepover=0.8, stepdown=2, feed=250, safety_z=5)
    table_ops = []
    chair_ops = []
    numbering_ops = []

    z0 = 0
    z1 = -1
    a = 120
    b = 60
    r = 70
    text = dict()
    text["height"] = 25.0
    text["space"] = 20.0
    f = 7.0

    for x in [0]:
        for y in [0]:
            table_ops += table(x=x, y=y, a=a, b=b, z0=z0, z1=z1, theta=-20, tool=t)
            chair_ops += chairs(x=x, y=y, a=a, b=b, r=r, z0=z0, z1=z1, theta=-20, tool=t, chairs_pos=[0,1,2,3])
            numbering_ops += numbering(x=x, y=y, a=a/2, b=b*2+f, theta=-20, z0=z0, z1=z1, text=text, tool=t, chairs_pos=[0,1,2,3], chair_numbers=range(58, 62))

    scaled_operations(table_ops, 0.625)
    scaled_operations(chair_ops, 0.625)
    scaled_operations(numbering_ops, 0.625)

    all_ops = table_ops + chair_ops + numbering_ops

    gcode_writer(table_ops, t, "tests/output/single_table.nc")
    gcode_writer(chair_ops, t, "tests/output/single_chair.nc")
    gcode_writer(numbering_ops, t, "tests/output/single_numbers.nc")
    gcode_writer(all_ops, t, "tests/output/single_placement_board.nc")
    print("Visualizing")
    pil_visualizer(table_ops, "tests/output/single_table.png")
    pil_visualizer(chair_ops, "tests/output/single_chair.png")
    pil_visualizer(numbering_ops, "tests/output/single_numbers.png")
    pil_visualizer(all_ops, "tests/output/single_placement_board.png")
示例#5
0
文件: sgg_tests.py 项目: gntech/pycnc
def test_engrave_ncfile():
    t = Tool(diameter=3.125, stepover=0.8, stepdown=2, feed=250, safety_z=5)
    logo = gcode_reader(filename="tests/input/gntech.nc")
    operations = [profile_arb(profile=logo, z0=0, z1=-1, x=0, y=0, theta=0, scale=300, tool=t)]
    gcode_writer(operations, t, "tests/output/logo.nc")
    pil_visualizer(operations, "tests/output/logo.png")