omdl  v0.9.8
OpenSCAD Mechanical Design Library
Hinges

Print-in-place hinge generators. More...

+ Collaboration diagram for Hinges:

Files

file  hinges.scad
 Print-in-place hinge generators.
 

Functions

module hinge_sf (wth=1, size, vr, vrm, knuckle, offset, pbore, mbore, mbores, support=true, mode=3, pivot, align, verb=0)
 A print-in-place single-fold hinge generator. More...
 
module hinge_bf (wth=1, size, vr, vrm, knuckle, offset, pbore, mbore, mbores, support=true, mode=7, pivot, align, verb=0)
 A print-in-place bi-fold hinge generator. More...
 

Detailed Description

Print-in-place hinge generators.

Requires:
include <omdl-base.scad>;
include <models/3d/fastener/screws.scad>;
include <parts/3d/fastener/hinges.scad>;

Function Documentation

◆ hinge_bf()

module hinge_bf ( wth  = 1,
size  ,
vr  ,
vrm  ,
knuckle  ,
offset  ,
pbore  ,
mbore  ,
mbores  ,
support  = true,
mode  = 7,
pivot  ,
align  ,
verb  = 0 
)

A print-in-place bi-fold hinge generator.

Parameters
wth<decimal> wall thickness.
size<datastruct | decimal> pivot and plate sizes; a list [l, w], the lengths and widths or a single decimal to set the lengths. The parameter l is a <decimal list-5 | decimal> [lh, lpl, lpr, lpml, lpmr], the hinge, left plate, right plate, left-middle plate, and right-middle plage lengths or a single decimal to set (lh=lpl=lpr=lpml=lpmr). Parameter w is a <decimal-list-4 | decimal> [wpl, wpr, wpml, wpmr], the left, right, left-middle, and right-middle plate widths or a single decimal to set (wpl=wpr=wpml=wpmr). Any unspecified parameters are assigned the last specified value.
vr<datastruct | decimal> plate rounding radii; a list [vrl, vrr, vrml, vrmr], the left, right, left-middle, and right-middle rounding radii or a single decimal to set (vrl=vrr=vrml=vrmr). The parameters are <decimal-list-4 | decimal>, the individual corner rounding radii or a single decimal to round all corners the same.
vrm<datastruct | integer> plate rounding mode; a list [vrml, vrmr, vrmml, vrmmr], the left, right, left-middle, and right-middle rounding mode or a single integer to set (vrml=vrmr=vrmml=vrmmr). The parameters are <integer-list-4 | integer>, the individual corner rounding modes or a single integer to round all corners the same.
knuckle<datastruct> knuckles (see below).
offset<decimal-list-3 | dcimal> pivot-to-plate offsets; a list [oz, oyl, oyr], the z-offset, left, and right y-offset between the pivots and plates or a single decimal to set oz (default = [0, 0, 0]).
pbore<datastruct> the knuckle pivot bore (see below).
mbore<datastruct> mount plate bore (see below).
mbores<datastruct> mount plate bore instance list (see below).
support<boolean> add print support for knuckles.
mode<integer> part mode (see below).
pivot<decimal-list-2 | decimal> the pivot; a list [pl, pr], the left and right mount plate pivots or a single decimal to set (pl=pr).
align<integer-list-3 | integer> the part alignment; a list [x, y, z], or a single integer to set z (default = [0, 0, 0]).
verb<integer> console output verbosity {0=quiet, 1=info, 2=details}.

This module constructs custom bi-fold hinges with print-in-place pivot pins. This type of hinge allows for full folding in both directions. Most aspects of the hinge can be controlled via a parameter. Alternatively, the pivot bore can be specified for use with externally supplied pins. The plate size and mount holes are configurable and the bores are generated by screw_bore().

Multi-value and structured parameters

knuckle

Data structure fields: knuckle

e data type default value parameter description
0 <decimal> wth kd: diameter
1 <integer> 2 count
2 <decimal> 1/4 gap
3 <integer> 0 mode
4 <datastruct> 4 pin

Data structure fields: knuckle[3]: mode
v description
0 cylinder with no gap
1 male pin
2 female pin
3 gaped cylinders
4 hole for external pin
5 print support projection (for internal use)

Data structure fields: knuckle[4]: pin
e data type default value parameter description
0 <decimal> kd*3/4 pd: cone base diameter
1 <decimal> pd/2 cone height
2 <decimal> pd/3 point rounding radius

pbore, mbore

The hinge pivot and the mount plate bores use a common specification and are performed using screw_bore(). The data structure is detailed in the following section.

Data structure fields: pbore, mbore

e data type default value parameter description
0 <decimal> 0 bd: bore diameter
1 <datastruct> undef bh: bore head
2 <datastruct> undef bn: bore nut
3 <datastruct> 1 bf: bore scale factor

The documentation of the bore parameters bh, bn and bf can be found in the screw_bore().

mbores

Data structure schema:

name schema
mbores [ instances-l, instances-r, instances-lm, instances-rm ]
instances-* [ instance, instance, ..., instance ]

Data structure fields: mbores

e data type default value parameter description
0 <datastruct-list> undef instance list left plate
1 <datastruct-list> undef instance list right plate
2 <datastruct-list> undef instance list left-middle plate
3 <datastruct-list> undef instance list right-middle plate

The left- and right-middle plate bores can be specified together or separately as configured by a mode bit described below.

Data structure fields: mbores[0-3]: instance-*
e data type default value parameter description
0 <decimal-list-2 | decimal> required bore center offset [x, y]

For an instance with a single decimal, the supplied value controls the bore instance x-offset (with y=0).

part mode

A binary encoded integer value.

b description
0 generate left mount plate
1 generate right mount plate
2 generate middle mount plate
3 specification of left and right middle-plate bores are separate

When mode bit-3 is set to one, the specification of the left-middle and right-middle plate bores are independent and specified by mbores[2] and mbores[3], respectively. When mode bit-3 is set to zero, both the left and right are specified together using by mbores[2].

Bi-fold hinge example script

include <omdl-base.scad>;
include <models/3d/fastener/screws.scad>;
include <parts/3d/fastener/hinges.scad>;
$fn = 36;
l = 150; w = 75; h = 8;
b = [for (x=[-1,0,1], y=[-1,1]) [l/3*x, w/4*y]];
(
wth=h,
size=[[l*9/10, l], [w, w, h]],
vr=[w, w]/10,
vrm=5,
knuckle=[h, 4, 1/2],
mbore=[6, [12,2,1]],
mbores=[b, b],
offset=[0, h/2],
pivot=30
);
// end_include
module hinge_bf(wth=1, size, vr, vrm, knuckle, offset, pbore, mbore, mbores, support=true, mode=7, pivot, align, verb=0)
A print-in-place bi-fold hinge generator.
Definition: hinges.scad:1306

Bi-fold hinge example diagram
topbottomrightdiag
expand topexpand bottomexpand rightexpand diag

Definition at line 1305 of file hinges.scad.

+ Here is the call graph for this function:

◆ hinge_sf()

module hinge_sf ( wth  = 1,
size  ,
vr  ,
vrm  ,
knuckle  ,
offset  ,
pbore  ,
mbore  ,
mbores  ,
support  = true,
mode  = 3,
pivot  ,
align  ,
verb  = 0 
)

A print-in-place single-fold hinge generator.

Parameters
wth<decimal> wall thickness.
size<datastruct | decimal> pivot and plate sizes; a list [l, w], the lengths and widths or a single decimal to set the lengths. The parameter l is a <decimal list-3 | decimal> [lh, lpl, lpr], the hinge, left, and right plate lengths or a single decimal to set (lh=lpl=lpr). Parameter w is a <decimal-list-2 | decimal> [wpl, wpr], the left and right plate widths or a single decimal to set (wpl=wpr). Any unspecified parameters are assigned the last specified value.
vr<datastruct | decimal> plate rounding radii; a list [vrl, vrr], the left and right rounding radii or a single decimal to set (vrl=vrr). The parameters vrl and vrr are <decimal-list-4 | decimal>, the corner rounding radii for the left and right plates or a single decimal to round all corners the same.
vrm<datastruct | integer> plate rounding mode; a list [vrml, vrmr], the left and right rounding modes or a single integer to set (vrml=vrmr). The parameters vrml and vrmr are <integer-list-4 | integer>, the corner rounding modes for the left and right plates or a single integer to round all corners the same.
knuckle<datastruct> knuckles (see below).
offset<decimal-list-2 | dcimal> pivot-to-plate offset; a list [oz, oy], the z-offset and y-offset between the pivot and plates or a single decimal to set oz. The default offset value is [-wth/2, 0] for a backflap hinge configuration.
pbore<datastruct> the knuckle pivot bore (see below).
mbore<datastruct> mount plate bore (see below).
mbores<datastruct> mount plate bore instance list (see below).
support<boolean> add print support for knuckles.
mode<integer> part mode (see below).
pivot<decimal-list-2 | decimal> the pivot; a list [pl, pr], the left and right mount plate pivots or a single decimal to set (pl=pr).
align<integer-list-3 | integer> the part alignment; a list [x, y, z], or a single integer to set z (default = [0, 0, 0]).
verb<integer> console output verbosity {0=quiet, 1=info}.

This module constructs custom single-fold hinges; such as a butt, backflap, strap, gate, offset, continuous, or a knuckle hinge. Most aspects of the hinge can be controlled via a parameter and the base configuration is for a version that can be printed in-place on a 3d printer. Alternatively, the pivot bore can be specified for use with metal pins. The plate size and mount holes are configurable and the bores are generated by screw_bore().

Multi-value and structured parameters

knuckle

Data structure fields: knuckle

e data type default value parameter description
0 <decimal> wth kd: diameter
1 <integer> 2 count
2 <decimal> 1/2 gap
3 <integer> 0 mode
4 <datastruct> 4 pin

Data structure fields: knuckle[3]: mode
v description
0 cylinder with no gap
1 male pin
2 female pin
3 gaped cylinders
4 hole for external pin
5 print support projection (for internal use)

Data structure fields: knuckle[4]: pin
e data type default value parameter description
0 <decimal> kd*3/4 pd: cone base diameter
1 <decimal> pd/2 cone height
2 <decimal> pd/3 point rounding radius

pbore, mbore

The hinge pivot and the mount plate bores use a common specification and are performed using screw_bore(). The data structure is detailed in the following section.

Data structure fields: pbore, mbore

e data type default value parameter description
0 <decimal> 0 bd: bore diameter
1 <datastruct> undef bh: bore head
2 <datastruct> undef bn: bore nut
3 <datastruct> 1 bf: bore scale factor

The documentation of the bore parameters bh, bn and bf can be found in the screw_bore().

mbores

Data structure schema:

name schema
mbores [ instances ]
instances [ instance, instance, ..., instance ]

mbores[0]: instances
e data type default value parameter description
0 <datastruct-list> undef instance list

Data structure fields: mbores[0]: instance
e data type default value parameter description
0 <decimal-list-2 | decimal> required bore center offset [x, y]

For an instance with a single decimal, the supplied value controls the bore instance x-offset (with y=0).

part mode

A binary encoded integer value.

b description
0 generate left mount plate
1 generate right mount plate

Backflap hinge example script

include <omdl-base.scad>;
include <models/3d/fastener/screws.scad>;
include <parts/3d/fastener/hinges.scad>;
$fn = 36;
for (y = [[1, -2], [2, +2]])
translate([0, second(y), 0])
(
wth=3,
size=[[28,30], 10],
vr=1,vrm=1,
pivot=45/2,
mode=first(y)
);
// end_include
function second(v)
Return the second element of an iterable value.
function first(v)
Return the first element of an iterable value.
module hinge_sf(wth=1, size, vr, vrm, knuckle, offset, pbore, mbore, mbores, support=true, mode=3, pivot, align, verb=0)
A print-in-place single-fold hinge generator.
Definition: hinges.scad:636

Backflap hinge example diagram
topbottomrightdiag
expand topexpand bottomexpand rightexpand diag

Custom hinge example script

include <omdl-base.scad>;
include <models/3d/fastener/screws.scad>;
include <parts/3d/fastener/hinges.scad>;
$fn = 36;
for (y = [[1, -3], [2, +3]])
translate([0, second(y), 0])
(
wth=3,
size=[[18, 20, 35], [4, 6]],
vr=1,
vrm=[[4,3,1,1],[10,9,5,5]],
knuckle=[5, 2, 1/2],
mbore=[1, [2, 1, 1/2], [2, 1]],
mbores=[[-7, 0, 7], [-14, -7, 0, 7, 14]],
offset=[undef, 2],
mode=first(y)
);
// end_include

Custom hinge example diagram
topbottomrightdiag
expand topexpand bottomexpand rightexpand diag

Definition at line 635 of file hinges.scad.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: