Skip to content

Commit 23a17b9

Browse files
committed
Switched back to simple line counting as an approximation of STL output quality
1 parent 12eca80 commit 23a17b9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/test_stl_codec.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ def test_stl_codec_quality():
1818
"""
1919
test_file = helpers.get_test_file_location("sphere.py")
2020

21-
command = ["python", "cq-cli.py", "--codec", "stl", "--infile", test_file, "--outfile", "/tmp/high.stl"]
21+
command = ["python", "cq-cli.py", "--codec", "stl", "--infile", test_file]
2222
out, err, exitcode = helpers.cli_call(command)
2323

2424
# Keep track of the number of lines for each STL as an approximate measure of quality
25-
high_detail = os.path.getsize("/tmp/high.stl")
25+
high_detail = len(out.decode().split('\n'))
2626

2727
# Attempt to adjust the quality of the resulting STL
28-
command2 = ["python", "cq-cli.py", "--codec", "stl", "--infile", test_file, "--outfile", "/tmp/low.stl", "--outputopts", "linearDeflection:0.3;angularDeflection:0.3"]
28+
command2 = ["python", "cq-cli.py", "--codec", "stl", "--infile", test_file, "--outputopts", "linearDeflection:0.3;angularDeflection:0.3"]
2929
out2, err2, exitcode2 = helpers.cli_call(command2)
3030

3131
# Keep track of the number of lines in the STL as an approximate measure of quality
32-
low_detail = os.path.getsize("/tmp/low.stl")
32+
low_detail = len(out2.decode().split('\n'))
3333

3434
assert low_detail < high_detail

0 commit comments

Comments
 (0)