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.
Files changed (52) hide show
  1. {b3dkit-0.1.3 → b3dkit-0.1.4}/.coverage +0 -0
  2. {b3dkit-0.1.3 → b3dkit-0.1.4}/PKG-INFO +1 -1
  3. {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/point.md +8 -0
  4. {b3dkit-0.1.3 → b3dkit-0.1.4}/pyproject.toml +1 -1
  5. {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/hexwall.py +5 -6
  6. {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/point.py +16 -0
  7. {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/test_point.py +5 -0
  8. {b3dkit-0.1.3 → b3dkit-0.1.4}/.coveragerc +0 -0
  9. {b3dkit-0.1.3 → b3dkit-0.1.4}/.gitignore +0 -0
  10. {b3dkit-0.1.3 → b3dkit-0.1.4}/.vscode/settings.json +0 -0
  11. {b3dkit-0.1.3 → b3dkit-0.1.4}/LICENSE +0 -0
  12. {b3dkit-0.1.3 → b3dkit-0.1.4}/README.md +0 -0
  13. {b3dkit-0.1.3 → b3dkit-0.1.4}/build.bat +0 -0
  14. {b3dkit-0.1.3 → b3dkit-0.1.4}/build.sh +0 -0
  15. {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/Makefile +0 -0
  16. {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/antichamfer.md +0 -0
  17. {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/ball_socket.md +0 -0
  18. {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/basic_shapes.md +0 -0
  19. {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/bolt_fittings.md +0 -0
  20. {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/click_fit.md +0 -0
  21. {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/conf.py +0 -0
  22. {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/dovetail.md +0 -0
  23. {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/dovetail.png +0 -0
  24. {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/hexwall.md +0 -0
  25. {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/high_top_slide_box.md +0 -0
  26. {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/index.md +0 -0
  27. {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/slide_box.md +0 -0
  28. {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/twist_snap.md +0 -0
  29. {b3dkit-0.1.3 → b3dkit-0.1.4}/docs/twist_snap.png +0 -0
  30. {b3dkit-0.1.3 → b3dkit-0.1.4}/mkdocs.yml +0 -0
  31. {b3dkit-0.1.3 → b3dkit-0.1.4}/readthedocs.yaml +0 -0
  32. {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/__init__.py +0 -0
  33. {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/antichamfer.py +0 -0
  34. {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/ball_socket.py +0 -0
  35. {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/basic_shapes.py +0 -0
  36. {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/bolt_fittings.py +0 -0
  37. {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/click_fit.py +0 -0
  38. {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/dovetail.py +0 -0
  39. {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/high_top_slide_box.py +0 -0
  40. {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/slide_box.py +0 -0
  41. {b3dkit-0.1.3 → b3dkit-0.1.4}/src/b3dkit/twist_snap.py +0 -0
  42. {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/conftest.py +0 -0
  43. {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/test_antichamfer.py +0 -0
  44. {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/test_ball_socket.py +0 -0
  45. {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/test_basic_shapes.py +0 -0
  46. {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/test_bolt_fittings.py +0 -0
  47. {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/test_click_fit.py +0 -0
  48. {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/test_dovetail.py +0 -0
  49. {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/test_hexwall.py +0 -0
  50. {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/test_high_top_slide_box.py +0 -0
  51. {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/test_slide_box.py +0 -0
  52. {b3dkit-0.1.3 → b3dkit-0.1.4}/tests/test_twist_snap.py +0 -0
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: b3dkit
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: build123d libraries and utilities
5
5
  Project-URL: Homepage, https://github.com/x0pherl/b3dkit
6
6
  Project-URL: Issues, https://github.com/x0pherl/b3dkit/issues
@@ -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.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "b3dkit"
3
- version = "0.1.3"
3
+ version = "0.1.4"
4
4
  authors = [
5
5
  { name="x0pherl"},
6
6
  ]
@@ -220,11 +220,10 @@ class HexCylindrical(BasePartObject):
220
220
 
221
221
 
222
222
  if __name__ == "__main__":
223
- # cone = Cone(100, 50, 100, align=(Align.CENTER, Align.CENTER, Align.MIN))
224
- # cylinder = Cylinder(100, 100)
223
+ cone = Cone(100, 50, 100, align=(Align.CENTER, Align.CENTER, Align.MIN))
224
+ cylinder = Cylinder(100, 100)
225
225
 
226
- # part = cone
227
- # hexsample = HexCylindrical(part, 1, 2, 20, 10, 2, 20)
226
+ part = cone
227
+ hexsample = HexCylindrical(part, 1, 2, 20, 10, 2, 20)
228
228
 
229
- # show(part, hexsample)
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