RectangleCanisterThreaded(
tube_width,
tube_length,
tube_ext_corner_radius,
tube_thickness,
caps_height=8,
caps_outer_thickness=1,
clearance=0.1,
lid_shoulder=None,
thread_pitch=None,
)
Bases: RectangleCanisterBase
Generates parts for a rectangular tube with a threaded lid.
Interesting methods are:
top()
generates the top part
bottom()
generates the bottom part.
lid()
generates the lid.
Parameters:
Name |
Type |
Description |
Default |
tube_width
|
float
|
|
required
|
tube_length
|
float
|
|
required
|
tube_ext_corner_radius
|
float
|
External radius of the corners
|
required
|
tube_thickness
|
float
|
|
required
|
caps_height
|
float
|
|
8
|
caps_outer_thickness
|
float
|
Thickness applied to the outside of the caps (and the bottom part)
|
1
|
clearance
|
float
|
Clearance used in various parts of the assembly
|
0.1
|
lid_shoulder
|
float | None
|
Lid shoulder to hide the thread. When None , value is based on cap_height
|
None
|
thread_pitch
|
float | None
|
Thread pitch for the lid. See bd_warehouse documentation on IsoThread 's pitch argument. When None , value will be based on the lid shoulder
|
None
|
Source code in src/bd_tube_boxes/rectangle_canister_threaded.py
| def __init__(
self,
# Base
tube_width: float,
tube_length: float,
tube_ext_corner_radius: float,
tube_thickness: float,
caps_height: float = 8,
caps_outer_thickness: float = 1,
clearance: float = 0.1,
lid_shoulder: float | None = None,
# Specific to this class
thread_pitch: float | None = None,
):
"""
{% 3d: /models/rectangle_threaded_assembly.gltf }
Generates parts for a rectangular tube with a threaded lid.
---
Interesting methods are:
- `top()` generates the top part
{% 3d: /models/rectangle_threaded_top.gltf }
- `bottom()` generates the bottom part.
{% 3d: /models/rectangle_threaded_bottom.gltf }
- `lid()` generates the lid.
{% 3d: /models/rectangle_threaded_lid.gltf }
Args:
tube_width (float): Tube width
tube_length (float): Tube length
tube_ext_corner_radius (float): External radius of the corners
tube_thickness (float): Tube thickness
caps_height (float): Height for the caps
caps_outer_thickness (float): Thickness applied to the outside of the caps (and the bottom part)
clearance (float): Clearance used in various parts of the assembly
lid_shoulder (float|None): Lid shoulder to hide the thread. When `None`, value is based on `cap_height`
thread_pitch (float|None): Thread pitch for the lid. See bd_warehouse documentation on `IsoThread`'s pitch argument. When `None`, value will be based on the lid shoulder
"""
RectangleCanisterBase.__init__(
self,
tube_width=tube_width,
tube_length=tube_length,
tube_ext_corner_radius=tube_ext_corner_radius,
tube_thickness=tube_thickness,
caps_height=caps_height,
caps_outer_thickness=caps_outer_thickness,
clearance=clearance,
lid_shoulder=lid_shoulder,
)
self.thread_pitch = thread_pitch if thread_pitch is not None else self.lid_shoulder * 1.5
|
thread_pitch
instance-attribute
thread_pitch = (
thread_pitch
if thread_pitch is not None
else lid_shoulder * 1.5
)
lid
Source code in src/bd_tube_boxes/rectangle_canister_threaded.py
| def lid(self):
return ThreadedLid(
cap_lid_hole_radius=self.cap_lid_hole_radius,
cap_lid_hole_wall_thickness=self.cap_lid_hole_wall_thickness,
cap_height=self.cap_height,
cap_outer_thickness=self.cap_outer_thickness,
lid_shoulder=self.lid_shoulder,
clearance=self.clearance,
thread_pitch=self.thread_pitch,
)
|