2019-06-08 17:10:47 -04:00
|
|
|
//
|
|
|
|
// NopSCADlib Copyright Chris Palmer 2018
|
|
|
|
// nop.head@gmail.com
|
|
|
|
// hydraraptor.blogspot.com
|
|
|
|
//
|
|
|
|
// This file is part of NopSCADlib.
|
|
|
|
//
|
|
|
|
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
|
|
|
|
// GNU General Public License as published by the Free Software Foundation, either version 3 of
|
|
|
|
// the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
|
|
|
// If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
//
|
|
|
|
|
|
|
|
//
|
|
|
|
//! Tubing and sleeving. The internal diameter can be forced to stretch it over something.
|
|
|
|
//
|
2020-02-29 12:52:36 -05:00
|
|
|
include <../utils/core/core.scad>
|
2020-11-13 04:35:56 -05:00
|
|
|
include <../utils/tube.scad>
|
2019-06-08 17:10:47 -04:00
|
|
|
|
|
|
|
function tubing_material(type) = type[1]; //! Material description
|
|
|
|
function tubing_od(type) = type[2]; //! Outside diameter
|
|
|
|
function tubing_id(type) = type[3]; //! Inside diameter
|
|
|
|
function tubing_colour(type) = type[4]; //! Colour
|
|
|
|
|
2020-08-13 06:56:53 -04:00
|
|
|
function tubing_or(type) = tubing_od(type) / 2; //! Outside radius
|
|
|
|
|
|
|
|
module tubing(type, length = 15, forced_id = 0, center = true) { //! Draw specified tubing with optional forced internal diameter
|
2019-06-08 17:10:47 -04:00
|
|
|
original_od = tubing_od(type);
|
|
|
|
original_id = tubing_id(type);
|
|
|
|
id = forced_id ? forced_id : original_id;
|
|
|
|
od = original_od + id - original_id;
|
|
|
|
if(tubing_material(type) == "Heatshrink sleeving")
|
|
|
|
vitamin(str("tubing(", type[0], arg(length, 15), "): ", tubing_material(type), " ID ", original_id, "mm x ",length, "mm"));
|
|
|
|
else
|
|
|
|
vitamin(str("tubing(", type[0], arg(length, 15), "): ", tubing_material(type), " OD ", original_od, "mm ID ", original_id,"mm x ",length, "mm"));
|
2020-11-13 04:35:56 -05:00
|
|
|
|
|
|
|
if(tubing_material(type) == "Carbon fiber")
|
2020-11-13 14:27:02 -05:00
|
|
|
woven_tube(od / 2, id /2, center = center, length, colour = tubing_colour(type));
|
2020-11-13 04:35:56 -05:00
|
|
|
else
|
|
|
|
color(tubing_colour(type))
|
|
|
|
linear_extrude(length, center = center, convexity = 4)
|
|
|
|
difference() {
|
|
|
|
circle(d = od);
|
|
|
|
circle(d = id);
|
|
|
|
}
|
2019-06-08 17:10:47 -04:00
|
|
|
}
|
2020-11-13 04:35:56 -05:00
|
|
|
|