Skip to content

Rounded canister threaded

RoundedCanisterThreaded

RoundedCanisterThreaded(
    tube_ext_diameter,
    tube_thickness,
    caps_height=8,
    caps_outer_thickness=1,
    clearance=0.1,
    lid_shoulder=None,
    thread_pitch=None,
)

Bases: RoundedCanisterBase

Cannot render /models/rounded_assembly.gltf: File does not exist

Generates parts for a rounded 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_ext_diameter float

External tube diameter

required
tube_thickness float

Tube thickness

required
caps_height float

Height for the caps

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/rounded_canister_threaded.py
def __init__(
    self,
    # Base
    tube_ext_diameter: 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/rounded_assembly.gltf }

    Generates parts for a rounded tube with a threaded lid.

    ---

    Interesting methods are:

    - `top()` generates the top part
      {% 3d: /models/rounded_threaded_top.gltf }
    - `bottom()` generates the bottom part.
      {% 3d: /models/rounded_threaded_bottom.gltf }
    - `lid()` generates the lid.
      {% 3d: /models/rounded_threaded_lid.gltf }

    Args:
        tube_ext_diameter (float): External tube diameter
        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
    """
    RoundedCanisterBase.__init__(
        self,
        tube_ext_diameter=tube_ext_diameter,
        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
)

Thread pitch

lid

lid()

Creates the lid

Source code in src/bd_tube_boxes/rounded_canister_threaded.py
def lid(self):
    """
    Creates the lid
    """
    return ThreadedLid(
        cap_lid_hole_radius=self.cap_lid_hole_radius,
        clearance=self.clearance,
        cap_height=self.cap_height,
        cap_outer_thickness=self.cap_outer_thickness,
        lid_shoulder=self.lid_shoulder,
        cap_lid_hole_wall_thickness=self.cap_lid_hole_wall_thickness,
        thread_pitch=self.thread_pitch,
    )