From e40dddf058a6e81d4fe07dab444e937c1258230a Mon Sep 17 00:00:00 2001
From: Revar Desmera <revarbat@gmail.com>
Date: Thu, 7 Dec 2023 15:52:06 -0800
Subject: [PATCH 1/8] Fix for #1320: $fn/$fa/$fs handling in rotate_extrude()

---
 skin.scad | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/skin.scad b/skin.scad
index fc9ed38..e8b2bcd 100644
--- a/skin.scad
+++ b/skin.scad
@@ -986,7 +986,7 @@ function rotate_sweep(
         style=style
     ) :
     let(
-        steps = segs(max_x),
+        steps = ceil(segs(max_x) * angle / 360) + 1,
         skmat = down(min_y) * skew(sxz=shift.x/h, syz=shift.y/h) * up(min_y),
         transforms = [
             if (angle==360) for (i=[0:1:steps-1]) skmat * rot([90,0,360-i*360/steps]),
@@ -1027,7 +1027,6 @@ module rotate_sweep(
     max_y = bounds[1].y;
     h = max_y - min_y;
     check2 = assert(min_x>=0, "Input region must exist entirely in the X+ half-plane.");
-    steps = segs(max_x);
     if (!is_undef(texture)) {
         _textured_revolution(
             shape,
@@ -1047,6 +1046,7 @@ module rotate_sweep(
             spin=spin, orient=orient
         ) children();
     } else {
+        steps = ceil(segs(max_x) * angle / 360) + 1;
         skmat = down(min_y) * skew(sxz=shift.x/h, syz=shift.y/h) * up(min_y);
         transforms = [
             if (angle==360) for (i=[0:1:steps-1]) skmat * rot([90,0,360-i*360/steps]),

From 05f2845bb83a0cbac558c73e65384f38673e7b9b Mon Sep 17 00:00:00 2001
From: Adrian Mariano <avm4@cornell.edu>
Date: Sat, 9 Dec 2023 21:15:26 -0500
Subject: [PATCH 2/8] fix example bug

---
 turtle3d.scad | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/turtle3d.scad b/turtle3d.scad
index bc8d559..2c74b25 100644
--- a/turtle3d.scad
+++ b/turtle3d.scad
@@ -368,7 +368,7 @@ function _rotpart(T) = [for(i=[0:3]) [for(j=[0:3]) j<3 || i==3 ? T[i][j] : 0]];
 //                       ["move", seg1_len, "grow", seg1_bot_ID/seg2_bot_ID]
 //                    ],
 //                    state=UP, transforms=true);
-//   back_half()      // Remove this to get a usable part
+//   back_half(s=300)    // Remove this to get a usable part
 //     sweep(circle(d=seg1_bot_OD, $fn=128), trans, closed=true);
 // Example(3D): Closed spiral
 //   include<BOSL2/skin.scad>

From 44b9ae0a100af20bea7544f3bf3988975c1d7013 Mon Sep 17 00:00:00 2001
From: revarbat <revarbat@users.noreply.github.com>
Date: Sun, 10 Dec 2023 02:57:19 +0000
Subject: [PATCH 3/8] Version Bump

---
 version.scad | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/version.scad b/version.scad
index a122434..85ecc23 100644
--- a/version.scad
+++ b/version.scad
@@ -9,7 +9,7 @@
 //////////////////////////////////////////////////////////////////////
 
 
-BOSL_VERSION = [2,0,662];
+BOSL_VERSION = [2,0,663];
 
 
 // Section: BOSL Library Version Functions

From 3b3ad8eaea5fffc17326a263c96903b07987b5ac Mon Sep 17 00:00:00 2001
From: Revar Desmera <revarbat@gmail.com>
Date: Sat, 9 Dec 2023 18:59:49 -0800
Subject: [PATCH 4/8] Docs fixes for comparisons.scad

---
 comparisons.scad | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/comparisons.scad b/comparisons.scad
index 2d090da..0270dd4 100644
--- a/comparisons.scad
+++ b/comparisons.scad
@@ -897,10 +897,10 @@ function group_sort(list, idx) =
 // Description:
 //   Given a list of integer group numbers, and an equal-length list of values,
 //   returns a list of groups with the values sorted into the corresponding groups.
-//   Ie: if you have a groups index list of [2,3,2] and values of ["A","B","C"], then
-//   the values "A" and "C" will be put in group 2, and "B" will be in group 3.
+//   Ie: if you have a groups index list of `[2,3,2]` and values of `["A","B","C"]`, then
+//   the values `"A"` and `"C"` will be put in group 2, and `"B"` will be in group 3.
 //   Groups that have no values grouped into them will be an empty list.  So the
-//   above would return [[], [], ["A","C"], ["B"]]
+//   above would return `[[], [], ["A","C"], ["B"]]`
 // Arguments:
 //   groups = A list of integer group index numbers.
 //   values = A list of values to sort into groups.

From 6ef84f89127d1f3614040c865f32efc66d026d36 Mon Sep 17 00:00:00 2001
From: revarbat <revarbat@users.noreply.github.com>
Date: Sun, 10 Dec 2023 03:00:51 +0000
Subject: [PATCH 5/8] Version Bump

---
 version.scad | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/version.scad b/version.scad
index 85ecc23..196ab5b 100644
--- a/version.scad
+++ b/version.scad
@@ -9,7 +9,7 @@
 //////////////////////////////////////////////////////////////////////
 
 
-BOSL_VERSION = [2,0,663];
+BOSL_VERSION = [2,0,664];
 
 
 // Section: BOSL Library Version Functions

From a6a164bf151366a3d11acacbb6aaeed4fcc8fd47 Mon Sep 17 00:00:00 2001
From: Adrian Mariano <avm4@cornell.edu>
Date: Sun, 10 Dec 2023 20:02:53 -0500
Subject: [PATCH 6/8] example fixes

---
 gears.scad | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gears.scad b/gears.scad
index 1367a76..429a6f3 100644
--- a/gears.scad
+++ b/gears.scad
@@ -570,7 +570,7 @@ function _inherit_gear_thickness(thickness,dflt=10) =
 //   mate at a 90 degree angle because if it did, its cone could not meet the center of the planar bevel gear.
 //   If you request a larger shaft angle, the teeth of the bevel gear will tilt inward, producing an internal bevel gear.
 //   Gears with this design are rarely used.  The mate of an interior gear is always an exterior gear.  
-// Figure(VPT=[-1.07698,0.67915,-2.25898],VPD=263.435,VPR=[69.7,0,49.3],NoAxes): Internal bevel gear (yellow) mated to an external bevel gear (blue) to achieve a 135 degree shaft angle.  
+// Figure(Med,VPT=[-1.07698,0.67915,-2.25898],VPD=263.435,VPR=[69.7,0,49.3],NoAxes): Internal bevel gear (yellow) mated to an external bevel gear (blue) to achieve a 135 degree shaft angle.  
 //   ang=135;
 //   bevel_gear(mod=3,35,15,ang,spiral=0,cone_backing=false);
 //      down(15)cyl(h=40,d=3,$fn=16,anchor=BOT);
@@ -3492,7 +3492,7 @@ function _gear_tooth_profile(
 //     spur_gear2d(mod=mod, teeth=gear_data[0][1], profile_shift=gear_data[0][2], gear_spin=gear_data[0][3]);  //sun
 //   color("red")move_copies(gear_data[2][4])
 //     spur_gear2d(mod=mod, teeth=gear_data[2][1], profile_shift=gear_data[2][2], gear_spin=gear_data[2][3][$idx]);
-// Example(2D,Med,NoAxes,Anim,Frames=45,VPT=[-0.125033,0.508151,-66.3877],VPR=[0,0,0],VPD=192.044): In this example we request a sun/carrier ratio of 3.6 and get exactly that ratio.  The carrier shown as the blue pentagon moves very slowly as the central sun turns.  The ring is fixed.  
+// Example(2D,Med,NoAxes,Anim,FrameMS=60,Frames=90,VPT=[-0.125033,0.508151,-66.3877],VPR=[0,0,0],VPD=192.044): In this example we request a sun/carrier ratio of 3.6 and get exactly that ratio.  The carrier shown as the blue pentagon moves very slowly as the central sun turns.  The ring is fixed.  
 //   mod=1;
 //   gear_data = planetary_gears(mod=mod, n=5, max_teeth=70, sun_carrier=3.6, gear_spin=3.6*360/5*$t);
 //   ring_gear2d(mod=mod, teeth=gear_data[1][1], profile_shift=gear_data[1][2], gear_spin=gear_data[1][3],backing=2);
@@ -3502,13 +3502,14 @@ function _gear_tooth_profile(
 //   color("red")move_copies(gear_data[2][4])
 //       spur_gear2d(mod=mod, teeth=gear_data[2][1], profile_shift=gear_data[2][2], gear_spin=gear_data[2][3][$idx]);
 // Example(3D,Med,NoAxes,Anim,Frames=7,FrameMS=50,VPT=[0.128673,0.24149,0.651451],VPR=[38.5,0,21],VPD=222.648): Here we request a sun/ring ratio of 3 and it is exactly achieved.  The carrier, shown in blue, is fixed.  This example is shown with helical gears.  It is important to remember to flip the sign of the helical angle for the planet gears.  
+//   $fn=81;
 //   mod=1;
 //   helical=25;
 //   gear_data = planetary_gears(mod=mod, n=4, max_teeth=82, sun_ring=3, helical=helical,gear_spin=360/27*$t);
 //   ring_gear(mod=mod, teeth=gear_data[1][1], profile_shift=gear_data[1][2], helical=helical, gear_spin=gear_data[1][3],backing=4,thickness=7);
 //   color("blue"){
 //       move_copies(gear_data[2][4]) cyl(h=12,d=4);
-//       down(10)linear_extrude(height=3)scale(1.2)polygon(gear_data[2][4]);
+//       down(9)linear_extrude(height=3)scale(1.2)polygon(gear_data[2][4]);
 //   }    
 //   spur_gear(mod=mod, teeth=gear_data[0][1], profile_shift=gear_data[0][2], helical=helical, gear_spin=gear_data[0][3]);  //sun
 //   color("red")move_copies(gear_data[2][4])

From 296b8e2dd2fe1ea1b37fd9a60b6a40520db6bc10 Mon Sep 17 00:00:00 2001
From: adrianVmariano <adrianVmariano@users.noreply.github.com>
Date: Mon, 11 Dec 2023 01:03:17 +0000
Subject: [PATCH 7/8] Version Bump

---
 version.scad | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/version.scad b/version.scad
index a122434..85ecc23 100644
--- a/version.scad
+++ b/version.scad
@@ -9,7 +9,7 @@
 //////////////////////////////////////////////////////////////////////
 
 
-BOSL_VERSION = [2,0,662];
+BOSL_VERSION = [2,0,663];
 
 
 // Section: BOSL Library Version Functions

From 8a84e05788319bbfab2b7ef004e984f7bb671b1f Mon Sep 17 00:00:00 2001
From: revarbat <revarbat@users.noreply.github.com>
Date: Tue, 12 Dec 2023 23:22:42 +0000
Subject: [PATCH 8/8] Version Bump

---
 version.scad | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/version.scad b/version.scad
index 196ab5b..dd037bd 100644
--- a/version.scad
+++ b/version.scad
@@ -9,7 +9,7 @@
 //////////////////////////////////////////////////////////////////////
 
 
-BOSL_VERSION = [2,0,664];
+BOSL_VERSION = [2,0,665];
 
 
 // Section: BOSL Library Version Functions