Merge branch 'spool_filament' of https://github.com/martinbudden/NopSCADlib into martinbudden-spool_filament
This commit is contained in:
commit
3d8a9ec8aa
|
@ -20,6 +20,7 @@
|
|||
//! Filament spool models
|
||||
|
||||
include <../core.scad>
|
||||
include <../utils/tube.scad>
|
||||
|
||||
function spool_diameter(type) = type[1]; //! Outside diameter
|
||||
function spool_width(type) = type[2]; //! Internal width
|
||||
|
@ -32,7 +33,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 +58,8 @@ module spool(type) { //! Draw specified spool
|
|||
[r3, h - spool_hub_thickness(type) + spool_rim_thickness(type)],
|
||||
[r2, h],
|
||||
]);
|
||||
|
||||
if(filament_depth)
|
||||
color(filament_color)
|
||||
tube(r5 + filament_depth, r5, spool_width(type));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue