mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-09-06 05:12:54 +02:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8ea7d92997 | ||
|
e386ce7927 | ||
|
fbc0b1d27d | ||
|
5f287ef8ad | ||
|
c155e95599 |
@@ -28,7 +28,6 @@ include <../vitamins/inserts.scad>
|
||||
foot = [25, 12, 3, 2, M4_cap_screw, 10];
|
||||
insert_foot = [20, 10, 0, 2, M3_cap_screw, 10];
|
||||
|
||||
function foot() = foot; //! Default foot used unless a list of parameters is passed
|
||||
function insert_foot() = insert_foot; //! Default foot with insert
|
||||
|
||||
function foot_diameter(type = foot) = type[0]; //! Outside maximum diameter
|
||||
|
@@ -147,7 +147,7 @@ module ssr_shroud(type, cable_d, name) { //! Generate the STL file for a spec
|
||||
module ssr_shroud_assembly(type, cable_d, name) //! The printed parts with inserts fitted
|
||||
assembly(str("ssr_shroud_", name)) {
|
||||
|
||||
translate_z(ssr_height(type) + top)
|
||||
translate_z(ssr_shroud_height(type))
|
||||
vflip()
|
||||
color(pp1_colour) ssr_shroud(type, cable_d, name);
|
||||
|
||||
|
@@ -3410,7 +3410,6 @@ inserts don't grip well in rubber.
|
||||
### Functions
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| ```foot()``` | Default foot used unless a list of parameters is passed |
|
||||
| ```insert_foot()``` | Default foot with insert |
|
||||
|
||||
### Modules
|
||||
@@ -4220,12 +4219,17 @@ Global constants, functions and modules. This file is used directly or indirectl
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| ```Len(x)``` | Returns the length of a list or 0 if ```x``` is not a list |
|
||||
| ```cm(x)``` | cm to mm conversion |
|
||||
| ```echoit(x)``` | Echo expression and return it, useful for debugging |
|
||||
| ```foot(x)``` | Foot to mm conversion |
|
||||
| ```in(list, x)``` | Returns true if ```x``` is an element in the ```list``` |
|
||||
| ```inch(x)``` | Inch to mm conversion |
|
||||
| ```inch(x)``` | Inch to mm conversion (For fractional inches, 'inch(1 + 7/8)' will work as expected.) |
|
||||
| ```m(x)``` | m to mm conversion |
|
||||
| ```mm(x)``` | Explicit mm specified |
|
||||
| ```r2sides(r)``` | Replicates the OpenSCAD logic to calculate the number of sides from the radius |
|
||||
| ```r2sides4n(r)``` | Round up the number of sides to a multiple of 4 to ensure points land on all axes |
|
||||
| ```sqr(x)``` | Returns the square of ```x``` |
|
||||
| ```yard(x)``` | Yard to mm conversion |
|
||||
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
Binary file not shown.
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
@@ -22,8 +22,14 @@
|
||||
//
|
||||
include <../../global_defs.scad>
|
||||
|
||||
function inch(x) = x * 25.4; //! Inch to mm conversion (For fractional inches, 'inch(1 + 7/8)' will work as expected.)
|
||||
function foot(x) = x * 25.4 * 12; //! Foot to mm conversion
|
||||
function yard(x) = x * 25.4 * 12 * 3; //! Yard to mm conversion
|
||||
function mm(x) = x; //! Explicit mm specified
|
||||
function cm(x) = x * 10.0; //! cm to mm conversion
|
||||
function m(x) = x * 1000.0; //! m to mm conversion
|
||||
|
||||
function sqr(x) = x * x; //! Returns the square of ```x```
|
||||
function inch(x) = x * 25.4; //! Inch to mm conversion
|
||||
function echoit(x) = echo(x) x; //! Echo expression and return it, useful for debugging
|
||||
function in(list, x) = !!len([for(v = list) if(v == x) true]); //! Returns true if ```x``` is an element in the ```list```
|
||||
function Len(x) = is_list(x) ? len(x) : 0; //! Returns the length of a list or 0 if ```x``` is not a list
|
||||
|
@@ -31,4 +31,4 @@ LED10mm = ["LED10mm", 10, 11.0, 2.0, 13.5, 2.54, 0.4];
|
||||
|
||||
LEDs = [LED3mm, LED5mm, LED10mm];
|
||||
|
||||
use <LED.scad>
|
||||
use <led.scad>
|
||||
|
@@ -38,8 +38,7 @@ function cable_wire_size(cable) = cable[1]; //! Size of each wire in a bundle
|
||||
// numbers from http://mathworld.wolfram.com/CirclePacking.html
|
||||
function cable_radius(cable) = [0, 1, 2, 2.15, 2.41, 2.7, 3, 3, 3.3][cable_wires(cable)] * cable_wire_size(cable) / 2; //! Radius of a bundle of wires, see <http://mathworld.wolfram.com/CirclePacking.html>.
|
||||
|
||||
function wire_hole_radius(cable) = cable_radius(cable) + 0.5; //! Radius of a hole to accept a bundle of wires
|
||||
|
||||
function wire_hole_radius(cable) = ceil(2 * cable_radius(cable) +1) / 2; //! Radius of a hole to accept a bundle of wires
|
||||
|
||||
function cable_bundle(cable) = //! Arrangement of a bundle in a flat cable clip
|
||||
[[0,0], [1,1], [2,1], [2, 0.5 + sin(60)], [2,2], [3, 0.5 + sin(60)], [3,2]][cable_wires(cable)];
|
||||
|
Reference in New Issue
Block a user