mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2024-12-29 00:09:41 +00:00
Fix for joiner bug #1167
This commit is contained in:
parent
abf6f33185
commit
044fcd6360
1 changed files with 36 additions and 25 deletions
61
joiners.scad
61
joiners.scad
|
@ -122,28 +122,28 @@ function half_joiner(l=20, w=10, base=10, ang=30, screwsize, anchor=CENTER, spin
|
|||
|
||||
[-w/6, -snap.y/2, -snap.z/2],
|
||||
[-w/6, -snap.y/2, -guide.z/2],
|
||||
[-snap.x/2, 0, snap_top-guide.z/2],
|
||||
[-snap.x/2, 0, min(snap_top-guide.z/2,-default(screwsize,0)*1.1/2)],
|
||||
[-w/6, snap.y/2, -guide.z/2],
|
||||
[-w/6, snap.y/2, -snap.z/2],
|
||||
[-snap.x/2, 0, snap_top-snap.z/2],
|
||||
|
||||
[-w/6, -snap.y/2, snap.z/2],
|
||||
[-w/6, -snap.y/2, guide.z/2],
|
||||
[-snap.x/2, 0, guide.z/2-snap_top],
|
||||
[-snap.x/2, 0, max(guide.z/2-snap_top, default(screwsize,0)*1.1/2)],
|
||||
[-w/6, snap.y/2, guide.z/2],
|
||||
[-w/6, snap.y/2, snap.z/2],
|
||||
[-snap.x/2, 0, snap.z/2-snap_top],
|
||||
|
||||
[ w/6, -snap.y/2, snap.z/2],
|
||||
[ w/6, -snap.y/2, guide.z/2],
|
||||
[ snap.x/2, 0, guide.z/2-snap_top],
|
||||
[ snap.x/2, 0, max(guide.z/2-snap_top, default(screwsize,0)*1.1/2)],
|
||||
[ w/6, snap.y/2, guide.z/2],
|
||||
[ w/6, snap.y/2, snap.z/2],
|
||||
[ snap.x/2, 0, snap.z/2-snap_top],
|
||||
|
||||
[ w/6, -snap.y/2, -snap.z/2],
|
||||
[ w/6, -snap.y/2, -guide.z/2],
|
||||
[ snap.x/2, 0, snap_top-guide.z/2],
|
||||
[ snap.x/2, 0, min(snap_top-guide.z/2,-default(screwsize,0)*1.1/2)],
|
||||
[ w/6, snap.y/2, -guide.z/2],
|
||||
[ w/6, snap.y/2, -snap.z/2],
|
||||
[ snap.x/2, 0, snap_top-snap.z/2],
|
||||
|
@ -209,14 +209,14 @@ function half_joiner(l=20, w=10, base=10, ang=30, screwsize, anchor=CENTER, spin
|
|||
[14,24,47], [14,23,24], [14,13,23], [47,24,25], [46,47,25],
|
||||
[47,30,14], [14,30,29], [14,29,15], [47,31,30], [47,48,31],
|
||||
] else each [
|
||||
[20,19,56], [20,56,57], [20,57,58], [20,58,42], [20,42,41],
|
||||
[50,51,52], [51,59,52], [51,58,59], [51,42,58], [51,43,42],
|
||||
[49,50,52], [49,52,53], [49,53,54], [49,54,36], [49,36,37],
|
||||
[56,19,18], [18,55,56], [18,54,55], [18,36,54], [18,35,36],
|
||||
[14,64,15], [15,64,63], [15,63,62], [15,62,30], [15,30,29],
|
||||
[48,31,30], [48,30,62], [48,62,61], [48,61,60], [60,47,48],
|
||||
[13,23,24], [13,24,66], [13,66,65], [13,65,64], [64,14,13],
|
||||
[46,47,60], [46,60,67], [46,67,66], [46,66,24], [46,24,25],
|
||||
[20,19,56], [20,56,57], [20,57,58], [41,58,42], [20,58,41],
|
||||
[50,51,52], [51,59,52], [51,58,59], [43,42,58], [51,43,58],
|
||||
[49,50,52], [49,52,53], [49,53,54], [37,54,36], [49,54,37],
|
||||
[56,19,18], [18,55,56], [18,54,55], [35,36,54], [18,35,54],
|
||||
[14,64,15], [15,64,63], [15,63,62], [29,62,30], [15,62,29],
|
||||
[48,31,62], [31,30,62], [48,62,61], [48,61,60], [60,47,48],
|
||||
[13,23,66], [23,24,66], [13,66,65], [13,65,64], [64,14,13],
|
||||
[46,47,60], [46,60,67], [46,67,66], [46,66,25], [66,24,25],
|
||||
for (i=[0:7]) let(b=52) [b+i, b+8+i, b+8+(i+1)%8],
|
||||
for (i=[0:7]) let(b=52) [b+i, b+8+(i+1)%8, b+(i+1)%8],
|
||||
],
|
||||
|
@ -277,6 +277,8 @@ function half_joiner2(l=20, w=10, base=10, ang=30, screwsize, anchor=CENTER, spi
|
|||
snap = [guide.x+snap_h, 2*snap_h, l*0.6],
|
||||
slope = guide.z/2/(w/8),
|
||||
snap_top = slope * (snap.x-guide.x)/2,
|
||||
s1 = min(snap_top-guide.z/2,-default(screwsize,0)*1.1/2),
|
||||
s2 = max(guide.z/2-snap_top, default(screwsize,0)*1.1/2),
|
||||
|
||||
verts = [
|
||||
[-w/2,-base,-l/2], [-w/2,-base,l/2], [w/2,-base,l/2], [w/2,-base,-l/2],
|
||||
|
@ -303,28 +305,28 @@ function half_joiner2(l=20, w=10, base=10, ang=30, screwsize, anchor=CENTER, spi
|
|||
|
||||
[-w/6, -snap.y/2, -snap.z/2],
|
||||
[-w/6, -snap.y/2, -guide.z/2],
|
||||
[-snap.x/2, 0, snap_top-guide.z/2],
|
||||
[-snap.x/2, 0, s1],
|
||||
[-w/6, snap.y/2, -guide.z/2],
|
||||
[-w/6, snap.y/2, -snap.z/2],
|
||||
[-snap.x/2, 0, snap_top-snap.z/2],
|
||||
|
||||
[-w/6, -snap.y/2, snap.z/2],
|
||||
[-w/6, -snap.y/2, guide.z/2],
|
||||
[-snap.x/2, 0, guide.z/2-snap_top],
|
||||
[-snap.x/2, 0, s2],
|
||||
[-w/6, snap.y/2, guide.z/2],
|
||||
[-w/6, snap.y/2, snap.z/2],
|
||||
[-snap.x/2, 0, snap.z/2-snap_top],
|
||||
|
||||
[ w/6, -snap.y/2, snap.z/2],
|
||||
[ w/6, -snap.y/2, guide.z/2],
|
||||
[ snap.x/2, 0, guide.z/2-snap_top],
|
||||
[ snap.x/2, 0, s2],
|
||||
[ w/6, snap.y/2, guide.z/2],
|
||||
[ w/6, snap.y/2, snap.z/2],
|
||||
[ snap.x/2, 0, snap.z/2-snap_top],
|
||||
|
||||
[ w/6, -snap.y/2, -snap.z/2],
|
||||
[ w/6, -snap.y/2, -guide.z/2],
|
||||
[ snap.x/2, 0, snap_top-guide.z/2],
|
||||
[ snap.x/2, 0, s1],
|
||||
[ w/6, snap.y/2, -guide.z/2],
|
||||
[ w/6, snap.y/2, -snap.z/2],
|
||||
[ snap.x/2, 0, snap_top-snap.z/2],
|
||||
|
@ -402,14 +404,14 @@ function half_joiner2(l=20, w=10, base=10, ang=30, screwsize, anchor=CENTER, spi
|
|||
[6,77,76], [6,78,77], [6,7,78],
|
||||
[7,1,78], [1,79,78], [1,80,79],
|
||||
|
||||
[20,56,19], [20,57,56], [20,58,57], [20,42,58], [20,41,42],
|
||||
[50,52,51], [51,52,59], [51,59,58], [51,58,42], [51,42,43],
|
||||
[49,52,50], [49,53,52], [49,54,53], [49,36,54], [49,37,36],
|
||||
[56,18,19], [18,56,55], [18,55,54], [18,54,36], [18,36,35],
|
||||
[14,15,64], [15,63,64], [15,62,63], [15,30,62], [15,29,30],
|
||||
[48,30,31], [48,62,30], [48,61,62], [48,60,61], [60,48,47],
|
||||
[13,24,23], [13,66,24], [13,65,66], [13,64,65], [64,13,14],
|
||||
[46,60,47], [46,67,60], [46,66,67], [46,24,66], [46,25,24],
|
||||
[20,56,19], [20,57,56], [20,41,57], [41,58,57], [41,42,58],
|
||||
[50,52,51], [51,52,59], [43,59,58], [43,58,42], [51,59,43],
|
||||
[49,52,50], [49,53,52], [49,37,53], [37,36,54], [54,53,37],
|
||||
[56,18,19], [18,56,55], [18,55,35], [35,55,54], [36,35,54],
|
||||
[14,15,64], [15,63,64], [15,29,63], [29,62,63], [29,30,62],
|
||||
[31,48,61], [31,61,62], [30,31,62], [48,60,61], [60,48,47],
|
||||
[23,13,65], [65,66,23], [24,23,66], [13,64,65], [64,13,14],
|
||||
[46,60,47], [46,67,60], [46,25,67], [66,67,25], [25,24,66],
|
||||
|
||||
for (i=[0:7]) let(b=52) each [
|
||||
[b+i, b+16+(i+1)%8, b+16+i],
|
||||
|
@ -421,7 +423,16 @@ function half_joiner2(l=20, w=10, base=10, ang=30, screwsize, anchor=CENTER, spi
|
|||
],
|
||||
],
|
||||
],
|
||||
pvnf = [verts, faces],
|
||||
verts2 = [
|
||||
for (i = idx(verts))
|
||||
!approx(s2, verts[54].z)? verts[i] :
|
||||
i==54? [ snap.x/2-0.01, verts[i].y, verts[i].z] :
|
||||
i==58? [ snap.x/2-0.01, verts[i].y, verts[i].z] :
|
||||
i==62? [-snap.x/2+0.01, verts[i].y, verts[i].z] :
|
||||
i==66? [-snap.x/2+0.01, verts[i].y, verts[i].z] :
|
||||
verts[i]
|
||||
],
|
||||
pvnf = [verts2, faces],
|
||||
vnf = xrot(90, p=pvnf)
|
||||
) reorient(anchor,spin,orient, size=[w,l,base*2], p=vnf);
|
||||
|
||||
|
|
Loading…
Reference in a new issue