b3dkit 0.1.3__tar.gz → 0.1.4__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.
- {b3dkit-0.1.3 → b3dkit-0.1.4}/.coverage +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/PKG-INFO +1 -1
- {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/point.md +8 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/pyproject.toml +1 -1
- {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/hexwall.py +5 -6
- {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/point.py +16 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/test_point.py +5 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/.coveragerc +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/.gitignore +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/.vscode/settings.json +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/LICENSE +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/README.md +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/build.bat +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/build.sh +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/Makefile +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/antichamfer.md +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/ball_socket.md +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/basic_shapes.md +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/bolt_fittings.md +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/click_fit.md +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/conf.py +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/dovetail.md +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/dovetail.png +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/hexwall.md +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/high_top_slide_box.md +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/index.md +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/slide_box.md +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/twist_snap.md +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/twist_snap.png +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/mkdocs.yml +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/readthedocs.yaml +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/__init__.py +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/antichamfer.py +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/ball_socket.py +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/basic_shapes.py +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/bolt_fittings.py +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/click_fit.py +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/dovetail.py +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/high_top_slide_box.py +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/slide_box.py +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/twist_snap.py +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/conftest.py +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/test_antichamfer.py +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/test_ball_socket.py +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/test_basic_shapes.py +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/test_bolt_fittings.py +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/test_click_fit.py +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/test_dovetail.py +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/test_hexwall.py +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/test_high_top_slide_box.py +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/test_slide_box.py +0 -0
- {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/test_twist_snap.py +0 -0
|
Binary file
|
|
@@ -41,6 +41,14 @@ p[1] # returns the y coordinate (3)
|
|
|
41
41
|
Point(0,10).distance_to(Point(10,10)) # returns 10.0
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
+
#### axial)distance_to
|
|
45
|
+
- `axial_distance_to(point: Point, axis: Axis) -> float`
|
|
46
|
+
- Identifies the distance along a single Axis to a second point from the current point.
|
|
47
|
+
```
|
|
48
|
+
Point(0,10).axial_distance_to(Point(10,-10), Axis.X) # returns 10.0
|
|
49
|
+
Point(0,10).axial_distance_to(Point(10,-10), Axis.Y) # returns 20.0
|
|
50
|
+
```
|
|
51
|
+
|
|
44
52
|
#### related_point
|
|
45
53
|
- `related_point(angle: float, distance: float) -> Point`
|
|
46
54
|
- Identifies a second point at a specified angle and distance from the current point.
|
|
@@ -220,11 +220,10 @@ class HexCylindrical(BasePartObject):
|
|
|
220
220
|
|
|
221
221
|
|
|
222
222
|
if __name__ == "__main__":
|
|
223
|
-
|
|
224
|
-
|
|
223
|
+
cone = Cone(100, 50, 100, align=(Align.CENTER, Align.CENTER, Align.MIN))
|
|
224
|
+
cylinder = Cylinder(100, 100)
|
|
225
225
|
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
part = cone
|
|
227
|
+
hexsample = HexCylindrical(part, 1, 2, 20, 10, 2, 20)
|
|
228
228
|
|
|
229
|
-
|
|
230
|
-
show(HexWall(100, 200, 3, 4, 1))
|
|
229
|
+
show(part, hexsample)
|
|
@@ -91,6 +91,22 @@ class Point:
|
|
|
91
91
|
- float: The Euclidean distance between the two points"""
|
|
92
92
|
return ((self.x - point.x) ** 2 + (self.y - point.y) ** 2) ** 0.5
|
|
93
93
|
|
|
94
|
+
def axial_distance_to(self, point: "Point", axis: Axis) -> float:
|
|
95
|
+
"""from the point, identify the distance to a second point
|
|
96
|
+
----------
|
|
97
|
+
Arguments:
|
|
98
|
+
- point: Point
|
|
99
|
+
The target point to calculate distance to
|
|
100
|
+
- axis: Axis
|
|
101
|
+
The Axis along which to measure the difference
|
|
102
|
+
Returns:
|
|
103
|
+
- float: The distance along the passed axis between the two points"""
|
|
104
|
+
return (
|
|
105
|
+
Point(self.X, 0).distance_to(Point(point.X, 0))
|
|
106
|
+
if axis == Axis.X
|
|
107
|
+
else Point(0, self.y).distance_to(Point(0, point.Y))
|
|
108
|
+
)
|
|
109
|
+
|
|
94
110
|
def related_point(self, angle: float, distance: float) -> "Point":
|
|
95
111
|
"""from the point, identify a second point at a specified angle and distance
|
|
96
112
|
----------
|
|
@@ -41,6 +41,11 @@ class TestPoint:
|
|
|
41
41
|
angle = p1.angle_to(p2)
|
|
42
42
|
assert angle == pytest.approx(45.0)
|
|
43
43
|
|
|
44
|
+
def test_axial_distance_to(self):
|
|
45
|
+
assert Point(20, 2).axial_distance_to(Point(-20, 2), Axis.X) == pytest.approx(
|
|
46
|
+
40.0
|
|
47
|
+
)
|
|
48
|
+
|
|
44
49
|
def test_distance_to(self):
|
|
45
50
|
p1 = Point(0, 0)
|
|
46
51
|
p2 = Point(3, 4)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|