Wiring

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

Rendering for routed wire bundles, from BOSL2’s wiring.scad. shape() hex-packs a set of round wires into a bundle and sweeps them along a path whose corners are rounded to a given radius, colouring each wire from a 17-entry table (re-used if there are more than 17 wires). Each wire is an independently watertight swept tube; hex_offsets() exposes the optimal hexagonal packing centres it uses.

class pybosl2.parts.wiring.WireBundle(path, wires, wirediam=2, rounding=10, wirenum=0, corner_steps=15)[source]

Bases: object

A bundle of round wires routed along a path with rounded corners.

The wires are hex-packed in the bundle cross-section and each is coloured from the 17-entry table (re-used, offset by wirenum, if there are more than 17). wirediam is each wire’s diameter; corner_steps sets how finely the rounded corners are faceted.

Examples

A 13-wire bundle routed around three corners:

from pybosl2.parts.wiring import WireBundle
WireBundle([[50, 0, -50], [50, 50, -50], [0, 50, -50],
            [0, 0, -50], [0, 0, 0]], wires=13, rounding=10).show()
Loading 3-D preview…

⬇ Download STL mesh

Parameters:
path : list[list[float]]

wires : int

wirediam : float

rounding : float

wirenum : int

corner_steps : int

property wires : int

Number of wires in the bundle.

property wirediam : float

Wire diameter in mm.

shape()[source]

Return the wire bundle geometry.

Return type:

CsgSolid

show()[source]

Display the wire bundle in the viewer.

Return type:

None

pybosl2.parts.wiring.hex_offsets(sides, diameter)[source]

Return the centre points for the optimal hexagonal packing of at least sides circles.

Circles are spaced diameter apart.

Parameters:
sides : int

Minimum number of circles to pack.

diameter : float

Centre-to-centre spacing between circles.

Returns:

A list of [x, y] centre offsets.

Return type:

list[list[float]]