mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-08-18 21:22:58 +02:00
Fixed typos, corrected vitamin call, added boilerplate, updated images and readme.
This commit is contained in:
BIN
libtest.png
BIN
libtest.png
Binary file not shown.
Before Width: | Height: | Size: 973 KiB After Width: | Height: | Size: 974 KiB |
@@ -85,6 +85,7 @@ use <tests/o_ring.scad>
|
||||
use <tests/opengrab.scad>
|
||||
use <tests/panel_meters.scad>
|
||||
use <tests/PCBs.scad>
|
||||
use <tests/photo_interrupters.scad>
|
||||
use <tests/pillars.scad>
|
||||
use <tests/pillow_blocks.scad>
|
||||
use <tests/potentiometers.scad>
|
||||
@@ -428,6 +429,9 @@ translate([x3 + 60, modules_y])
|
||||
translate([x3 + 90, modules_y])
|
||||
modules();
|
||||
|
||||
translate([x3 + 150, modules_y])
|
||||
photo_interrupters();
|
||||
|
||||
translate([x3, ssrs_y]) {
|
||||
ssrs();
|
||||
|
||||
|
55
readme.md
55
readme.md
@@ -42,12 +42,12 @@ A list of changes classified as breaking, additions or fixes is maintained in [C
|
||||
<tr><td> <a href = "#Extrusion_brackets">Extrusion_brackets</a> </td><td> <a href = "#PCBs">PCBs</a> </td><td> <a href = "#Terminals">Terminals</a> </td><td> <a href = "#PSU_shroud">PSU_shroud</a> </td><td> <a href = "#Sweep">Sweep</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Extrusions">Extrusions</a> </td><td> <a href = "#PSUs">PSUs</a> </td><td> <a href = "#Toggles">Toggles</a> </td><td> <a href = "#Pocket_handle">Pocket_handle</a> </td><td> <a href = "#Thread">Thread</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Fans">Fans</a> </td><td> <a href = "#Panel_meters">Panel_meters</a> </td><td> <a href = "#Transformers">Transformers</a> </td><td> <a href = "#Press_fit">Press_fit</a> </td><td> <a href = "#Tube">Tube</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Fastons">Fastons</a> </td><td> <a href = "#Pillars">Pillars</a> </td><td> <a href = "#Tubings">Tubings</a> </td><td> <a href = "#Printed_box">Printed_box</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#Pillow_blocks">Pillow_blocks</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td> <a href = "#Printed_pulleys">Printed_pulleys</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#Pin_headers">Pin_headers</a> </td><td> <a href = "#Veroboard">Veroboard</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Green_terminals">Green_terminals</a> </td><td> <a href = "#Potentiometers">Potentiometers</a> </td><td> <a href = "#Washers">Washers</a> </td><td> <a href = "#SSR_shroud">SSR_shroud</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Pulleys">Pulleys</a> </td><td> <a href = "#Wire">Wire</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Hygrometer">Hygrometer</a> </td><td></td><td> <a href = "#Zipties">Zipties</a> </td><td> <a href = "#Socket_box">Socket_box</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Fastons">Fastons</a> </td><td> <a href = "#Photo_interrupters">Photo_interrupters</a> </td><td> <a href = "#Tubings">Tubings</a> </td><td> <a href = "#Printed_box">Printed_box</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#Pillars">Pillars</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td> <a href = "#Printed_pulleys">Printed_pulleys</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#Pillow_blocks">Pillow_blocks</a> </td><td> <a href = "#Veroboard">Veroboard</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Green_terminals">Green_terminals</a> </td><td> <a href = "#Pin_headers">Pin_headers</a> </td><td> <a href = "#Washers">Washers</a> </td><td> <a href = "#SSR_shroud">SSR_shroud</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Potentiometers">Potentiometers</a> </td><td> <a href = "#Wire">Wire</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Hygrometer">Hygrometer</a> </td><td> <a href = "#Pulleys">Pulleys</a> </td><td> <a href = "#Zipties">Zipties</a> </td><td> <a href = "#Socket_box">Socket_box</a> </td><td></td><td></td></tr>
|
||||
<tr><td></td><td></td><td></td><td> <a href = "#Strap_handle">Strap_handle</a> </td><td></td><td></td></tr>
|
||||
</table>
|
||||
|
||||
@@ -2754,6 +2754,49 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| 4 | pcb_spacer4090.stl |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
<a name="Photo_interrupters"></a>
|
||||
## Photo_interrupters
|
||||
Photo interrupter modules popular in robot kits and from China.
|
||||
|
||||
[vitamins/photo_interrupters.scad](vitamins/photo_interrupters.scad) Object definitions.
|
||||
|
||||
[vitamins/photo_interrupter.scad](vitamins/photo_interrupter.scad) Implementation.
|
||||
|
||||
[tests/photo_interrupters.scad](tests/photo_interrupters.scad) Code for this example.
|
||||
|
||||
### Properties
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| `pi_base_height(type)` | Height of the base |
|
||||
| `pi_base_length(type)` | Length of the base |
|
||||
| `pi_base_width(type)` | Width of the base |
|
||||
| `pi_color(type)` | Color of photo interrupter |
|
||||
| `pi_gap_height(type)` | Height of the gap where the light can be interrupted |
|
||||
| `pi_gap_width(type)` | Width of the gap |
|
||||
| `pi_hole_diameter(type)` | Diameter of the mounting holes |
|
||||
| `pi_pcb(type)` | Parameter for the support PCB, created with pi_pcb |
|
||||
| `pi_stem_width(type)` | Width of the stems |
|
||||
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| `photo_interrupter(type)` | Draw the photo interrupter, with PCB |
|
||||
| `pi_cutout(type)` | Shape to subtract for fitting a photo interrupter |
|
||||
| `pi_hole_locations(type)` | Locations of photo interrupter mounting holes |
|
||||
| `pi_pcb(type)` | Draw the support PCB |
|
||||
| `pi_pcb_hole_locations(pcb)` | Locations of the PCB holes |
|
||||
|
||||

|
||||
|
||||
### Vitamins
|
||||
| Qty | Module call | BOM entry |
|
||||
| ---:|:--- |:---|
|
||||
| 1 | `photo_interrupter(PH1)` | PH1 Photo interrupter |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
|
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2018
|
||||
// NopSCADlib Copyright Chris Palmer 2023
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
@@ -22,7 +22,7 @@ include <../vitamins/photo_interrupters.scad>
|
||||
use <../utils/layout.scad>
|
||||
|
||||
module photo_interrupters()
|
||||
layout([for(l = photo_interrupters) pi_base_length(l)], 5)
|
||||
layout([for(l = photo_interrupters) pi_base_length(l)], 5, true)
|
||||
photo_interrupter(photo_interrupters[$i]);
|
||||
|
||||
photo_interrupters();
|
||||
|
BIN
tests/png/photo_interrupters.png
Normal file
BIN
tests/png/photo_interrupters.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
@@ -1,10 +1,32 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2023
|
||||
// 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/>.
|
||||
//
|
||||
|
||||
//
|
||||
//! Photo interrupter modules popular in robot kits and from China.
|
||||
//
|
||||
include <../utils/core/core.scad>
|
||||
include <../utils/rounded_polygon.scad>
|
||||
|
||||
function pi_base_width(type) = type[1]; //! Width of the base
|
||||
function pi_base_length(type) = type[2]; //! Length of the base
|
||||
function pi_base_height(type) = type[3]; //! Height of the base
|
||||
function pi_gap_height(type) = type[4]; //! Heigth of the gap where the light can be interrupted
|
||||
function pi_gap_height(type) = type[4]; //! Height of the gap where the light can be interrupted
|
||||
function pi_gap_width(type) = type[6]; //! Width of the gap
|
||||
function pi_stem_width(type) = type[5]; //! Width of the stems
|
||||
function pi_hole_diameter(type) = type[7]; //! Diameter of the mounting holes
|
||||
@@ -49,7 +71,7 @@ module pi_pcb(type) { //! Draw the support PCB
|
||||
}
|
||||
|
||||
module photo_interrupter(type) { //! Draw the photo interrupter, with PCB
|
||||
vitamin(type[0]);
|
||||
vitamin(str("photo_interrupter(", type[0], "): ", type[0], " Photo interrupter"));
|
||||
color(pi_color(type)) {
|
||||
linear_extrude(pi_base_height(type)) {
|
||||
difference() {
|
||||
@@ -69,7 +91,7 @@ module photo_interrupter(type) { //! Draw the photo interrupter, with PCB
|
||||
pi_pcb(type);
|
||||
}
|
||||
|
||||
module pi_cutout(type) { //! Shape to substract for fitting a photo interrupter
|
||||
module pi_cutout(type) { //! Shape to subtract for fitting a photo interrupter
|
||||
hull() {
|
||||
pi_hole_locations(type)
|
||||
cylinder(h = pi_base_height(type), d = pi_base_width(type));
|
||||
|
@@ -1,4 +1,22 @@
|
||||
PH1 = ["PH1: Photo interrupter", 6.4, 25.9 , 3.5, 8.6, 4.1, 5.9, 3, "grey", [22, 20, 1.6, true, 11-3.2, 0, "blue",[[8.3, -7.5], [8.3, 7.5]], 3]];
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2023
|
||||
// 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/>.
|
||||
//
|
||||
PH1 = ["PH1", 6.4, 25.9 , 3.5, 8.6, 4.1, 5.9, 3, grey(20), [22, 20, 1.6, true, 11-3.2, 0, "blue",[[8.3, -7.5], [8.3, 7.5]], 3]];
|
||||
|
||||
photo_interrupters = [PH1];
|
||||
|
||||
|
Reference in New Issue
Block a user