Hinges¶
⚙️ Spec sheet → — visual schematic and metrics measured from a real rendered STL.
Pure-Python port of the hinges in BOSL2’s hinges.scad: a print-in-place
LivingHingeMask (differenced from a plate to make a folding “live”
hinge), a functional interlocking KnuckleHinge leaf (with
KnuckleHingePair for both leaves meshed around one pin, at any fold
angle), and simple SnapLock / SnapSocket
connectors.
-
class pybosl2.parts.hinges.KnuckleHinge(length=
40, segs=5, knuckle_diam=6, pin_diam=2, arm=20, thick=3, gap=0.4, inner=False, fn=None, fa=None, fs=None)[source]¶ Bases:
objectOne leaf of an interlocking knuckle hinge with a pin bore.
The hinge pin lies along X at the origin; the flat leaf extends in +Y (outer leaf) or -Y (inner leaf). segs is the total knuckle count across both leaves — the outer leaf takes the
ceil(segs/2)even knuckles, the inner leaf thefloor(segs/2)odd ones. Pair withKnuckleHingePair.Examples
An outer knuckle hinge leaf:
from pybosl2.parts.hinges import KnuckleHinge KnuckleHinge().show()Loading 3-D preview…- Parameters:¶
- property length : float¶
Hinge length in mm.
- property arm : float¶
Leaf arm length in mm.
- property inner : bool¶
True for the inner leaf, False for outer.
-
class pybosl2.parts.hinges.KnuckleHingePair(length=
40, segs=5, knuckle_diam=6, pin_diam=2, arm=20, thick=3, gap=0.4, fold=0, pin=True, fn=None, fa=None, fs=None)[source]¶ Bases:
objectBoth leaves of a knuckle hinge, meshed around one pin.
Set fold to rotate the inner leaf about the pin axis. With pin, a pin cylinder is included.
Examples
A knuckle hinge folded 90 degrees:
from pybosl2.parts.hinges import KnuckleHingePair KnuckleHingePair(fold=90).show()Loading 3-D preview…- Parameters:¶
- property length : float¶
Hinge length in mm.
- property fold : float¶
Fold angle in degrees.
-
class pybosl2.parts.hinges.LivingHingeMask(length, thick, layerheight=
0.2, foldangle=90, hingegap=None, slop=0.0)[source]¶ Bases:
objectA wedge mask to difference out of a plate to make a print-in-place living hinge.
Centre it on the bottom of a plate of thickness thick; it leaves
2*layerheightof material as the flexible hinge, and a V-groove wide enough to fold foldangle degrees.Examples
A living hinge cut into a 100x40 plate:
from pybosl2.parts.hinges import LivingHingeMask from pybosl2.solid import cuboid (cuboid([100, 40, 3]) - LivingHingeMask(length=100, thick=3, foldangle=60).shape().down(1.5)).show()Loading 3-D preview…- Parameters:¶
- property length : float¶
Hinge length in mm.
- property thick : float¶
Plate thickness in mm.
-
class pybosl2.parts.hinges.SnapLock(thick=
3, snaplen=5, snapdiam=5, layerheight=0.2, foldangle=90, hingegap=None, slop=0.0, fn=None, fa=None, fs=None)[source]¶ Bases:
objectA snap-lock tab (a ridge on a post) that clicks into a
SnapSocket.Examples
A snap-lock tab:
from pybosl2.parts.hinges import SnapLock SnapLock().show()Loading 3-D preview…- Parameters:¶
- property thick : float¶
Plate thickness in mm.
-
class pybosl2.parts.hinges.SnapSocket(thick=
3, snaplen=5, snapdiam=5, layerheight=0.2, foldangle=90, hingegap=None, slop=0.0, fn=None, fa=None, fs=None)[source]¶ Bases:
objectThe receiving socket for a
SnapLocktab.Examples
A snap socket:
from pybosl2.parts.hinges import SnapSocket SnapSocket().show()Loading 3-D preview…- Parameters:¶
- property thick : float¶
Plate thickness in mm.
Examples¶
These mirror the examples in BOSL2’s hinges.scad, rendered live through PythonSCAD.
Examples that rely on BOSL2’s attachment/anchor system, or on features not in this port, are omitted.
knuckle_hinge
A 5-knuckle hinge leaf:
from pybosl2.parts.hinges import KnuckleHinge
KnuckleHinge(length=35, segs=5).shape().show()
knuckle_hinge_pair
A meshed hinge pair:
from pybosl2.parts.hinges import KnuckleHingePair
KnuckleHingePair(length=40, segs=5).shape().show()
living_hinge_mask
A living-hinge groove mask:
from pybosl2.parts.hinges import LivingHingeMask
LivingHingeMask(length=100, thick=3, foldangle=60).shape().show()
snap_lock
A snap lock:
from pybosl2.parts.hinges import SnapLock
SnapLock(thick=3, foldangle=60).shape().show()
snap_socket
A snap socket:
from pybosl2.parts.hinges import SnapSocket
SnapSocket(thick=3, foldangle=60).shape().show()