fuzzyometry 0.0.1__py3-none-any.whl

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.
File without changes
@@ -0,0 +1 @@
1
+ __version__ = "0.0.1"
fuzzyometry/bodies.py ADDED
@@ -0,0 +1,71 @@
1
+ from numba import njit
2
+
3
+
4
+ @njit
5
+ def _fz_cuboid_or(p, s):
6
+ x, y, z = p
7
+ w, l, h = s
8
+ d = (
9
+ min(w - x, w + x, 0) ** 2
10
+ + min(l - y, l + y, 0) ** 2
11
+ + min(h - z, h + z, 0) ** 2
12
+ ) ** 0.5
13
+ return d
14
+
15
+
16
+ @njit
17
+ def _fz_corner_ir_2d(x, y):
18
+ if x > 2 * y:
19
+ return -y
20
+ if y > 2 * x:
21
+ return -x
22
+ return -2 / 7 * (x + y) - ((-2 / 7 * (x + y)) ** 2 - (x**2 + y**2) / 7) ** 0.5
23
+
24
+
25
+ @njit
26
+ def _fz_corner_ir_3d(x, y, z):
27
+ p = -4 / 11 * (x + y + z)
28
+ q = (x**2 + y**2 + z**2) / 11
29
+ if (p / 2) ** 2 - q < 0:
30
+ return 2
31
+ return -(-p / 2 + ((p / 2) ** 2 - q) ** 0.5)
32
+
33
+
34
+ @njit
35
+ def _fz_cuboid_ir(p, s):
36
+ x, y, z = p
37
+ w, l, h = s
38
+ xd = min(w - x, w + x)
39
+ yd = min(l - y, l + y)
40
+ zd = min(h - z, h + z)
41
+ r = _fz_corner_ir_3d(xd, yd, zd)
42
+ if -2 * r < max(xd, yd, zd):
43
+ return max(
44
+ _fz_corner_ir_2d(xd, yd), _fz_corner_ir_2d(yd, zd), _fz_corner_ir_2d(xd, zd)
45
+ )
46
+ return r
47
+
48
+
49
+ @njit
50
+ def fz_cuboid(pnt, dimensions, r=0):
51
+ s = [e / 2 - r for e in dimensions]
52
+ x, y, z = pnt
53
+ w, l, h = s
54
+ xd = min(w - x, w + x)
55
+ yd = min(l - y, l + y)
56
+ zd = min(h - z, h + z)
57
+ if 0 > min(xd, yd, zd):
58
+ return _fz_cuboid_or(pnt, s) - r
59
+ return _fz_cuboid_ir(pnt, s) - r
60
+
61
+
62
+ @njit
63
+ def fz_circle(p, r):
64
+ x, y = p[:2]
65
+ return (x**2 + y**2) ** 0.5 - r
66
+
67
+
68
+ @njit
69
+ def fz_sphere(p, r):
70
+ x, y, z = p[:3]
71
+ return (x**2 + y**2 + z**2) ** 0.5 - r
@@ -0,0 +1,17 @@
1
+ from numba import njit
2
+
3
+
4
+ @njit
5
+ def fz_and_chamfer(r, *args):
6
+ s = 0.0
7
+ for a in args:
8
+ s += max(r + a, 0) ** 2
9
+ return r - s**0.5
10
+
11
+
12
+ @njit
13
+ def fz_or_chamfer(r, *args):
14
+ s = 0.0
15
+ for a in args:
16
+ s += max(r - a, 0) ** 2
17
+ return s**0.5 - r
@@ -0,0 +1,16 @@
1
+ Metadata-Version: 2.1
2
+ Name: fuzzyometry
3
+ Version: 0.0.1
4
+ Summary: The fuzzyometry library provides smooth objects, object connections and automatic chamfer generation for xyzcad.
5
+ Author: Stefan Helmert
6
+ Author-email: stefan@entroserv.de
7
+ Requires-Python: >=3.11,<4.0
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Requires-Dist: numba (>=0.58.0)
13
+ Requires-Dist: xyzcad (>=0.3.0)
14
+ Description-Content-Type: text/markdown
15
+
16
+
@@ -0,0 +1,7 @@
1
+ fuzzyometry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ fuzzyometry/_version.py,sha256=sXLh7g3KC4QCFxcZGBTpG2scR7hmmBsMjq6LqRptkRg,22
3
+ fuzzyometry/bodies.py,sha256=cpy3rLpe783HmXjJeMR2d6Bv99os5c9ERdZhVrb3g9o,1447
4
+ fuzzyometry/combinations.py,sha256=9Y0OPWl-8P-d9vUvSabcOSOcE8SHNwLQzoyo6rzJrTk,268
5
+ fuzzyometry-0.0.1.dist-info/METADATA,sha256=-8C6RB7sRneiYxg-01J5QUK6sWNYFw3fdC7yI4LU-Rw,570
6
+ fuzzyometry-0.0.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
7
+ fuzzyometry-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 1.9.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any