PrintTolTest 0.1.0__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PrintTolTest
3
- Version: 0.1.0
4
- Summary: A CLI tool to calculate 3D print dimensional tolerance.
3
+ Version: 0.2.0
4
+ Summary: A simple CLI tool to calculate 3D print dimensional tolerance.
5
5
  Author: NanashiTheNameless
6
6
  Author-email: NanashiTheNameless <NanashiTheNameless@NamelessNanashi.dev>
7
7
  Maintainer: NanashiTheNameless
@@ -28,9 +28,12 @@ Dynamic: license-file
28
28
 
29
29
  # PrintTolTest
30
30
 
31
- Simple command-line utility to convert CSV files to searchable and
32
- sortable HTML table. Supports large datasets and horizontal scrolling
33
- for large number of columns.
31
+ A simple CLI tool to calculate 3D print dimensional tolerance.
32
+
33
+ It is worthy to note this is more for testing your print consistency (and lets be honest, even more-so bragging).
34
+
35
+ Testing in this way is not an end-all be-all solution,
36
+ It does have issues and is not a perfect representation of printer performance.
34
37
 
35
38
  ## Installation
36
39
 
@@ -48,6 +51,26 @@ python3 -m pip install --upgrade PrintTolTest
48
51
 
49
52
  ## Get started
50
53
 
54
+ ### Interactively
55
+
51
56
  ```sh
52
57
  PrintTolTest
53
58
  ```
59
+
60
+ ### Partially-interactively
61
+
62
+ ```sh
63
+ PrintTolTest --expected X Y Z
64
+ ```
65
+
66
+ ### Non-Interactively
67
+
68
+ ```sh
69
+ PrintTolTest --expected X Y Z --measured X Y Z
70
+ ```
71
+
72
+ ## Credits
73
+
74
+ [All Major Contributors](<CONTRIBUTORS.md>)
75
+
76
+ [All Other Contributors](<https://github.com/NanashiTheNameless/PrintTolTest/graphs/contributors>)
@@ -0,0 +1,54 @@
1
+ import argparse
2
+ from .tolerance import calculate_tolerance
3
+
4
+ def prompt_for_dimensions(label):
5
+ print(f"\nEnter {label} dimensions (in mm):")
6
+ x = float(input(" X: "))
7
+ y = float(input(" Y: "))
8
+ z = float(input(" Z: "))
9
+ return (x, y, z)
10
+
11
+ def main():
12
+ parser = argparse.ArgumentParser(
13
+ description="PrintTolTest - Calculate 3D print dimensional tolerance.",
14
+ epilog="""
15
+ Examples:
16
+ PrintTolTest
17
+ → Interactive mode, will prompt for expected/measured dimensions.
18
+
19
+ PrintTolTest --expected 20 20 20 --measured 19.99 19.95 20.10
20
+ → Command-line mode, pass dimensions directly.
21
+
22
+ All dimensions must be in millimeters (mm).
23
+ """,
24
+ formatter_class=argparse.RawDescriptionHelpFormatter
25
+ )
26
+
27
+ parser.add_argument('--expected', type=float, nargs=3, metavar=('X', 'Y', 'Z'),
28
+ help='Expected dimensions in mm (e.g. --expected 20 20 20)')
29
+ parser.add_argument('--measured', type=float, nargs=3, metavar=('X', 'Y', 'Z'),
30
+ help='Measured dimensions in mm (e.g. --measured 19.99 19.95 20.10)')
31
+
32
+ args = parser.parse_args()
33
+
34
+ expected = args.expected if args.expected else prompt_for_dimensions("expected")
35
+ measured = args.measured if args.measured else prompt_for_dimensions("measured")
36
+
37
+ tolerances = calculate_tolerance(expected, measured)
38
+
39
+ print("\n3D Print Tolerance Report:")
40
+ print(f"Ideal X dimension (mm): {expected[0]:.2f}")
41
+ print(f"Ideal Y dimension (mm): {expected[1]:.2f}")
42
+ print(f"Ideal Z dimension (mm): {expected[2]:.2f}")
43
+ print(f"Measured X dimension (mm): {measured[0]:.2f}")
44
+ print(f"Measured Y dimension (mm): {measured[1]:.2f}")
45
+ print(f"Measured Z dimension (mm): {measured[2]:.2f}")
46
+ print("\nTolerance Results:")
47
+ for axis in ['X', 'Y', 'Z']:
48
+ signed = tolerances[axis]['signed']
49
+ absolute = tolerances[axis]['absolute']
50
+ sign_prefix = '+' if signed > 0 else ''
51
+ print(f"{axis}-axis: Signed = {sign_prefix}{signed:.3f}%, Absolute = {absolute:.3f}%")
52
+
53
+ if __name__ == "__main__":
54
+ main()
@@ -0,0 +1,7 @@
1
+ def calculate_tolerance(expected, measured):
2
+ tolerances = {}
3
+ for axis, e, m in zip(['X', 'Y', 'Z'], expected, measured):
4
+ signed = ((m - e) / e) * 100
5
+ absolute = abs(signed)
6
+ tolerances[axis] = {'signed': signed, 'absolute': absolute}
7
+ return tolerances
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PrintTolTest
3
- Version: 0.1.0
4
- Summary: A CLI tool to calculate 3D print dimensional tolerance.
3
+ Version: 0.2.0
4
+ Summary: A simple CLI tool to calculate 3D print dimensional tolerance.
5
5
  Author: NanashiTheNameless
6
6
  Author-email: NanashiTheNameless <NanashiTheNameless@NamelessNanashi.dev>
7
7
  Maintainer: NanashiTheNameless
@@ -28,9 +28,12 @@ Dynamic: license-file
28
28
 
29
29
  # PrintTolTest
30
30
 
31
- Simple command-line utility to convert CSV files to searchable and
32
- sortable HTML table. Supports large datasets and horizontal scrolling
33
- for large number of columns.
31
+ A simple CLI tool to calculate 3D print dimensional tolerance.
32
+
33
+ It is worthy to note this is more for testing your print consistency (and lets be honest, even more-so bragging).
34
+
35
+ Testing in this way is not an end-all be-all solution,
36
+ It does have issues and is not a perfect representation of printer performance.
34
37
 
35
38
  ## Installation
36
39
 
@@ -48,6 +51,26 @@ python3 -m pip install --upgrade PrintTolTest
48
51
 
49
52
  ## Get started
50
53
 
54
+ ### Interactively
55
+
51
56
  ```sh
52
57
  PrintTolTest
53
58
  ```
59
+
60
+ ### Partially-interactively
61
+
62
+ ```sh
63
+ PrintTolTest --expected X Y Z
64
+ ```
65
+
66
+ ### Non-Interactively
67
+
68
+ ```sh
69
+ PrintTolTest --expected X Y Z --measured X Y Z
70
+ ```
71
+
72
+ ## Credits
73
+
74
+ [All Major Contributors](<CONTRIBUTORS.md>)
75
+
76
+ [All Other Contributors](<https://github.com/NanashiTheNameless/PrintTolTest/graphs/contributors>)
@@ -3,6 +3,7 @@ README.md
3
3
  pyproject.toml
4
4
  PrintTolTest/__init__.py
5
5
  PrintTolTest/cli.py
6
+ PrintTolTest/tolerance.py
6
7
  PrintTolTest.egg-info/PKG-INFO
7
8
  PrintTolTest.egg-info/SOURCES.txt
8
9
  PrintTolTest.egg-info/dependency_links.txt
@@ -0,0 +1,48 @@
1
+ # PrintTolTest
2
+
3
+ A simple CLI tool to calculate 3D print dimensional tolerance.
4
+
5
+ It is worthy to note this is more for testing your print consistency (and lets be honest, even more-so bragging).
6
+
7
+ Testing in this way is not an end-all be-all solution,
8
+ It does have issues and is not a perfect representation of printer performance.
9
+
10
+ ## Installation
11
+
12
+ Get the Latest
13
+
14
+ ```sh
15
+ python3 -m pip install --upgrade 'PrintTolTest @ git+https://github.com/NanashiTheNameless/PrintTolTest@master'
16
+ ```
17
+
18
+ Or get from [PyPi](<https://pypi.org/project/PrintTolTest/>) (not recommended, may be out of date)
19
+
20
+ ```sh
21
+ python3 -m pip install --upgrade PrintTolTest
22
+ ```
23
+
24
+ ## Get started
25
+
26
+ ### Interactively
27
+
28
+ ```sh
29
+ PrintTolTest
30
+ ```
31
+
32
+ ### Partially-interactively
33
+
34
+ ```sh
35
+ PrintTolTest --expected X Y Z
36
+ ```
37
+
38
+ ### Non-Interactively
39
+
40
+ ```sh
41
+ PrintTolTest --expected X Y Z --measured X Y Z
42
+ ```
43
+
44
+ ## Credits
45
+
46
+ [All Major Contributors](<CONTRIBUTORS.md>)
47
+
48
+ [All Other Contributors](<https://github.com/NanashiTheNameless/PrintTolTest/graphs/contributors>)
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "PrintTolTest"
7
- version = "0.1.0"
8
- description = "A CLI tool to calculate 3D print dimensional tolerance."
7
+ version = "0.2.0"
8
+ description = "A simple CLI tool to calculate 3D print dimensional tolerance."
9
9
  readme = "README.md"
10
10
  license = { text = "OQL-1.2" }
11
11
  requires-python = ">=3.10"
@@ -1,28 +0,0 @@
1
- def calculate_tolerance(ideal, measured):
2
- signed = ((measured - ideal) / ideal) * 100
3
- absolute = abs(signed)
4
- return signed, absolute
5
-
6
-
7
- def main():
8
- print("3D Print Tolerance:")
9
- try:
10
- ideal_x = float(input("Ideal X dimension (mm): "))
11
- ideal_y = float(input("Ideal Y dimension (mm): "))
12
- ideal_z = float(input("Ideal Z dimension (mm): "))
13
- measured_x = float(input("Measured X dimension (mm): "))
14
- measured_y = float(input("Measured Y dimension (mm): "))
15
- measured_z = float(input("Measured Z dimension (mm): "))
16
- results = {
17
- "X": calculate_tolerance(ideal_x, measured_x),
18
- "Y": calculate_tolerance(ideal_y, measured_y),
19
- "Z": calculate_tolerance(ideal_z, measured_z),
20
- }
21
- print("\nTolerance Results:")
22
- for axis, (signed, absolute) in results.items():
23
- print(f"{axis}-axis: Signed = {signed:+.3f}%, Absolute = {absolute:.3f}%")
24
- except ValueError:
25
- print("Invalid input. Only numeric values are allowed.")
26
-
27
- if __name__ == "__main__":
28
- main()
@@ -1,25 +0,0 @@
1
- # PrintTolTest
2
-
3
- Simple command-line utility to convert CSV files to searchable and
4
- sortable HTML table. Supports large datasets and horizontal scrolling
5
- for large number of columns.
6
-
7
- ## Installation
8
-
9
- Get the Latest
10
-
11
- ```sh
12
- python3 -m pip install --upgrade 'PrintTolTest @ git+https://github.com/NanashiTheNameless/PrintTolTest@master'
13
- ```
14
-
15
- Or get from [PyPi](<https://pypi.org/project/PrintTolTest/>) (not recommended, may be out of date)
16
-
17
- ```sh
18
- python3 -m pip install --upgrade PrintTolTest
19
- ```
20
-
21
- ## Get started
22
-
23
- ```sh
24
- PrintTolTest
25
- ```
File without changes
File without changes