From 17afd6b5a64fda525ff58c1d3a99d9a290b270cc Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Mon, 25 May 2020 19:07:02 -0400 Subject: [PATCH] Add comments to spiral generation code (surrounding v3, which is where the most significant performance is gained). Change gnal_v2 to use library gnal_v2.scad --- 100ft_v2/gnal_100ft.scad | 2 +- 50ft_v2/gnal_50ft.scad | 2 +- spiral/spiral_3.scad | 8 ++++++++ spiral/spiral_4.scad | 4 +++- spiral/spiral_5.scad | 5 ++++- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/100ft_v2/gnal_100ft.scad b/100ft_v2/gnal_100ft.scad index 26b0e6b..62a5fbd 100644 --- a/100ft_v2/gnal_100ft.scad +++ b/100ft_v2/gnal_100ft.scad @@ -1,6 +1,6 @@ //V2 -include <../libraries/gnal.scad>; +include <../libraries/gnal_v2.scad>; SPOKE_COUNT = 24; PART=""; diff --git a/50ft_v2/gnal_50ft.scad b/50ft_v2/gnal_50ft.scad index 2f5a0eb..eacc1a9 100644 --- a/50ft_v2/gnal_50ft.scad +++ b/50ft_v2/gnal_50ft.scad @@ -1,6 +1,6 @@ //V2 -include <../libraries/gnal.scad>; +include <../libraries/gnal_v2.scad>; $fn = 20; diff --git a/spiral/spiral_3.scad b/spiral/spiral_3.scad index 2ae899d..be99475 100644 --- a/spiral/spiral_3.scad +++ b/spiral/spiral_3.scad @@ -5,6 +5,14 @@ $fn=FN; include <../libraries/path_extrude.scad>; +/** + * This approach is the fastest by far (!!!). Unlike spiral_4, this does not adjust + * the $fn value as the spiral grows in diameter, but simply uses it as a constant + * for all spirals. This means that the innermost spiral will have n=$fn facets and + * the outermost facets will have the same number. Need to find a hybrid between + * this and #4. + **/ + module spiral (count = 40, start_d = 48, spacing = 2.075) { //$fn = 80; diff --git a/spiral/spiral_4.scad b/spiral/spiral_4.scad index 99efd48..614550d 100644 --- a/spiral/spiral_4.scad +++ b/spiral/spiral_4.scad @@ -5,7 +5,9 @@ $fn=FN; include <../libraries/path_extrude.scad>; -//Distinction from v3: use of for loop and union to join rotations +/** + * Distinction from spiral_3: use of for loop and union to join rotations. + **/ module spiral (count = 40, start_d = 48, spacing = 2.075) { facet_size = 30; diff --git a/spiral/spiral_5.scad b/spiral/spiral_5.scad index 18fb11e..de51b2f 100644 --- a/spiral/spiral_5.scad +++ b/spiral/spiral_5.scad @@ -5,7 +5,10 @@ $fn=FN; include <../libraries/path_extrude.scad>; -//Distinction from v4 compressed spiralPath generation into single line +/** + * Distinction from v4 compressed spiralPath generation into single line. This refactor + * required repeating calculations that were assigned to variables in spiral_4. + **/ module spiral (count = 40, start_d = 48, spacing = 2.095) { facet_size = 10;