Fix cheese some head types for consistent design when $fn is odd, and

ensure facets match
This commit is contained in:
Adrian Mariano 2023-01-30 16:18:22 -05:00
parent d8dccc0005
commit f402c09e8f

View file

@ -1406,9 +1406,11 @@ module screw_head(screw_info,details=false, counterbore=0,flat_height,oversize=0
head=="cheese" ? .7 * head_height :
0.1 * head_height; // round and button
head_size2 = head=="cheese" ? head_size-2*tan(5)*head_height : head_size; // 5 deg slope on cheese head
cyl(l=base, d1=head_size, d2=head_size2,anchor=BOTTOM)
segs = segs(head_size);
cyl(l=base, d1=head_size, d2=head_size2,anchor=BOTTOM, $fn=segs)
attach(TOP)
rotate_extrude()
zrot(180) // Needed to align facets when $fn is odd
rotate_extrude($fn=segs) // ensure same number of segments for cap as for head body
intersection(){
arc(points=[[-head_size2/2,0], [0,-base+head_height * (head=="button"?4/3:1)], [head_size2/2,0]]);
square([head_size2, head_height-base]);