Hooks

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

Hooks and hook-like parts, from BOSL2’s hooks.scad. BOSL2 currently supplies a single part, RingHook: a rectangular mounting base that flares up and joins tangentially to a Y-axis cylinder — the “ring” — with an optional round, D-shaped or custom through-hole. Give exactly two of or_/od, ir/id and wall to size the ring wall (or a zero inner radius for a solid paddle). The base’s vertical edges and the hole mouth can be rounded; the original’s base weld fillet is a follow-up.

class pybosl2.parts.hooks.RingHook(base_size, hole_z, outer_radius=None, inner_radius=None, outer_diameter=None, inner_diameter=None, wall=None, hole=HoleType.CIRCLE, rounding=0, hole_rounding=0, fillet=0, outside_segments=None, fn=None, fa=None, fs=None)[source]

Bases: object

A ring hook: a rectangular base that flares tangentially into a Y-axis cylinder with a hole.

base_size is the [x, y] of the mounting base, which sits on z = 0; hole_z the height of the cylinder centre above it; outer_radius / outer_diameter the cylinder’s outer radius / diameter. Give exactly two of outer_radius/outer_diameter, inner_radius/inner_diameter and wall to set the wall around the through-hole. hole is HoleType.CIRCLE, HoleType.D (semicircular, flat side down) or a list of [x, z] points for a custom hole. rounding rounds the base’s vertical edges; hole_rounding eases the hole mouth.

Examples

A ring connector:

from pybosl2.parts.hooks import RingHook
RingHook([50, 10], 25, outer_radius=25, inner_radius=20).show()
Loading 3-D preview…

⬇ Download STL mesh

Parameters:
base_size : list[float]

hole_z : float

outer_radius : float | None

inner_radius : float | None

outer_diameter : float | None

inner_diameter : float | None

wall : float | None

hole : HoleType | list[list[float]]

rounding : float

hole_rounding : float

fillet : float

outside_segments : int | None

fn : int | None

fa : float | None

fs : float | None

property base_size : list[float]

Mounting base [x, y].

property hole_z : float

Cylinder centre height.

property outer_radius : float

Cylinder outer radius.

property inner_radius : float

Cylinder inner (bore) radius.

shape()[source]

Return the ring hook geometry.

Return type:

CsgSolid

show()[source]

Display the ring hook in the viewer.

Return type:

None

class pybosl2.parts.hooks.HoleType(*values)[source]

Bases: StrEnum

Through-hole shape for RingHook.

CIRCLE = 'circle'
D = 'D'

Examples

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

ring_hook

Ring connector:

from pybosl2.parts.hooks import RingHook
RingHook([50, 10], 25, outer_radius=25, inner_radius=20).show()
Loading 3-D preview…

⬇ Download STL mesh

A solid paddle with no hole (inner_radius=0):

from pybosl2.parts.hooks import RingHook
RingHook([70, 10], 25, outer_radius=25, inner_radius=0).show()
Loading 3-D preview…

⬇ Download STL mesh

Narrow base — corners still outside the ring:

from pybosl2.parts.hooks import RingHook
RingHook([40, 10], 25, outer_radius=25, inner_radius=0).show()
Loading 3-D preview…

⬇ Download STL mesh

Hole sized by or/ir:

from pybosl2.parts.hooks import RingHook
RingHook([50, 10], 40, outer_radius=25, inner_radius=20).show()
Loading 3-D preview…

⬇ Download STL mesh

The same hole, sized by wall thickness:

from pybosl2.parts.hooks import RingHook
RingHook([50, 10], 40, outer_radius=25, wall=5).show()
Loading 3-D preview…

⬇ Download STL mesh

The same hole again, sized by od/id:

from pybosl2.parts.hooks import RingHook
RingHook([50, 10], 40, outer_diameter=50, inner_diameter=40).show()
Loading 3-D preview…

⬇ Download STL mesh

A semicircular D-hole:

from pybosl2.parts.hooks import HoleType, RingHook
RingHook([50, 10], 12, outer_radius=25, inner_radius=15, hole=HoleType.D, rounding=3, hole_rounding=3).show()
Loading 3-D preview…

⬇ Download STL mesh

Small hole_z with a D-hole:

from pybosl2.parts.hooks import HoleType, RingHook
RingHook([50, 10], 1, outer_radius=25, inner_radius=15, hole=HoleType.D).show()
Loading 3-D preview…

⬇ Download STL mesh

Rounded outer edges:

from pybosl2.parts.hooks import RingHook
RingHook([50, 10], 40, outer_radius=25, inner_radius=15, rounding=5).show()
Loading 3-D preview…

⬇ Download STL mesh

An arbitrary (octagonal) hole, printable without support:

from pybosl2.parts.hooks import RingHook
RingHook([50, 20], 30, outer_radius=25, hole=[[13*math.cos(math.radians(22.5+45*k)), 13*math.sin(math.radians(22.5+45*k))] for k in range(8)], hole_rounding=3, rounding=4).show()
Loading 3-D preview…

⬇ Download STL mesh