mirror of
https://github.com/DJSundog/NopSCADlib.git
synced 2024-11-23 07:13:51 -05:00
Fixed some more colour spellings
This commit is contained in:
parent
654571a70e
commit
7b3d7fab55
@ -51,7 +51,7 @@ $fa = 6;
|
|||||||
$fs = extrusion_width / 2;
|
$fs = extrusion_width / 2;
|
||||||
|
|
||||||
function round_to_layer(z) = ceil(z / layer_height) * layer_height;
|
function round_to_layer(z) = ceil(z / layer_height) * layer_height;
|
||||||
// Some additional named colors
|
// Some additional named colours
|
||||||
grey20 = [0.2, 0.2, 0.2];
|
grey20 = [0.2, 0.2, 0.2];
|
||||||
grey30 = [0.3, 0.3, 0.3];
|
grey30 = [0.3, 0.3, 0.3];
|
||||||
grey40 = [0.4, 0.4, 0.4];
|
grey40 = [0.4, 0.4, 0.4];
|
||||||
|
12
readme.md
12
readme.md
@ -1905,7 +1905,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
|||||||
| Module | Description |
|
| Module | Description |
|
||||||
|:--- |:--- |
|
|:--- |:--- |
|
||||||
| ```barrel_jack(cutout = false)``` | Draw barrel power jack |
|
| ```barrel_jack(cutout = false)``` | Draw barrel power jack |
|
||||||
| ```buzzer(height, diameter, colour)``` | Draw PCB buzzer with specified height, diameter and color |
|
| ```buzzer(height, diameter, colour)``` | Draw PCB buzzer with specified height, diameter and colour |
|
||||||
| ```chip(length, width, thickness, colour, cutout = false)``` | Draw a coloured cube to represent a chip, or other rectangular component |
|
| ```chip(length, width, thickness, colour, cutout = false)``` | Draw a coloured cube to represent a chip, or other rectangular component |
|
||||||
| ```flat_flex(cutout = false)``` | Draw flat flexistrip connector as used on RPI0 |
|
| ```flat_flex(cutout = false)``` | Draw flat flexistrip connector as used on RPI0 |
|
||||||
| ```flex(cutout = false)``` | Draw flexistrip connector |
|
| ```flex(cutout = false)``` | Draw flexistrip connector |
|
||||||
@ -1991,7 +1991,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
|||||||
| Module | Description |
|
| Module | Description |
|
||||||
|:--- |:--- |
|
|:--- |:--- |
|
||||||
| ```barrel_jack(cutout = false)``` | Draw barrel power jack |
|
| ```barrel_jack(cutout = false)``` | Draw barrel power jack |
|
||||||
| ```buzzer(height, diameter, colour)``` | Draw PCB buzzer with specified height, diameter and color |
|
| ```buzzer(height, diameter, colour)``` | Draw PCB buzzer with specified height, diameter and colour |
|
||||||
| ```chip(length, width, thickness, colour, cutout = false)``` | Draw a coloured cube to represent a chip, or other rectangular component |
|
| ```chip(length, width, thickness, colour, cutout = false)``` | Draw a coloured cube to represent a chip, or other rectangular component |
|
||||||
| ```flat_flex(cutout = false)``` | Draw flat flexistrip connector as used on RPI0 |
|
| ```flat_flex(cutout = false)``` | Draw flat flexistrip connector as used on RPI0 |
|
||||||
| ```flex(cutout = false)``` | Draw flexistrip connector |
|
| ```flex(cutout = false)``` | Draw flexistrip connector |
|
||||||
@ -2749,7 +2749,7 @@ The "Soft" parameter can be used to determinesif the sheet material needs machin
|
|||||||
* If soft, wood screws will be used, with a pilot hole.
|
* If soft, wood screws will be used, with a pilot hole.
|
||||||
* If not soft, either tapped holes or a clearance hole and nuts will be used to retain screws.
|
* If not soft, either tapped holes or a clearance hole and nuts will be used to retain screws.
|
||||||
|
|
||||||
The "Color" parameter is a quad-array: [R, G, B, Alpha], or can be a named color, see [OpenSCAD_User_Manual](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#color).
|
The "Colour" parameter is a quad-array: [R, G, B, Alpha], or can be a named colour, see [OpenSCAD_User_Manual](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#color).
|
||||||
|
|
||||||
For speed sheets should be modelled in 2D by subtracting holes from 2D templates made by ```sheet_2D()``` and then extruded to 3D with ```render_2D_sheet()```.
|
For speed sheets should be modelled in 2D by subtracting holes from 2D templates made by ```sheet_2D()``` and then extruded to 3D with ```render_2D_sheet()```.
|
||||||
Note that modules that drill holes will return a 2D object if ```h``` is set to 0 to facilitate this.
|
Note that modules that drill holes will return a 2D object if ```h``` is set to 0 to facilitate this.
|
||||||
@ -2771,8 +2771,8 @@ Note that modules that drill holes will return a 2D object if ```h``` is set to
|
|||||||
### Modules
|
### Modules
|
||||||
| Module | Description |
|
| Module | Description |
|
||||||
|:--- |:--- |
|
|:--- |:--- |
|
||||||
| ```render_2D_sheet(type, color = false)``` | Extrude a 2D sheet template and give it the correct colour |
|
| ```render_2D_sheet(type, colour = false)``` | Extrude a 2D sheet template and give it the correct colour |
|
||||||
| ```render_sheet(type, color = false)``` | Render a sheet in the correct colour after holes have been subtracted |
|
| ```render_sheet(type, colour = false)``` | Render a sheet in the correct colour after holes have been subtracted |
|
||||||
| ```sheet(type, w, d, corners = [0, 0, 0, 0])``` | Draw specified sheet |
|
| ```sheet(type, w, d, corners = [0, 0, 0, 0])``` | Draw specified sheet |
|
||||||
| ```sheet_2D(type, w, d, corners = [0, 0, 0, 0])``` | 2D sheet template with specified size and optionally rounded corners |
|
| ```sheet_2D(type, w, d, corners = [0, 0, 0, 0])``` | 2D sheet template with specified size and optionally rounded corners |
|
||||||
|
|
||||||
@ -3492,7 +3492,7 @@ Just a BOM entry at the moment and cable bundle size functions for holes, plus c
|
|||||||
| ```cable_tie_holes(cable_r, h = 100)``` | Holes to thread a ziptie through a panel to make a cable tie. |
|
| ```cable_tie_holes(cable_r, h = 100)``` | Holes to thread a ziptie through a panel to make a cable tie. |
|
||||||
| ```mouse_hole(cable, h = 100, teardrop = false)``` | A mouse hole to allow a panel to go over a wire bundle. |
|
| ```mouse_hole(cable, h = 100, teardrop = false)``` | A mouse hole to allow a panel to go over a wire bundle. |
|
||||||
| ```ribbon_cable(ways, length)``` | Add ribbon cable to the BOM |
|
| ```ribbon_cable(ways, length)``` | Add ribbon cable to the BOM |
|
||||||
| ```wire(color, strands, length, strand = 0.2)``` | Add stranded wire to the BOM |
|
| ```wire(colour, strands, length, strand = 0.2)``` | Add stranded wire to the BOM |
|
||||||
|
|
||||||
![wire](tests/png/wire.png)
|
![wire](tests/png/wire.png)
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ module jack(cutout = false) { //! Draw 3.5mm jack
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module buzzer(height, diameter, colour) { //! Draw PCB buzzer with specified height, diameter and color
|
module buzzer(height, diameter, colour) { //! Draw PCB buzzer with specified height, diameter and colour
|
||||||
color (colour)
|
color (colour)
|
||||||
tube(or = diameter / 2, ir = height > 5 ? 1 : 0.75, h = height, center = false);
|
tube(or = diameter / 2, ir = height > 5 ? 1 : 0.75, h = height, center = false);
|
||||||
color("white")
|
color("white")
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
//! * If soft, wood screws will be used, with a pilot hole.
|
//! * If soft, wood screws will be used, with a pilot hole.
|
||||||
//! * If not soft, either tapped holes or a clearance hole and nuts will be used to retain screws.
|
//! * If not soft, either tapped holes or a clearance hole and nuts will be used to retain screws.
|
||||||
//!
|
//!
|
||||||
//! The "Color" parameter is a quad-array: [R, G, B, Alpha], or can be a named color, see [OpenSCAD_User_Manual](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#color).
|
//! The "Colour" parameter is a quad-array: [R, G, B, Alpha], or can be a named colour, see [OpenSCAD_User_Manual](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#color).
|
||||||
//!
|
//!
|
||||||
//! For speed sheets should be modelled in 2D by subtracting holes from 2D templates made by ```sheet_2D()``` and then extruded to 3D with ```render_2D_sheet()```.
|
//! For speed sheets should be modelled in 2D by subtracting holes from 2D templates made by ```sheet_2D()``` and then extruded to 3D with ```render_2D_sheet()```.
|
||||||
//! Note that modules that drill holes will return a 2D object if ```h``` is set to 0 to facilitate this.
|
//! Note that modules that drill holes will return a 2D object if ```h``` is set to 0 to facilitate this.
|
||||||
@ -78,11 +78,11 @@ module sheet(type, w, d, corners = [0, 0, 0, 0]) //! Draw specified sheet
|
|||||||
linear_extrude(sheet_thickness(type), center = true)
|
linear_extrude(sheet_thickness(type), center = true)
|
||||||
sheet_2D(type, w, d, corners);
|
sheet_2D(type, w, d, corners);
|
||||||
|
|
||||||
module render_sheet(type, color = false) //! Render a sheet in the correct colour after holes have been subtracted
|
module render_sheet(type, colour = false) //! Render a sheet in the correct colour after holes have been subtracted
|
||||||
color(color ? color : sheet_colour(type))
|
color(colour ? colour : sheet_colour(type))
|
||||||
render() children();
|
render() children();
|
||||||
|
|
||||||
module render_2D_sheet(type, color = false) //! Extrude a 2D sheet template and give it the correct colour
|
module render_2D_sheet(type, colour = false) //! Extrude a 2D sheet template and give it the correct colour
|
||||||
color(color ? color : sheet_colour(type))
|
color(colour ? colour : sheet_colour(type))
|
||||||
linear_extrude(sheet_thickness(type), center = true)
|
linear_extrude(sheet_thickness(type), center = true)
|
||||||
children();
|
children();
|
||||||
|
@ -23,8 +23,8 @@
|
|||||||
include <../utils/core/core.scad>
|
include <../utils/core/core.scad>
|
||||||
include <zipties.scad>
|
include <zipties.scad>
|
||||||
|
|
||||||
module wire(color, strands, length, strand = 0.2) //! Add stranded wire to the BOM
|
module wire(colour, strands, length, strand = 0.2) //! Add stranded wire to the BOM
|
||||||
vitamin(str(": Wire ", color, " ", strands, "/", strand, "mm strands, length ",length, "mm"));
|
vitamin(str(": Wire ", colour, " ", strands, "/", strand, "mm strands, length ",length, "mm"));
|
||||||
|
|
||||||
module ribbon_cable(ways, length) //! Add ribbon cable to the BOM
|
module ribbon_cable(ways, length) //! Add ribbon cable to the BOM
|
||||||
vitamin(str(": Ribbon cable ", ways, " way ", length, "mm"));
|
vitamin(str(": Ribbon cable ", ways, " way ", length, "mm"));
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
// If not, see <https://www.gnu.org/licenses/>.
|
// If not, see <https://www.gnu.org/licenses/>.
|
||||||
//
|
//
|
||||||
|
|
||||||
// [width, thickness, [latch_x, latch_y, latch_z], color, tail]
|
// [width, thickness, [latch_x, latch_y, latch_z], colour, tail]
|
||||||
small_ziptie = ["small_ziptie", 2.5, 1.0, [4.7, 4.25, 3.0], "white", 25];
|
small_ziptie = ["small_ziptie", 2.5, 1.0, [4.7, 4.25, 3.0], "white", 25];
|
||||||
ziptie_3mm = ["ziptie_3mm", 3.0, 1.0, [5.4, 5.44, 4.5], "white", 25];
|
ziptie_3mm = ["ziptie_3mm", 3.0, 1.0, [5.4, 5.44, 4.5], "white", 25];
|
||||||
ziptie_3p6mm = ["ziptie_3p6mm", 3.6, 1.2, [6.4, 6.62, 4.7], "white", 25];
|
ziptie_3p6mm = ["ziptie_3p6mm", 3.6, 1.2, [6.4, 6.62, 4.7], "white", 25];
|
||||||
|
Loading…
Reference in New Issue
Block a user