mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-08-06 23:46:30 +02:00
Added tubing_or() and center option.
This commit is contained in:
@@ -3586,10 +3586,15 @@ Tubing and sleeving. The internal diameter can be forced to stretch it over some
|
|||||||
| ```tubing_material(type)``` | Material description |
|
| ```tubing_material(type)``` | Material description |
|
||||||
| ```tubing_od(type)``` | Outside diameter |
|
| ```tubing_od(type)``` | Outside diameter |
|
||||||
|
|
||||||
|
### Functions
|
||||||
|
| Function | Description |
|
||||||
|
|:--- |:--- |
|
||||||
|
| ```tubing_or(type)``` | Outside radius |
|
||||||
|
|
||||||
### Modules
|
### Modules
|
||||||
| Module | Description |
|
| Module | Description |
|
||||||
|:--- |:--- |
|
|:--- |:--- |
|
||||||
| ```tubing(type, length = 15, forced_id = 0)``` | Draw specified tubing with optional forced internal diameter |
|
| ```tubing(type, length = 15, forced_id = 0, center = true)``` | Draw specified tubing with optional forced internal diameter |
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
@@ -27,7 +27,9 @@ function tubing_od(type) = type[2]; //! Outside diameter
|
|||||||
function tubing_id(type) = type[3]; //! Inside diameter
|
function tubing_id(type) = type[3]; //! Inside diameter
|
||||||
function tubing_colour(type) = type[4]; //! Colour
|
function tubing_colour(type) = type[4]; //! Colour
|
||||||
|
|
||||||
module tubing(type, length = 15, forced_id = 0) { //! Draw specified tubing with optional forced internal diameter
|
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
|
||||||
original_od = tubing_od(type);
|
original_od = tubing_od(type);
|
||||||
original_id = tubing_id(type);
|
original_id = tubing_id(type);
|
||||||
id = forced_id ? forced_id : original_id;
|
id = forced_id ? forced_id : original_id;
|
||||||
@@ -37,7 +39,7 @@ module tubing(type, length = 15, forced_id = 0) { //! Draw specified tubing with
|
|||||||
else
|
else
|
||||||
vitamin(str("tubing(", type[0], arg(length, 15), "): ", tubing_material(type), " OD ", original_od, "mm ID ", original_id,"mm x ",length, "mm"));
|
vitamin(str("tubing(", type[0], arg(length, 15), "): ", tubing_material(type), " OD ", original_od, "mm ID ", original_id,"mm x ",length, "mm"));
|
||||||
color(tubing_colour(type))
|
color(tubing_colour(type))
|
||||||
linear_extrude(length, center = true, convexity = 4)
|
linear_extrude(length, center = center, convexity = 4)
|
||||||
difference() {
|
difference() {
|
||||||
circle(d = od);
|
circle(d = od);
|
||||||
circle(d = id);
|
circle(d = id);
|
||||||
|
Reference in New Issue
Block a user