186 module box_screw( iform=7, imode=mode, ipin=pin, iscrew=screw, inut=nut )
220 fvrm = m0 ? [0,0,4,3] : [0,0,0,0];
222 sg = (type == 2) ? 1 : -1;
233 if (type == 0 || type == 2)
237 translate ([0, depth/2])
238 square([
length, depth], center=true);
242 translate ([(t1 + t2)/2*i, depth/2])
243 pg_rectangle([s1, depth], vr=er, vrm=(type == 2) ? fvrm : [1,1,0,0], center=true);
247 if ( ir > 0 && (type == 1 || type == 2) )
257 m1 ? [ j*(s1-ir)/2, depth ]
258 : [ j*s1/2, depth-ir/2 ]
261 for (j = [-1,1], k = [-1,1])
262 m1 ? [ j*(s1-ir)/2, depth/2 + k*depth/2 ]
263 : [ j*s1/2, depth/2 + k*(depth-ir)/2 ]
270 translate ([(t1 + t2)/2*i, 0] + mcr_o)
278 translate ([0, depth/2])
286 translate([0, -sl/2])
287 square([sd, sl], center=true);
291 translate([0, -sl + nh/2 + no])
293 square([ns, nh], center=
true);
297 for ( x=[-1,1], y=[-1,1] )
298 translate([ns/2*x, (nh -nr)/2*y])
305 square([sd, sd]/2, center=true);
336 translate([
length/2 * zero + offset, 0 ])
337 box_screw( iform=iform, imode=imode, ipin=ipin, iscrew=iscrew, inut=inut );
function binary_bit_is(v, b, t=1)
Test if a binary bit position of an integer value equals a test bit.
function defined_e_or(v, i, d)
Returns an element from an iterable if it exists, or a default value if not.
function defined_fle_or(v, i, d)
Return the first defined specified element in a list of lists, otherwise returns the given default va...
function select_ci(v, i, l=true)
Select specified element from list or return a default.
module joint2d_box_screw(conf, insts, mode=0, type=0, trim=false, align)
Create 2d edge profiles for screw and nut box joint construction.
module pg_rectangle(size=1, o, vr, vrm=1, vfn, center=false)
A polygon rectangle with vertex rounding.
function length(v, from=length_unit_default, to=length_unit_base, d=1)
Convert a length value from one unit to another, with optional dimensional scaling.