Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Adrian Mariano 2023-12-25 17:22:38 -05:00
commit 6bfd105630
4 changed files with 8 additions and 8 deletions

View file

@ -508,8 +508,8 @@ module snap_lock(thick, snaplen=5, snapdiam=5, layerheight=0.2, foldangle=90, hi
attachable(anchor,spin,orient, size=size) { attachable(anchor,spin,orient, size=size) {
back(snap_x) { back(snap_x) {
cube([snaplen, snapdiam, snapdiam/2+thick], anchor=BOT) { cube([snaplen, snapdiam, snapdiam/2+thick], anchor=BOT) {
attach(TOP) xcyl(l=snaplen, d=snapdiam, $fn=16); attach(TOP) xcyl(l=snaplen, d=snapdiam, $fn = max(16,quant(segs(snapdiam/2),4)));
attach(TOP) xcopies(snaplen-snapdiam/4/3) xscale(0.333) sphere(d=snapdiam*0.8, $fn=12); attach(TOP) xcopies(snaplen-snapdiam/4/3) xscale(0.333) sphere(d=snapdiam*0.8, $fn = max(12,quant(segs(snapdiam/2),4)));
} }
} }
children(); children();
@ -550,8 +550,8 @@ module snap_socket(thick, snaplen=5, snapdiam=5, layerheight=0.2, foldangle=90,
zrot_copies([0,180], r=snaplen+get_slop()) { zrot_copies([0,180], r=snaplen+get_slop()) {
diff("divot") diff("divot")
cube([snaplen, snapdiam, snapdiam/2+thick], anchor=BOT) { cube([snaplen, snapdiam, snapdiam/2+thick], anchor=BOT) {
attach(TOP) xcyl(l=snaplen, d=snapdiam, $fn=16); attach(TOP) xcyl(l=snaplen, d=snapdiam, $fn=max(16,quant(segs(snapdiam/2),4)));
tag("divot") attach(TOP) left((snaplen+snapdiam/4/3)/2) xscale(0.333) sphere(d=snapdiam*0.8, $fn=12); tag("divot") attach(TOP) left((snaplen+snapdiam/4/3)/2) xscale(0.333) sphere(d=snapdiam*0.8, $fn = max(12,quant(segs(snapdiam/2),4)));
} }
} }
} }

View file

@ -986,7 +986,7 @@ function rotate_sweep(
style=style style=style
) : ) :
let( let(
steps = ceil(segs(max_x) * angle / 360) + 1, steps = ceil(segs(max_x) * angle / 360) + (angle<360? 1 : 0),
skmat = down(min_y) * skew(sxz=shift.x/h, syz=shift.y/h) * up(min_y), skmat = down(min_y) * skew(sxz=shift.x/h, syz=shift.y/h) * up(min_y),
transforms = [ transforms = [
if (angle==360) for (i=[0:1:steps-1]) skmat * rot([90,0,360-i*360/steps]), if (angle==360) for (i=[0:1:steps-1]) skmat * rot([90,0,360-i*360/steps]),
@ -1046,7 +1046,7 @@ module rotate_sweep(
spin=spin, orient=orient spin=spin, orient=orient
) children(); ) children();
} else { } else {
steps = ceil(segs(max_x) * angle / 360) + 1; steps = ceil(segs(max_x) * angle / 360) + (angle<360? 1 : 0);
skmat = down(min_y) * skew(sxz=shift.x/h, syz=shift.y/h) * up(min_y); skmat = down(min_y) * skew(sxz=shift.x/h, syz=shift.y/h) * up(min_y);
transforms = [ transforms = [
if (angle==360) for (i=[0:1:steps-1]) skmat * rot([90,0,360-i*360/steps]), if (angle==360) for (i=[0:1:steps-1]) skmat * rot([90,0,360-i*360/steps]),

View file

@ -779,7 +779,7 @@ function scalar_vec3(v, dflt) =
// r = Radius of circle to get the number of segments for. // r = Radius of circle to get the number of segments for.
// Example: // Example:
// $fn=12; sides=segs(10); // Returns: 12 // $fn=12; sides=segs(10); // Returns: 12
// $fa=2; $fs=3, sides=segs(10); // Returns: 21 // $fa=2; $fs=3; sides=segs(10); // Returns: 21
function segs(r) = function segs(r) =
$fn>0? ($fn>3? $fn : 3) : $fn>0? ($fn>3? $fn : 3) :
let( r = is_finite(r)? r : 0 ) let( r = is_finite(r)? r : 0 )

View file

@ -9,7 +9,7 @@
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
BOSL_VERSION = [2,0,665]; BOSL_VERSION = [2,0,670];
// Section: BOSL Library Version Functions // Section: BOSL Library Version Functions