Modular hose

⚙️ Spec sheet →  —  visual schematic and metrics measured from a real rendered STL.

Pure-Python port of BOSL2’s modular_hose.scad: the ball-and-socket segments of a modular “Loc-Line” style adjustable/coolant hose. HoseSegment revolves a ball end, a socket end, or a full segment for the 1/4”, 1/2” and 3/4” sizes; modular_hose_radius() gives the bore radius.

class pybosl2.parts.modular_hose.HoseSegment(size, type=HoseType.SEGMENT, clearance=0, waist_len=None, fn=None, fa=None, fs=None)[source]

Bases: object

A modular-hose ball end, socket end, or full segment.

size is 0.25, 0.5 or 0.75 (the 1/4”, 1/2”, 3/4” hose families). type is a HoseType enum value. clearance loosens the fit.

Examples

A 1/2” hose segment:

from pybosl2.parts.modular_hose import HoseSegment, HoseType
HoseSegment(0.5, HoseType.SEGMENT).show()
Loading 3-D preview…

⬇ Download STL mesh

Parameters:
size : float

type : HoseType

clearance : float | list[float]

waist_len : float | None

fn : int | None

fa : float | None

fs : float | None

property size : float

Hose size (0.25, 0.5 or 0.75 inches).

property hose_type : HoseType

Segment type.

shape()[source]

Return the hose segment geometry.

Return type:

CsgSolid

show()[source]

Display the hose segment in the viewer.

Return type:

None

pybosl2.parts.modular_hose.modular_hose_radius(size, outer=False)[source]

Return the inner (bore) or outer radius of a modular hose of size.

Parameters:
size : float

Hose size (0.25, 0.5 or 0.75 inches).

outer : bool

If True, return the outer radius instead of the inner (bore) radius.

Returns:

The bore or outer radius in mm for the given hose size.

Raises:

ValueError – If size is not one of 0.25, 0.5, 0.75.

Return type:

float

Examples

These mirror the examples in BOSL2’s modular_hose.scad, rendered live through PythonSCAD. Examples that rely on BOSL2’s attachment/anchor system, or on features not in this port, are omitted.

modular_hose

1/4” segment:

from pybosl2.parts.modular_hose import HoseSegment, HoseType
HoseSegment(0.25, HoseType.SEGMENT).shape().show()
Loading 3-D preview…

⬇ Download STL mesh

1/2” segment:

from pybosl2.parts.modular_hose import HoseSegment, HoseType
HoseSegment(0.5, HoseType.SEGMENT).shape().show()
Loading 3-D preview…

⬇ Download STL mesh

3/4” segment:

from pybosl2.parts.modular_hose import HoseSegment, HoseType
HoseSegment(0.75, HoseType.SEGMENT).shape().show()
Loading 3-D preview…

⬇ Download STL mesh

1/2” ball end with a longer waist:

from pybosl2.parts.modular_hose import HoseSegment, HoseType
HoseSegment(0.5, HoseType.BALL, waist_len=15).shape().show()
Loading 3-D preview…

⬇ Download STL mesh

3/4” socket end:

from pybosl2.parts.modular_hose import HoseSegment, HoseType
HoseSegment(0.75, HoseType.SOCKET).shape().show()
Loading 3-D preview…

⬇ Download STL mesh