Joiners

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

Pure-Python port of the core joiners from BOSL2’s joiners.scad — shapes for connecting two separately-printed parts. Dovetail is the flagship: a (optionally tapered) dovetail joint you attach as a male tenon or difference out as a female socket. A functional SnapPin and its SnapPinSocket give a press-and-click pin.

class pybosl2.parts.joiners.Dovetail(gender=Gender.MALE, width=15, height=8, slide=30, angle=None, slope=6, taper=0, back_width=None, slop=0.0, fn=None, fa=None, fs=None)[source]

Bases: object

A dovetail joint that slides along Y and flares upward in X.

The male form is a tenon you attach to a part; the female form is the same shape enlarged by slop for you to difference out as the mating socket. slope is the flare (rise/run per side; angle sets it as 1/tan(angle)). Give taper (degrees) or back_width to taper it along its length.

Examples

A male dovetail beside its female socket:

from pybosl2.parts.enums import Gender
from pybosl2.parts.joiners import Dovetail
(Dovetail(Gender.MALE, width=15, height=8, slide=30).shape()
 | Dovetail(Gender.FEMALE, width=15, height=8, slide=30).shape().right(24)).show()
Loading 3-D preview…

⬇ Download STL mesh

Parameters:
gender : Gender

width : float

height : float

slide : float

angle : float | None

slope : float

taper : float

back_width : float | None

slop : float

fn : int | None

fa : float | None

fs : float | None

property gender : Gender

Male or female.

property width : float

Base width in mm.

property height : float

Joint height in mm.

property slide : float

Slide length in mm.

shape()[source]

Return the dovetail geometry.

Return type:

CsgSolid

show()[source]

Display the dovetail in the viewer.

Return type:

None

class pybosl2.parts.joiners.SnapPin(diameter=5, length=12, nub_depth=0.6, snap=2.2, clearance=0.2, slot=1.2, fn=None, fa=None, fs=None)[source]

Bases: object

A press-and-click snap pin: a slotted shaft with a barbed head.

Push it head-first through a hole; the slot lets the barb compress and spring back to lock. nub_depth is the barb overhang, snap its height, and slot the width of the flex gap.

Examples

A snap pin:

from pybosl2.parts.joiners import SnapPin
SnapPin().show()
Loading 3-D preview…

⬇ Download STL mesh

Parameters:
diameter : float

length : float

nub_depth : float

snap : float

clearance : float

slot : float

fn : int | None

fa : float | None

fs : float | None

property diameter : float

Shaft diameter in mm.

property length : float

Shaft length in mm.

shape()[source]

Return the snap pin geometry.

Return type:

CsgSolid

show()[source]

Display the snap pin in the viewer.

Return type:

None

class pybosl2.parts.joiners.SnapPinSocket(diameter=5, length=12, nub_depth=0.6, snap=2.2, clearance=0.2, fn=None, fa=None, fs=None)[source]

Bases: object

The mating socket mask for a SnapPin — difference it out of a part.

A clearance bore with a relief groove that the pin’s barb clicks into.

Examples

A snap pin socket:

from pybosl2.parts.joiners import SnapPinSocket
SnapPinSocket().show()
Loading 3-D preview…

⬇ Download STL mesh

Parameters:
diameter : float

length : float

nub_depth : float

snap : float

clearance : float

fn : int | None

fa : float | None

fs : float | None

property diameter : float

Shaft diameter in mm.

property length : float

Shaft length in mm.

shape()[source]

Return the socket geometry.

Return type:

CsgSolid

show()[source]

Display the socket in the viewer.

Return type:

None

Examples

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

dovetail

Straight dovetail, male:

from pybosl2.parts.enums import Gender
from pybosl2.parts.joiners import Dovetail
Dovetail(Gender.MALE, width=15, height=8, slide=30).show()
Loading 3-D preview…

⬇ Download STL mesh

Straight dovetail, female socket:

from pybosl2.parts.enums import Gender
from pybosl2.parts.joiners import Dovetail
Dovetail(Gender.FEMALE, width=15, height=8, slide=30).show()
Loading 3-D preview…

⬇ Download STL mesh

A 6-degree taper:

from pybosl2.parts.enums import Gender
from pybosl2.parts.joiners import Dovetail
Dovetail(Gender.MALE, width=15, height=8, slide=30, taper=6).show()
Loading 3-D preview…

⬇ Download STL mesh

Setting the dovetail angle:

from pybosl2.parts.enums import Gender
from pybosl2.parts.joiners import Dovetail
Dovetail(Gender.MALE, width=15, height=8, slide=10, angle=30).show()
Loading 3-D preview…

⬇ Download STL mesh

A narrower back width:

from pybosl2.parts.enums import Gender
from pybosl2.parts.joiners import Dovetail
Dovetail(Gender.MALE, slide=50, width=18, height=4, back_width=15).show()
Loading 3-D preview…

⬇ Download STL mesh

Setting the flank slope:

from pybosl2.parts.enums import Gender
from pybosl2.parts.joiners import Dovetail
Dovetail(Gender.MALE, slide=15, width=20, height=8, slope=2).show()
Loading 3-D preview…

⬇ Download STL mesh

snap_pin

A snap pin:

from pybosl2.parts.joiners import SnapPin
SnapPin().show()
Loading 3-D preview…

⬇ Download STL mesh

snap_pin_socket

The matching socket:

from pybosl2.parts.joiners import SnapPinSocket
SnapPinSocket().show()
Loading 3-D preview…

⬇ Download STL mesh