Beispiel #1
0
def test_precision():
    """makes sure that gcode are equals if the numeric values are similar enough
    and different is the numeric values are far enough"""
    gcode_eq(open_gcode_file('simple1.gcode'),
             open_gcode_file('simple1_equivalent.gcode'))
    assert_not_equal(open_gcode_file('simple1.gcode'),
                     open_gcode_file('simple1_slightly_different.gcode'))
Beispiel #2
0
def test_nop_move():
    gcode = open_gcode_file('simple1.gcode')
    gcode_oracle = open_gcode_file('simple1.gcode')

    GCodeXYTranslateFilter(x=0, y=0).filter(gcode)

    gcode_eq(gcode_oracle, gcode)
Beispiel #3
0
def test_skeinforge_formatted_stretch():
    gcode_oracle = open_gcode_file('skeinforge_model1_poststretch.gcode')
    gcode = open_gcode_file('skeinforge_model1_prestretch.gcode')

    SkeinforgeStretchFilter().filter(gcode)

    gcode_eq(gcode_oracle, gcode)
Beispiel #4
0
def test_nop_relative_extrusion():
    gcode = open_gcode_file('simple1.gcode')
    gcode_oracle = open_gcode_file('simple1.gcode')

    GCodeToRelativeExtrusionFilter().filter(gcode)

    gcode_eq(gcode_oracle, gcode)
Beispiel #5
0
def test_trivial_relative_extrusion():
    gcode = open_gcode_file('simple3.gcode')
    gcode_oracle = open_gcode_file('simple3-relative.gcode')

    GCodeToRelativeExtrusionFilter().filter(gcode)

    gcode_eq(gcode_oracle, gcode)
Beispiel #6
0
def test_trivial_move():
    gcode = open_gcode_file('simple1.gcode')
    gcode_oracle = open_gcode_file('simple2.gcode')

    GCodeXYTranslateFilter(x=1, y=2).filter(gcode)

    gcode_eq(gcode_oracle, gcode)
Beispiel #7
0
def test_identity_equality():
    gcode_eq(open_gcode_file('simple1.gcode'),
             open_gcode_file('simple1.gcode'))
Beispiel #8
0
def test_ignore_non_command():
    gcode_eq(open_gcode_file('empty_for_good.gcode'),
             open_gcode_file('empty_skeinforge_format.gcode'))
def test_arc_optimization_4():
    gcode = open_gcode_file('arc_raw_4.gcode')
    gcode_ref = open_gcode_file('arc_ref_4.gcode')
    logging.basicConfig(level=logging.DEBUG)
    GCodeArcOptimizerFilter().filter(gcode)
    gcode_eq(gcode_ref, gcode)
def test_arc_optimization_4():
    gcode = open_gcode_file('arc_raw_4.gcode')
    gcode_ref = open_gcode_file('arc_ref_4.gcode')
    logging.basicConfig(level=logging.DEBUG)
    GCodeArcOptimizerFilter().filter(gcode)
    gcode_eq(gcode_ref, gcode)
Beispiel #11
0
def test_identity_equality():
    gcode_eq(open_gcode_file('simple1.gcode'), open_gcode_file('simple1.gcode'))
Beispiel #12
0
def test_precision():
    """makes sure that gcode are equals if the numeric values are similar enough
    and different is the numeric values are far enough"""
    gcode_eq(open_gcode_file('simple1.gcode'), open_gcode_file('simple1_equivalent.gcode'))
    assert_not_equal(open_gcode_file('simple1.gcode'), open_gcode_file('simple1_slightly_different.gcode'))
Beispiel #13
0
def test_ignore_non_command():
    gcode_eq(open_gcode_file('empty_for_good.gcode'), open_gcode_file('empty_skeinforge_format.gcode'))