Skip to content

Commit 482caee

Browse files
committed
corrections in test_screw_thread.py, cosmetics in other tests
1 parent 55e896c commit 482caee

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

‎solid/test/test_screw_thread.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_thread( self):
1616
actual_obj = thread( outline_pts=outline, inner_rad=20, pitch=2*tooth_height, length=2*tooth_height, segments_per_rot=4,
1717
neck_in_degrees=0, neck_out_degrees=0)
1818
actual = scad_render( actual_obj)
19-
expected = '\n\nrender() {\n\tdifference() {\n\t\tpolyhedron(points = [[20.0000000000, 0.0000000000, -5.0000000000], [25.0000000000, 0.0000000000, 0.0000000000], [20.0000000000, 0.0000000000, 5.0000000000], [0.0000000000, 20.0000000000, 0.0000000000], [0.0000000000, 25.0000000000, 5.0000000000], [0.0000000000, 20.0000000000, 10.0000000000], [-20.0000000000, 0.0000000000, 5.0000000000], [-25.0000000000, 0.0000000000, 10.0000000000], [-20.0000000000, 0.0000000000, 15.0000000000], [-0.0000000000, -20.0000000000, 10.0000000000], [-0.0000000000, -25.0000000000, 15.0000000000], [-0.0000000000, -20.0000000000, 20.0000000000]], triangles = [[0, 3, 1], [1, 3, 4], [1, 4, 2], [2, 4, 5], [2, 5, 0], [0, 5, 3], [3, 6, 4], [4, 6, 7], [4, 7, 5], [5, 7, 8], [5, 8, 3], [3, 8, 6], [6, 9, 7], [7, 9, 10], [7, 10, 8], [8, 10, 11], [8, 11, 6], [6, 11, 9], [0, 1, 2], [9, 11, 10]]);\n\t\tunion() {\n\t\t\tcylinder(h = 20, r = 20);\n\t\t\ttranslate(v = [0, 0, -25.0000001000]) {\n\t\t\t\tcube(center = true, size = 50.0000002000);\n\t\t\t}\n\t\t\ttranslate(v = [0, 0, 45.0000001000]) {\n\t\t\t\tcube(center = true, size = 50.0000002000);\n\t\t\t}\n\t\t}\n\t}\n}'
19+
expected = '\n\nrender() {\n\tdifference() {\n\t\tpolyhedron(points = [[20.0000000000, 0.0000000000, -5.0000000000], [25.0000000000, 0.0000000000, 0.0000000000], [20.0000000000, 0.0000000000, 5.0000000000], [0.0000000000, 20.0000000000, 0.0000000000], [0.0000000000, 25.0000000000, 5.0000000000], [0.0000000000, 20.0000000000, 10.0000000000], [-20.0000000000, 0.0000000000, 5.0000000000], [-25.0000000000, 0.0000000000, 10.0000000000], [-20.0000000000, 0.0000000000, 15.0000000000], [-0.0000000000, -20.0000000000, 10.0000000000], [-0.0000000000, -25.0000000000, 15.0000000000], [-0.0000000000, -20.0000000000, 20.0000000000]], triangles = [[0, 1, 3], [1, 4, 3], [1, 2, 4], [2, 5, 4], [0, 5, 2], [0, 3, 5], [3, 4, 6], [4, 7, 6], [4, 5, 7], [5, 8, 7], [3, 8, 5], [3, 6, 8], [6, 7, 9], [7, 10, 9], [7, 8, 10], [8, 11, 10], [6, 11, 8], [6, 9, 11], [0, 2, 1], [9, 10, 11]]);\n\t\tunion() {\n\t\t\ttranslate(v = [0, 0, -5]) {\n\t\t\t\tcylinder(h = 30, r = 20);\n\t\t\t}\n\t\t\ttranslate(v = [0, 0, -25]) {\n\t\t\t\tcube(center = true, size = 50);\n\t\t\t}\n\t\t\ttranslate(v = [0, 0, 45]) {\n\t\t\t\tcube(center = true, size = 50);\n\t\t\t}\n\t\t}\n\t}\n}'
2020
self.assertEqual( expected, actual)
2121

2222
def test_default_thread_section( self):

‎solid/test/test_utils.py‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@
2424
]
2525

2626
other_test_cases = [
27-
( euclidify, [[0,0,0]], 'Vector3(0.00, 0.00, 0.00)'),
28-
( 'euclidify_recursive', euclidify, [[[0,0,0], [1,0,0]]], '[Vector3(0.00, 0.00, 0.00), Vector3(1.00, 0.00, 0.00)]'),
29-
( 'euclidify_Vector', euclidify, [Vector3(0,0,0)], 'Vector3(0.00, 0.00, 0.00)'),
30-
( 'euclidify_recursive_Vector', euclidify, [[Vector3( 0,0,0), Vector3( 0,0,1)]], '[Vector3(0.00, 0.00, 0.00), Vector3(0.00, 0.00, 1.00)]'),
31-
( euc_to_arr, [Vector3(0,0,0)], '[0, 0, 0]'),
32-
( 'euc_to_arr_recursive', euc_to_arr, [[Vector3( 0,0,0), Vector3( 0,0,1)]], '[[0, 0, 0], [0, 0, 1]]'),
33-
( 'euc_to_arr_arr', euc_to_arr, [[0,0,0]], '[0, 0, 0]'),
34-
( 'euc_to_arr_arr_recursive',euc_to_arr, [[[0,0,0], [1,0,0]]], '[[0, 0, 0], [1, 0, 0]]'),
35-
( is_scad, [cube(2)], 'True'),
36-
( 'is_scad_false', is_scad, [2], 'False'),
37-
( 'transform_to_point_single_arr', transform_to_point, [[1,0,0], [2,2,2], [3,3,1]], 'Point3(2.71, 1.29, 2.00)'),
38-
( 'transform_to_point_single_pt3', transform_to_point, [Point3(1,0,0), [2,2,2], [3,3,1]], 'Point3(2.71, 1.29, 2.00)'),
27+
( euclidify, [[0,0,0]], 'Vector3(0.00, 0.00, 0.00)'),
28+
( 'euclidify_recursive', euclidify, [[[0,0,0], [1,0,0]]], '[Vector3(0.00, 0.00, 0.00), Vector3(1.00, 0.00, 0.00)]'),
29+
( 'euclidify_Vector', euclidify, [Vector3(0,0,0)], 'Vector3(0.00, 0.00, 0.00)'),
30+
( 'euclidify_recursive_Vector', euclidify, [[Vector3( 0,0,0), Vector3( 0,0,1)]], '[Vector3(0.00, 0.00, 0.00), Vector3(0.00, 0.00, 1.00)]'),
31+
( euc_to_arr, [Vector3(0,0,0)], '[0, 0, 0]'),
32+
( 'euc_to_arr_recursive', euc_to_arr, [[Vector3( 0,0,0), Vector3( 0,0,1)]], '[[0, 0, 0], [0, 0, 1]]'),
33+
( 'euc_to_arr_arr', euc_to_arr, [[0,0,0]], '[0, 0, 0]'),
34+
( 'euc_to_arr_arr_recursive', euc_to_arr, [[[0,0,0], [1,0,0]]], '[[0, 0, 0], [1, 0, 0]]'),
35+
( is_scad, [cube(2)], 'True'),
36+
( 'is_scad_false', is_scad, [2], 'False'),
37+
( 'transform_to_point_single_arr', transform_to_point, [[1,0,0], [2,2,2], [3,3,1]], 'Point3(2.71, 1.29, 2.00)'),
38+
( 'transform_to_point_single_pt3', transform_to_point, [Point3(1,0,0), [2,2,2], [3,3,1]], 'Point3(2.71, 1.29, 2.00)'),
3939
( 'transform_to_point_arr_arr', transform_to_point, [[[1,0,0], [0,1,0], [0,0,1]] , [2,2,2], [3,3,1]], '[Point3(2.71, 1.29, 2.00), Point3(1.84, 1.84, 2.97), Point3(1.31, 1.31, 1.77)]'),
4040
( 'transform_to_point_pt3_arr', transform_to_point, [[Point3(1,0,0), Point3(0,1,0), Point3(0,0,1)], [2,2,2], [3,3,1]], '[Point3(2.71, 1.29, 2.00), Point3(1.84, 1.84, 2.97), Point3(1.31, 1.31, 1.77)]') ,
4141

‎solid/utils.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /usr/bin/python2.5
1+
#! /usr/bin/python
22
# -*- coding: utf-8 -*-
33
import os, sys, re
44

0 commit comments

Comments
 (0)