From 728b7adf3807b5374c0835302102c43bb4ef3170 Mon Sep 17 00:00:00 2001 From: Martin Budden Date: Tue, 14 Jan 2020 11:26:21 +0000 Subject: [PATCH] Add ability to display filament on spool. --- vitamins/spool.scad | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/vitamins/spool.scad b/vitamins/spool.scad index cbe563a..5e0493a 100644 --- a/vitamins/spool.scad +++ b/vitamins/spool.scad @@ -32,7 +32,7 @@ function spool_hub_taper(type) = type[8]; //! Diameter at which it tapers do function spool_height(type) = spool_width(type) + 2 * spool_hub_thickness(type); //! Outside width function spool_pitch(type) = spool_width(type) + spool_rim_thickness(type); //! Spacing of the rims -module spool(type) { //! Draw specified spool +module spool(type, filament_depth = 0, filament_color = "white") { //! Draw specified spool with optional filament vitamin(str("spool(", type[0], "): Filament spool ", spool_diameter(type), " x ", spool_width(type))); h = spool_height(type); @@ -57,4 +57,13 @@ module spool(type) { //! Draw specified spool [r3, h - spool_hub_thickness(type) + spool_rim_thickness(type)], [r2, h], ]); + + if (filament_depth) { + color(filament_color) translate_z(-h / 2 + spool_rim_thickness(type)) linear_extrude(spool_width(type)) { + difference() { + circle(d = (r5 + filament_depth) * 2); + circle(d = r5 * 2); + } + } + } }