Compare commits

...

4 commits

Author SHA1 Message Date
pelletjl
9e25f5c575
Merge a4e31037db into 4503838c64 2025-12-04 22:34:28 -05:00
James Pelletier
a4e31037db assert message clarification 2025-12-04 22:33:49 -05:00
adrianVmariano
4503838c64
Merge pull request #1850 from pelletjl/master
fix for threaded_nut bevang
2025-12-04 07:15:24 -05:00
James Pelletier
f3654c404d fix for threaded_nut bevang 2025-12-01 11:36:32 -05:00
2 changed files with 6 additions and 5 deletions

View file

@ -1152,7 +1152,8 @@ module rabbit_clip(type, length, width, snap, thickness, depth, compression=0.1
assert(is_num(depth) && depth>0, "Depth must be a positive value")
assert(is_num(compression) && compression >= 0, "Compression must be a nonnegative value")
assert(is_num(lock_clearance))
assert(valid_lock(), "Invalid lock value")
assert(valid_lock(), type != "double" ? str("lock must be either true, false, LEFT, or RIGHT for type \"", type, "\"")
: "for type \"double\", lock must be either true, false, TOP, BOTTOM, LEFT, RIGHT, a corner (e.g. TOP+LEFT), or a vector of edges and/or corners")
assert(in_list(type,legal_types),str("type must be one of ",legal_types));
module apply_lock() {

View file

@ -388,7 +388,7 @@ module threaded_nut(
pitch=pitch,
profile=profile,starts=starts,shape=shape,
left_handed=left_handed,
bevel=bevel,bevel1=bevel1,bevel2=bevel2,
bevel=bevel,bevel1=bevel1,bevel2=bevel2,bevang=bevang,
ibevel1=ibevel1, ibevel2=ibevel2, ibevel=ibevel,
blunt_start=blunt_start, blunt_start1=blunt_start1, blunt_start2=blunt_start2,
lead_in=lead_in, lead_in1=lead_in1, lead_in2=lead_in2, lead_in_shape=lead_in_shape,
@ -2066,7 +2066,7 @@ module generic_threaded_nut(
vnf = linear_sweep(hexagon(id=nutwidth), height=h, center=true);
attachable(anchor,spin,orient, size=shape=="square" ? [nutwidth,nutwidth,h] : undef, vnf=shape=="hex" ? vnf : undef) {
difference() {
_nutshape(nutwidth,h, shape,bevel1,bevel2);
_nutshape(nutwidth,h, shape,bevel1,bevel2,bevang=bevang);
if (pitch==0)
cyl(l=h+extra, d1=full_id1+4*get_slop(), d2=full_id2+4*get_slop(),
chamfer1=ibevel1?-IBEV*full_id1:undef,
@ -2092,7 +2092,7 @@ module generic_threaded_nut(
}
module _nutshape(nutwidth, h, shape, bevel1, bevel2)
module _nutshape(nutwidth, h, shape, bevel1, bevel2, bevang)
{
bevel_d=0.9;
intersection(){
@ -2103,7 +2103,7 @@ module _nutshape(nutwidth, h, shape, bevel1, bevel2)
fn = quantup(segs(r=nutwidth/2),shape=="hex"?6:4);
d = shape=="hex" ? 2*nutwidth/sqrt(3) : sqrt(2)*nutwidth;
chamfsize = (d-nutwidth)/2/bevel_d;
cyl(d=d*.99,h=h+.01,realign=true,circum=true,$fn=fn,chamfer1=bevel1?chamfsize:0,chamfer2=bevel2?chamfsize:0,chamfang=30);
cyl(d=d*.99,h=h+.01,realign=true,circum=true,$fn=fn,chamfer1=bevel1?chamfsize:0,chamfer2=bevel2?chamfsize:0,chamfang=bevang);
}
}