コード例 #1
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")
コード例 #2
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")
コード例 #3
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")