retaining_ring - parametric retaining rings
Retaining rings, also known as snap rings or circlips, locate components axially
on shafts or within bores. The retaining_ring module provides rings and matching
groove cutters based on the following standards:
DIN 471 external retaining rings for shafts
DIN 472 internal retaining rings for bores
The ring dimensions and groove dimensions are read from the standard tables included with bd_warehouse.
Creating Retaining Rings
The nominal size is the shaft diameter for an external ring and the bore diameter
for an internal ring. For example:
from bd_warehouse.retaining_ring import ExternalSnapRing, InternalSnapRing
shaft_ring = ExternalSnapRing("20")
bore_ring = InternalSnapRing("20")
By default, a ring is centered on the Z axis with its minimum Z face on the placement
plane. This makes either face of a retained component a convenient positioning datum.
Use align=Align.CENTER when the ring’s mid-plane should be the datum instead.
RetainingRing
RetainingRing is the common base class for the standardized ring objects.
- class RetainingRing(size: str, rotation: ~build123d.geometry.Rotation | tuple[float, float, float] = (0, 0, 0), align: None | ~build123d.build_enums.Align | tuple[~build123d.build_enums.Align, ~build123d.build_enums.Align, ~build123d.build_enums.Align] = None, mode: ~build123d.build_enums.Mode = <Mode.ADD>)[source]
Base class for standardized retaining rings.
- Parameters:
size – Nominal shaft or bore diameter as listed in the applicable standard.
rotation – Sequence of angles about the X, Y, and Z axes. Defaults to (0, 0, 0).
align – Align MIN, CENTER, or MAX of object. Defaults to None, which places the minimum Z face on the placement plane while remaining centered in XY.
mode – Combination mode. Defaults to Mode.ADD.
- Raises:
ValueError – Invalid retaining ring size.
The available sizes and their tabulated parameters can be inspected without creating CAD geometry:
from bd_warehouse.retaining_ring import ExternalSnapRing, RetainingRing
external_sizes = ExternalSnapRing.sizes()
dimensions = ExternalSnapRing.parameters("20")
alternatives = RetainingRing.select_by_size("20")
- classmethod RetainingRing.sizes() list[str][source]
Return the available nominal sizes for this retaining ring class.
- classmethod RetainingRing.parameters(size: str) dict[str, float][source]
Return the evaluated metric parameters for a nominal size.
- classmethod RetainingRing.select_by_size(size: str) dict[type[RetainingRing], list[str]][source]
Return retaining ring classes and standards available in the given size.
ExternalSnapRing
ExternalSnapRing creates DIN 471 retaining rings for installation in grooves on
shafts.
- class ExternalSnapRing(size: str, rotation: ~build123d.geometry.Rotation | tuple[float, float, float] = (0, 0, 0), align: None | ~build123d.build_enums.Align | tuple[~build123d.build_enums.Align, ~build123d.build_enums.Align, ~build123d.build_enums.Align] = None, mode: ~build123d.build_enums.Mode = <Mode.ADD>)[source]
External retaining ring for shafts as defined by DIN 471.
InternalSnapRing
InternalSnapRing creates DIN 472 retaining rings for installation in grooves
inside bores.
- class InternalSnapRing(size: str, rotation: ~build123d.geometry.Rotation | tuple[float, float, float] = (0, 0, 0), align: None | ~build123d.build_enums.Align | tuple[~build123d.build_enums.Align, ~build123d.build_enums.Align, ~build123d.build_enums.Align] = None, mode: ~build123d.build_enums.Mode = <Mode.ADD>)[source]
Internal retaining ring for bores as defined by DIN 472.
Retaining Ring Grooves
RetainingRingGroove creates the groove required by a supplied ring. It uses the
tabulated nominal groove diameter d2 and groove width m. The d4 clearance
diameter extends the cutter beyond the shaft or bore surface to ensure reliable Boolean
overlap.
Like the rings, the cutter starts at Z=0 by default and extends in the positive Z direction. The following example cuts a DIN 471 groove into a shaft:
from build123d import Align, BuildPart, Cylinder, Locations
from bd_warehouse.retaining_ring import ExternalSnapRing, RetainingRingGroove
ring = ExternalSnapRing("20")
with BuildPart() as shaft:
Cylinder(
radius=10,
height=40,
align=(Align.CENTER, Align.CENTER, Align.MIN),
)
with Locations((0, 0, 15)):
RetainingRingGroove(ring)
Passing an InternalSnapRing creates the corresponding outward-cutting DIN 472
groove for a bore. Use an alignment value such as Align.CENTER or
(Align.CENTER, Align.CENTER, Align.MAX) when another axial datum is more convenient.
- class RetainingRingGroove(ring: ~retaining_ring.RetainingRing, rotation: ~build123d.geometry.Rotation | tuple[float, float, float] = (0, 0, 0), align: None | ~build123d.build_enums.Align | tuple[~build123d.build_enums.Align, ~build123d.build_enums.Align, ~build123d.build_enums.Align] = None, mode: ~build123d.build_enums.Mode = <Mode.SUBTRACT>)[source]
Groove cutter for a DIN 471 or DIN 472 retaining ring.
The groove uses the nominal diameter
d2and widthmspecified for the supplied ring. The standard’s clearance diameterd4extends the cutter beyond the nominal shaft or bore surface to provide reliable Boolean overlap.- Parameters:
ring – External or internal retaining ring that defines the groove dimensions.
rotation – Sequence of angles about the X, Y, and Z axes. Defaults to (0, 0, 0).
align – Align MIN, CENTER, or MAX of the cutter. Defaults to None, which places the minimum Z face on the placement plane while remaining centered in XY.
mode – Combination mode. Defaults to Mode.SUBTRACT.
- Raises:
ValueError –
ringis not an ExternalSnapRing or InternalSnapRing.