mirror of
https://github.com/DJSundog/NopSCADlib.git
synced 2025-02-18 08:33:45 -05:00
Colour now always spelt colour except the call to color().
This commit is contained in:
parent
e8abcde52f
commit
654571a70e
@ -2387,10 +2387,10 @@ Linear rails with carriages.
|
|||||||
### Modules
|
### Modules
|
||||||
| Module | Description |
|
| Module | Description |
|
||||||
|:--- |:--- |
|
|:--- |:--- |
|
||||||
| ```carriage(type, rail, end_color = grey20, wiper_color = grey20)``` | Draw the specified carriage |
|
| ```carriage(type, rail, end_colour = grey20, wiper_colour = grey20)``` | Draw the specified carriage |
|
||||||
| ```carriage_hole_positions(type)``` | Position children over screw holes |
|
| ```carriage_hole_positions(type)``` | Position children over screw holes |
|
||||||
| ```rail(type, length)``` | Draw the specified rail |
|
| ```rail(type, length)``` | Draw the specified rail |
|
||||||
| ```rail_assembly(type, length, pos, carriage_end_color = grey20, carriage_wiper_color = grey20)``` | Rail and carriage assembly |
|
| ```rail_assembly(type, length, pos, carriage_end_colour = grey20, carriage_wiper_colour = grey20)``` | Rail and carriage assembly |
|
||||||
| ```rail_hole_positions(type, length, first = 0, screws = 100, both_ends = true)``` | Position children over screw holes |
|
| ```rail_hole_positions(type, length, first = 0, screws = 100, both_ends = true)``` | Position children over screw holes |
|
||||||
| ```rail_screws(type, length, thickness, screws = 100)``` | Place screws in the rail |
|
| ```rail_screws(type, length, thickness, screws = 100)``` | Place screws in the rail |
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ function cable_strip_thickness() = cable_strip_thickness;
|
|||||||
use <../utils/bezier.scad>
|
use <../utils/bezier.scad>
|
||||||
use <../utils/sweep.scad>
|
use <../utils/sweep.scad>
|
||||||
|
|
||||||
cable_strip_color = "green";
|
cable_strip_colour = "green";
|
||||||
|
|
||||||
function cable_strip_control_points(depth, min_z, pos) = let(z = min(min_z, min_z + pos))
|
function cable_strip_control_points(depth, min_z, pos) = let(z = min(min_z, min_z + pos))
|
||||||
[
|
[
|
||||||
@ -62,7 +62,7 @@ module bezier_cable_strip(ways, depth, length, below, extra, pos = 0) { //! Draw
|
|||||||
|
|
||||||
path = [v[0] + extra_v, each bezier_path(v, steps), v[3] + extra_v];
|
path = [v[0] + extra_v, each bezier_path(v, steps), v[3] + extra_v];
|
||||||
|
|
||||||
color(cable_strip_color)
|
color(cable_strip_colour)
|
||||||
translate_z(-extra)
|
translate_z(-extra)
|
||||||
sweep(path, rectangle_points(width, thickness));
|
sweep(path, rectangle_points(width, thickness));
|
||||||
*echo(cable_strip_lengh = length);
|
*echo(cable_strip_lengh = length);
|
||||||
@ -89,7 +89,7 @@ module cable_strip(ways, depth, travel, extra = 15, pos = 0) { //! Draw a cable
|
|||||||
|
|
||||||
vitamin(str("cable_strip(", ways, ", ", depth, ", ", travel, arg(extra, 15), "): Polypropylene strip ", total, "mm x ", w, "mm x ", thickness, "mm"));
|
vitamin(str("cable_strip(", ways, ", ", depth, ", ", travel, arg(extra, 15), "): Polypropylene strip ", total, "mm x ", w, "mm x ", thickness, "mm"));
|
||||||
|
|
||||||
color(cable_strip_color) linear_extrude(w, center = true, convexity = 4)
|
color(cable_strip_colour) linear_extrude(w, center = true, convexity = 4)
|
||||||
difference() {
|
difference() {
|
||||||
union() {
|
union() {
|
||||||
translate([-bottom, radius])
|
translate([-bottom, radius])
|
||||||
@ -142,7 +142,7 @@ module elliptical_cable_strip(ways, p1, p2, pmax, extra = 15) {
|
|||||||
[delta[2] / delta[0], 0, 1, delta[2] / 2],
|
[delta[2] / delta[0], 0, 1, delta[2] / 2],
|
||||||
[0, 0, 0, 1] ])
|
[0, 0, 0, 1] ])
|
||||||
|
|
||||||
color(cable_strip_color) linear_extrude(w, center = true, convexity = 4)
|
color(cable_strip_colour) linear_extrude(w, center = true, convexity = 4)
|
||||||
difference() {
|
difference() {
|
||||||
union() {
|
union() {
|
||||||
square([(a + thickness) * 2, extra * 2], center = true);
|
square([(a + thickness) * 2, extra * 2], center = true);
|
||||||
|
@ -23,9 +23,9 @@
|
|||||||
include <../utils/core/core.scad>
|
include <../utils/core/core.scad>
|
||||||
use <../utils/thread.scad>
|
use <../utils/thread.scad>
|
||||||
|
|
||||||
d_pillar_color = grey90;
|
d_pillar_colour = grey90;
|
||||||
d_plug_shell_color = grey80;
|
d_plug_shell_colour = grey80;
|
||||||
d_plug_insulator_color = grey20;
|
d_plug_insulator_colour = grey20;
|
||||||
|
|
||||||
function d_flange_length(type) = type[1]; //! Length of the flange
|
function d_flange_length(type) = type[1]; //! Length of the flange
|
||||||
function d_lengths(type) = type[2]; //! Lengths of the D for plug and socket
|
function d_lengths(type) = type[2]; //! Lengths of the D for plug and socket
|
||||||
@ -56,12 +56,12 @@ module d_pillar() { //! Draw a pillar for a D-connector
|
|||||||
|
|
||||||
translate_z(-screw_length)
|
translate_z(-screw_length)
|
||||||
if(show_threads)
|
if(show_threads)
|
||||||
male_metric_thread(screw, pitch, screw_length, false, top = 0, colour = d_pillar_color);
|
male_metric_thread(screw, pitch, screw_length, false, top = 0, colour = d_pillar_colour);
|
||||||
else
|
else
|
||||||
color(d_pillar_color)
|
color(d_pillar_colour)
|
||||||
cylinder(d = screw, h = screw_length + 1);
|
cylinder(d = screw, h = screw_length + 1);
|
||||||
|
|
||||||
color(d_pillar_color) {
|
color(d_pillar_colour) {
|
||||||
linear_extrude(height)
|
linear_extrude(height)
|
||||||
difference() {
|
difference() {
|
||||||
circle(r = rad, $fn = 6);
|
circle(r = rad, $fn = 6);
|
||||||
@ -69,7 +69,7 @@ module d_pillar() { //! Draw a pillar for a D-connector
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(show_threads)
|
if(show_threads)
|
||||||
female_metric_thread(screw, pitch, height, false, colour = d_pillar_color);
|
female_metric_thread(screw, pitch, height, false, colour = d_pillar_colour);
|
||||||
}
|
}
|
||||||
|
|
||||||
module d_plug(type, socket = false, pcb = false, idc = false) { //! Draw specified D plug, which can be IDC, PCB or plain solder bucket
|
module d_plug(type, socket = false, pcb = false, idc = false) { //! Draw specified D plug, which can be IDC, PCB or plain solder bucket
|
||||||
@ -106,7 +106,7 @@ module d_plug(type, socket = false, pcb = false, idc = false) { //! Draw specifi
|
|||||||
//
|
//
|
||||||
// Shell
|
// Shell
|
||||||
//
|
//
|
||||||
color(d_plug_shell_color) {
|
color(d_plug_shell_colour) {
|
||||||
linear_extrude( d_flange_thickness(type))
|
linear_extrude( d_flange_thickness(type))
|
||||||
difference() {
|
difference() {
|
||||||
rounded_square([flange_length, flange_width], 2);
|
rounded_square([flange_length, flange_width], 2);
|
||||||
@ -130,7 +130,7 @@ module d_plug(type, socket = false, pcb = false, idc = false) { //! Draw specifi
|
|||||||
//
|
//
|
||||||
// Insulator
|
// Insulator
|
||||||
//
|
//
|
||||||
color(d_plug_insulator_color) {
|
color(d_plug_insulator_colour) {
|
||||||
translate_z(d_flange_thickness(type) + eps)
|
translate_z(d_flange_thickness(type) + eps)
|
||||||
rotate([0, 180, 0])
|
rotate([0, 180, 0])
|
||||||
linear_extrude(back_height + 1 + d_flange_thickness(type), convexity = 5)
|
linear_extrude(back_height + 1 + d_flange_thickness(type), convexity = 5)
|
||||||
|
@ -25,7 +25,7 @@ use <../utils/tube.scad>
|
|||||||
use <washer.scad>
|
use <washer.scad>
|
||||||
use <ball_bearing.scad>
|
use <ball_bearing.scad>
|
||||||
|
|
||||||
kp_pillow_block_color = grey70;
|
kp_pillow_block_colour = grey70;
|
||||||
|
|
||||||
function kp_diameter(type) = type[1]; //! Rod hole diameter
|
function kp_diameter(type) = type[1]; //! Rod hole diameter
|
||||||
function kp_hole_offset(type) = type[2]; //! Rod hole offset
|
function kp_hole_offset(type) = type[2]; //! Rod hole offset
|
||||||
@ -50,7 +50,7 @@ module kp_pillow_block(type) { //! Draw the KP pillow block
|
|||||||
b = type[11];
|
b = type[11];
|
||||||
bolthole_radius = type[12];
|
bolthole_radius = type[12];
|
||||||
|
|
||||||
color(kp_pillow_block_color)
|
color(kp_pillow_block_colour)
|
||||||
translate([0, -H, 0]) {
|
translate([0, -H, 0]) {
|
||||||
fillet = 1;
|
fillet = 1;
|
||||||
squareSizeX = (L - H0) / 2 + fillet;
|
squareSizeX = (L - H0) / 2 + fillet;
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
//
|
//
|
||||||
include <../utils/core/core.scad>
|
include <../utils/core/core.scad>
|
||||||
|
|
||||||
microswitch_contact_color = brass;
|
microswitch_contact_colour = brass;
|
||||||
|
|
||||||
function microswitch_thickness(type) = type[2]; //! Body thickness
|
function microswitch_thickness(type) = type[2]; //! Body thickness
|
||||||
function microswitch_width(type) = type[3]; //! Body width
|
function microswitch_width(type) = type[3]; //! Body width
|
||||||
@ -81,7 +81,7 @@ module microswitch(type) { //! Draw specified microswitch
|
|||||||
circle(d = d);
|
circle(d = d);
|
||||||
}
|
}
|
||||||
|
|
||||||
color(microswitch_contact_color) // yellow contacts
|
color(microswitch_contact_colour) // yellow contacts
|
||||||
for(pos = microswitch_legs(type))
|
for(pos = microswitch_legs(type))
|
||||||
translate(pos) {
|
translate(pos) {
|
||||||
leg = microswitch_leg(type);
|
leg = microswitch_leg(type);
|
||||||
|
@ -65,7 +65,7 @@ module carriage_hole_positions(type) { //! Position children over screw holes
|
|||||||
children();
|
children();
|
||||||
}
|
}
|
||||||
|
|
||||||
module carriage(type, rail, end_color = grey20, wiper_color = grey20) { //! Draw the specified carriage
|
module carriage(type, rail, end_colour = grey20, wiper_colour = grey20) { //! Draw the specified carriage
|
||||||
total_l = carriage_length(type);
|
total_l = carriage_length(type);
|
||||||
block_l = carriage_block_length(type);
|
block_l = carriage_block_length(type);
|
||||||
block_w = carriage_width(type);
|
block_w = carriage_width(type);
|
||||||
@ -104,13 +104,13 @@ module carriage(type, rail, end_color = grey20, wiper_color = grey20) { //! Draw
|
|||||||
|
|
||||||
module carriage_end(type, end_w, end_h, end_l) {
|
module carriage_end(type, end_w, end_h, end_l) {
|
||||||
wiper_length = 0.5;
|
wiper_length = 0.5;
|
||||||
color(wiper_color) translate_z(-end_l/2) linear_extrude(wiper_length)
|
color(wiper_colour) translate_z(-end_l/2) linear_extrude(wiper_length)
|
||||||
difference() {
|
difference() {
|
||||||
translate([-end_w/2, carriage_clearance(type)])
|
translate([-end_w/2, carriage_clearance(type)])
|
||||||
square([end_w, end_h]);
|
square([end_w, end_h]);
|
||||||
cutout();
|
cutout();
|
||||||
}
|
}
|
||||||
color(end_color) translate_z(wiper_length-end_l/2) linear_extrude(end_l-wiper_length)
|
color(end_colour) translate_z(wiper_length-end_l/2) linear_extrude(end_l-wiper_length)
|
||||||
difference() {
|
difference() {
|
||||||
translate([-end_w/2, carriage_clearance(type)])
|
translate([-end_w/2, carriage_clearance(type)])
|
||||||
square([end_w, end_h]);
|
square([end_w, end_h]);
|
||||||
@ -166,11 +166,11 @@ module rail(type, length) { //! Draw the specified rail
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module rail_assembly(type, length, pos, carriage_end_color = grey20, carriage_wiper_color = grey20) { //! Rail and carriage assembly
|
module rail_assembly(type, length, pos, carriage_end_colour = grey20, carriage_wiper_colour = grey20) { //! Rail and carriage assembly
|
||||||
rail(type, length);
|
rail(type, length);
|
||||||
|
|
||||||
translate([pos, 0])
|
translate([pos, 0])
|
||||||
carriage(rail_carriage(type), type, carriage_end_color, carriage_wiper_color);
|
carriage(rail_carriage(type), type, carriage_end_colour, carriage_wiper_colour);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ function scs_circlip(type) = type[15]; //! Circlip used
|
|||||||
function scs_spacer(type) = type[16]; //! Spacer used in long bearings
|
function scs_spacer(type) = type[16]; //! Spacer used in long bearings
|
||||||
|
|
||||||
|
|
||||||
sks_bearing_block_color = grey90;
|
sks_bearing_block_colour = grey90;
|
||||||
|
|
||||||
module scs_bearing_block(type) { //! Draw the specified SCS bearing block
|
module scs_bearing_block(type) { //! Draw the specified SCS bearing block
|
||||||
vitamin(str("scs_bearing_block(", type[0], "): ", type[0], " bearing block"));
|
vitamin(str("scs_bearing_block(", type[0], "): ", type[0], " bearing block"));
|
||||||
@ -71,7 +71,7 @@ module scs_bearing_block(type) { //! Draw the specified SCS bearing block
|
|||||||
boltHoleRadius = screw_clearance_radius(S1);
|
boltHoleRadius = screw_clearance_radius(S1);
|
||||||
footHeight = min(0.75, (G - bearing_dia(bearing) - 1.5) / 2); // estimate, not specified on drawings
|
footHeight = min(0.75, (G - bearing_dia(bearing) - 1.5) / 2); // estimate, not specified on drawings
|
||||||
|
|
||||||
color(sks_bearing_block_color) {
|
color(sks_bearing_block_colour) {
|
||||||
linear_extrude(L, center = true) {
|
linear_extrude(L, center = true) {
|
||||||
bearingRadius = bearing_dia(bearing) / 2;
|
bearingRadius = bearing_dia(bearing) / 2;
|
||||||
// center section with bearing hole
|
// center section with bearing hole
|
||||||
|
@ -24,7 +24,7 @@ include <../utils/fillet.scad>
|
|||||||
|
|
||||||
use <washer.scad>
|
use <washer.scad>
|
||||||
|
|
||||||
sk_bracket_color = grey70;
|
sk_bracket_colour = grey70;
|
||||||
|
|
||||||
function sk_diameter(type) = type[1]; //! Rod hole diameter
|
function sk_diameter(type) = type[1]; //! Rod hole diameter
|
||||||
function sk_hole_offset(type) = type[2]; //! Rod hole offset
|
function sk_hole_offset(type) = type[2]; //! Rod hole offset
|
||||||
@ -47,7 +47,7 @@ module sk_bracket(type) { //! SK shaft support bracket
|
|||||||
S = type[10];
|
S = type[10];
|
||||||
bolthole_radius = type[11];
|
bolthole_radius = type[11];
|
||||||
|
|
||||||
color(sk_bracket_color) {
|
color(sk_bracket_colour) {
|
||||||
translate([0 , -h, 0]) {
|
translate([0 , -h, 0]) {
|
||||||
fillet = 0.5;
|
fillet = 0.5;
|
||||||
rotate([-90, 0, 0])
|
rotate([-90, 0, 0])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user