Moved printed parts to their own directory.

This commit is contained in:
Chris Palmer 2019-06-11 23:20:28 +01:00
parent b1fb0286b5
commit 258d4e88ae
38 changed files with 141 additions and 82 deletions

53
docs/usage.md Normal file
View File

@ -0,0 +1,53 @@
# NopSCADlib usage
## Requirements
1. OpenSCAD 2019.05 or later, download it from here: https://www.openscad.org/downloads.html
1. Python 2.7+ or 3.6+ from https://www.python.org/downloads/
1. ImageMagick www.imagemagick.org
These are all cross platform tools so NopSCADlib should work on any platform that supports them.
They all need to be added to the executable search path so that they work from the command line.
### Python packages
The following Python modules are used and can be installed with pip:
```
pip install colorama
```
## Installation
OpenSCAD it has to be setup to find libraries by setting the ```OPENSCADPATH``` environment variable to where you want to file your libaries and NopSCADlib needs to be installed
in the directory it points to. This can be done with ```git clone https://github.com/nophead/NopSCADlib.git``` while in that directory or by downloading
https://github.com/nophead/NopSCADlib/archive/master.zip and unzipping it to a directory called NopSCADlib if you don't want to use GIT.
The ```NopSCADlib/scripts``` directory needs to be added to the executable search path.
The installation can be tested by opening ```NopSCADlib/libtest.scad``` in the GUI. It should render all the objects in the library in about 1 minute.
Running ```tests``` from the command line will run all the tests in the ```tests``` directory and build the ```readme.md``` catalog.
## Directory structure
| Path | Usage |
|:-----|:------|
| ```NopSCADlib``` | Top level scad files and printed parts |
| ```NopSCADlib/doc``` | Documentation like this that is not automatically generated |
| ```NopSCADlib/examples``` | Example projects |
| ```NopSCADlib/gallery``` | Pictures of items that have been made with the library |
| ```NopSCADlib/scripts``` | Python scripts |
| ```NopSCADlib/tests``` | A stand alone test for each type of vitamin and most of the utilities |
| ```NopSCADlib/utils``` | Utilitity scad files |
| ```NopSCADlib/utils/core``` | Core utilities used by nearly everything |
| ```NopSCADlib/vitamins``` | Generally a pair of .scad files for each type of vitamin |
## Making a project
Each project has its own directory and that is used to derive the project's name. There should be a main scad file which contains the main assembly. A skeleton looks like this: -
```OpenSCAD
//!
include <NopSCADlib/lib.scad>

View File

@ -36,7 +36,7 @@ $pp1_colour = "dimgrey";
$pp2_colour = [0.9, 0.9, 0.9];
include <NopSCADlib/lib.scad>
use <NopSCADlib/foot.scad>
use <NopSCADlib/printed/foot.scad>
echo(extrusion_width = extrusion_width, layer_height = layer_height);
wall = 2.5;

View File

@ -31,13 +31,13 @@
//!
//! Normally the side sheets are the same type but they can be overridden individually as long as the substitute has the same thickness.
//
include <core.scad>
use <vitamins/sheet.scad>
use <vitamins/screw.scad>
use <vitamins/washer.scad>
include <../core.scad>
use <../vitamins/sheet.scad>
use <../vitamins/screw.scad>
use <../vitamins/washer.scad>
include <vitamins/inserts.scad>
use <utils/quadrant.scad>
include <../vitamins/inserts.scad>
use <../utils/quadrant.scad>
bezel_clearance = 0.2;
sheet_end_clearance = 1;

View File

@ -32,7 +32,7 @@
use <fixing_block.scad>
use <corner_block.scad>
use <utils/maths.scad>
use <../utils/maths.scad>
function bbox_screw(type) = type[0]; //! Screw type for corner blocks
function bbox_sheets(type) = type[1]; //! Sheet type for the sides

View File

@ -21,8 +21,8 @@
//! Printed cable grommets for passing cables through panels avoiding sharp edges and in the case
//! of conductive panels, an extra layer of insulation.
//
include <core.scad>
use <vitamins/cable_strip.scad>
include <../core.scad>
use <../vitamins/cable_strip.scad>
base = 1.25;
slot_height = round_to_layer(1.27) + layer_height;

View File

@ -22,7 +22,7 @@
//
$extrusion_width = 0.5;
include <core.scad>
include <../core.scad>
module ESP12F_carrier_stl() { //! Generate the STL for an ESP12 carrier
stl("ESP12F_carrier");

View File

@ -25,11 +25,11 @@
//!
//! Note that the block with its inserts is defined as a sub assembly, but its fasteners get added to the parent assembly.
//
include <core.scad>
include <vitamins/screws.scad>
include <vitamins/inserts.scad>
use <utils/rounded_cylinder.scad>
use <utils/maths.scad>
include <../core.scad>
include <../vitamins/screws.scad>
include <../vitamins/inserts.scad>
use <../utils/rounded_cylinder.scad>
use <../utils/maths.scad>
def_screw = M3_cap_screw;
wall = 3;

View File

@ -23,8 +23,8 @@
//! The screws are tapped into the acrylic.
//! Rubber door [sealing strip](#sealing_strip) is used to make it airtight and a [door_latch](#door_latch) holds it closed.
//
include <core.scad>
include <vitamins/screws.scad>
include <../core.scad>
include <../vitamins/screws.scad>
width = 18;
thickness = 4;

View File

@ -20,9 +20,9 @@
//
//! Door latch for 6mm acrylic door for 3D printer. See [door_hinge](#door_hinge).
//
include <core.scad>
use <utils/hanging_hole.scad>
include <vitamins/screws.scad>
include <../core.scad>
use <../utils/hanging_hole.scad>
include <../vitamins/screws.scad>
length = 35;
width = 12;

View File

@ -21,7 +21,7 @@
//!
//! The ring spacing as well as the number of spokes can be specified, if zero a gasket is generated instead of a guard.
//
use <utils/tube.scad>
use <../utils/tube.scad>
function fan_guard_thickness() = 2; //! Default thickness

View File

@ -25,10 +25,10 @@
//!
//! Note that the block with its inserts is defined as a sub assembly, but its fasteners get added to the parent assembly.
//
include <core.scad>
include <vitamins/screws.scad>
include <vitamins/inserts.scad>
use <utils/maths.scad>
include <../core.scad>
include <../vitamins/screws.scad>
include <../vitamins/inserts.scad>
use <../utils/maths.scad>
def_screw = M3_cap_screw;
wall = 2.5;

View File

@ -21,9 +21,9 @@
//! Customisable printed rubber feet for equipment cases. The insert variant is better for solid feet because
//! inserts don't grip well in rubber.
//
include <core.scad>
include <vitamins/screws.scad>
include <vitamins/inserts.scad>
include <../core.scad>
include <../vitamins/screws.scad>
include <../vitamins/inserts.scad>
foot = [25, 12, 3, 2, M4_cap_screw, 10];
insert_foot = [20, 10, 0, 2, M3_cap_screw, 10];

View File

@ -20,9 +20,9 @@
//
//! Printed handle that can be printed without needing support material due to its truncated teardrop profile.
//
include <core.scad>
include <vitamins/screws.scad>
include <vitamins/inserts.scad>
include <../core.scad>
include <../vitamins/screws.scad>
include <../vitamins/inserts.scad>
dia = 18;
length = 90; // inside length

View File

@ -20,10 +20,10 @@
//
//! Clamp for ribbon cable and polypropylene strip.
//
include <core.scad>
include <vitamins/screws.scad>
include <vitamins/inserts.scad>
use <vitamins/cable_strip.scad>
include <../core.scad>
include <../vitamins/screws.scad>
include <../vitamins/inserts.scad>
use <../vitamins/cable_strip.scad>
wall = 2;
min_wall = 2 * extrusion_width;

View File

@ -20,9 +20,9 @@
//
//! Knob with embedded hex head screw.
//
include <core.scad>
include <vitamins/screws.scad>
use <utils/hanging_hole.scad>
include <../core.scad>
include <../vitamins/screws.scad>
use <../utils/hanging_hole.scad>
knob_wall = 2;
function knob_nut_trap_depth(screw) = round_to_layer(screw_head_height(screw));

View File

@ -20,11 +20,11 @@
//
//! UK 13A socket and printed backbox with earth terminal for the panel it is mounted on.
//
include <core.scad>
include <vitamins/mains_sockets.scad>
include <vitamins/screws.scad>
include <vitamins/inserts.scad>
include <vitamins/ring_terminals.scad>
include <../core.scad>
include <../vitamins/mains_sockets.scad>
include <../vitamins/screws.scad>
include <../vitamins/inserts.scad>
include <../vitamins/ring_terminals.scad>
box_height = 19;
base_thickness = 2;

View File

@ -21,9 +21,9 @@
//! Retracting strap handle. Print the strap with flexible filament. Shown with default dimensions but can
//! be fully customised by passing a list of properties.
//
include <core.scad>
include <vitamins/screws.scad>
include <vitamins/inserts.scad>
include <../core.scad>
include <../vitamins/screws.scad>
include <../vitamins/inserts.scad>
strap = [18, 2, M3_pan_screw, 3, 25];
function strap() = strap;

View File

@ -10,6 +10,8 @@ For more examples of what it can make see the [gallery](gallery/readme.md).
The license is GNU General Public License v3.0, see [COPYING](COPYING).
See [usage](docs/usage.md) for requirement, installation instructions and usage.
<img src="libtest.png" width="100%"/>
@ -2796,7 +2798,7 @@ screw type and printed part wall thickness. This diagram shows how the various d
Normally the side sheets are the same type but they can be overridden individually as long as the substitute has the same thickness.
[box.scad](box.scad) Implementation.
[printed/box.scad](printed/box.scad) Implementation.
[tests/box.scad](tests/box.scad) Code for this example.
@ -2901,7 +2903,7 @@ maximum spacing.
Uses [fixing blocks](#fixing_block) and [corner blocks](#corner_block).
[butt_box.scad](butt_box.scad) Implementation.
[printed/butt_box.scad](printed/butt_box.scad) Implementation.
[tests/butt_box.scad](tests/butt_box.scad) Code for this example.
@ -2985,7 +2987,7 @@ Printed cable grommets for passing cables through panels avoiding sharp edges an
of conductive panels, an extra layer of insulation.
[cable_grommets.scad](cable_grommets.scad) Implementation.
[printed/cable_grommets.scad](printed/cable_grommets.scad) Implementation.
[tests/cable_grommets.scad](tests/cable_grommets.scad) Code for this example.
@ -3019,7 +3021,7 @@ of conductive panels, an extra layer of insulation.
Adapts ESP12 module to 0.1" grid. See <https://hydraraptor.blogspot.com/2018/04/esp-12-module-breakout-adaptor.html>.
[carriers.scad](carriers.scad) Implementation.
[printed/carriers.scad](printed/carriers.scad) Implementation.
[tests/carriers.scad](tests/carriers.scad) Code for this example.
@ -3049,7 +3051,7 @@ See [butt_box](#Butt_box) for an example of usage.
Note that the block with its inserts is defined as a sub assembly, but its fasteners get added to the parent assembly.
[corner_block.scad](corner_block.scad) Implementation.
[printed/corner_block.scad](printed/corner_block.scad) Implementation.
[tests/corner_block.scad](tests/corner_block.scad) Code for this example.
@ -3123,7 +3125,7 @@ The screws are tapped into the acrylic.
Rubber door [sealing strip](#sealing_strip) is used to make it airtight and a [door_latch](#door_latch) holds it closed.
[door_hinge.scad](door_hinge.scad) Implementation.
[printed/door_hinge.scad](printed/door_hinge.scad) Implementation.
[tests/door_hinge.scad](tests/door_hinge.scad) Code for this example.
@ -3176,7 +3178,7 @@ Rubber door [sealing strip](#sealing_strip) is used to make it airtight and a [d
Door latch for 6mm acrylic door for 3D printer. See [door_hinge](#door_hinge).
[door_latch.scad](door_latch.scad) Implementation.
[printed/door_latch.scad](printed/door_latch.scad) Implementation.
[tests/door_latch.scad](tests/door_latch.scad) Code for this example.
@ -3217,7 +3219,7 @@ Pintable fan finger guard to match the specified fan. To be ```include```d, not
The ring spacing as well as the number of spokes can be specified, if zero a gasket is generated instead of a guard.
[fan_guard.scad](fan_guard.scad) Implementation.
[printed/fan_guard.scad](printed/fan_guard.scad) Implementation.
[tests/fan_guard.scad](tests/fan_guard.scad) Code for this example.
@ -3261,7 +3263,7 @@ See [butt_box](#Butt_box) for an example of usage.
Note that the block with its inserts is defined as a sub assembly, but its fasteners get added to the parent assembly.
[fixing_block.scad](fixing_block.scad) Implementation.
[printed/fixing_block.scad](printed/fixing_block.scad) Implementation.
[tests/fixing_block.scad](tests/fixing_block.scad) Code for this example.
@ -3335,7 +3337,7 @@ Customisable printed rubber feet for equipment cases. The insert variant is bett
inserts don't grip well in rubber.
[foot.scad](foot.scad) Implementation.
[printed/foot.scad](printed/foot.scad) Implementation.
[tests/foot.scad](tests/foot.scad) Code for this example.
@ -3397,7 +3399,7 @@ inserts don't grip well in rubber.
Printed handle that can be printed without needing support material due to its truncated teardrop profile.
[handle.scad](handle.scad) Implementation.
[printed/handle.scad](printed/handle.scad) Implementation.
[tests/handle.scad](tests/handle.scad) Code for this example.
@ -3447,7 +3449,7 @@ Printed handle that can be printed without needing support material due to its t
Clamp for ribbon cable and polypropylene strip.
[ribbon_clamp.scad](ribbon_clamp.scad) Implementation.
[printed/ribbon_clamp.scad](printed/ribbon_clamp.scad) Implementation.
[tests/ribbon_clamp.scad](tests/ribbon_clamp.scad) Code for this example.
@ -3499,7 +3501,7 @@ Clamp for ribbon cable and polypropylene strip.
Knob with embedded hex head screw.
[screw_knob.scad](screw_knob.scad) Implementation.
[printed/screw_knob.scad](printed/screw_knob.scad) Implementation.
[tests/screw_knob.scad](tests/screw_knob.scad) Code for this example.
@ -3538,7 +3540,7 @@ Knob with embedded hex head screw.
UK 13A socket and printed backbox with earth terminal for the panel it is mounted on.
[socket_box.scad](socket_box.scad) Implementation.
[printed/socket_box.scad](printed/socket_box.scad) Implementation.
[tests/socket_box.scad](tests/socket_box.scad) Code for this example.
@ -3590,7 +3592,7 @@ Retracting strap handle. Print the strap with flexible filament. Shown with defa
be fully customised by passing a list of properties.
[strap_handle.scad](strap_handle.scad) Implementation.
[printed/strap_handle.scad](printed/strap_handle.scad) Implementation.
[tests/strap_handle.scad](tests/strap_handle.scad) Code for this example.

View File

@ -35,7 +35,7 @@ def doc_scripts():
print(
'''
# Python scripts
These are located in the scripts subdirectory, which needs to be added to the program search path.
These are located in the ```scripts``` subdirectory, which needs to be added to the program search path.
They should work with both Python 2 and Python 3.

View File

@ -1,6 +1,6 @@
# Python scripts
These are located in the scripts subdirectory, which needs to be added to the program search path.
These are located in the ```scripts``` subdirectory, which needs to be added to the program search path.
They should work with both Python 2 and Python 3.

View File

@ -125,7 +125,7 @@ def tests(tests):
locations = [
('vitamins/' + depluralise(base_name) + '.scad', 'Vitamins'),
(base_name + '.scad', 'Printed'),
('printed/' + base_name + '.scad', 'Printed'),
('utils/' + base_name + '.scad', 'Utilities'),
('utils/core/' + base_name + '.scad', 'Core Utilities'),
]
@ -239,6 +239,8 @@ For more examples of what it can make see the [gallery](gallery/readme.md).
The license is GNU General Public License v3.0, see [COPYING](COPYING).
See [usage](docs/usage.md) for requirement, installation instructions and usage.
<img src="libtest.png" width="100%"/>\n
''', file = doc_file)

View File

@ -22,11 +22,11 @@ include <../vitamins/screws.scad>
include <../vitamins/sheets.scad>
include <../vitamins/inserts.scad>
use <../box.scad>
use <../printed/box.scad>
box = [M3_dome_screw, 3, DiBond, PMMA3, DiBond6, true, 150, 100, 70];
include <../box_assembly.scad>
include <../printed/box_assembly.scad>
module box_assembly() _box_assembly(box);

View File

@ -22,7 +22,7 @@ include <../vitamins/screws.scad>
include <../vitamins/sheets.scad>
include <../vitamins/inserts.scad>
include <../butt_box.scad>
include <../printed/butt_box.scad>
$explode = 0;

View File

@ -18,7 +18,7 @@
//
include <../core.scad>
use <../cable_grommets.scad>
use <../printed/cable_grommets.scad>
module cable_grommets() {
rotate(90)

View File

@ -17,7 +17,7 @@
// If not, see <https://www.gnu.org/licenses/>.
//
include <../core.scad>
use <../carriers.scad>
use <../printed/carriers.scad>
module carriers()
color(pp1_colour) ESP12F_carrier_stl();

View File

@ -17,7 +17,7 @@
// If not, see <https://www.gnu.org/licenses/>.
//
include <../core.scad>
use <../corner_block.scad>
use <../printed/corner_block.scad>
include <../vitamins/screws.scad>

View File

@ -17,7 +17,7 @@
// If not, see <https://www.gnu.org/licenses/>.
//
include <../core.scad>
use <../door_hinge.scad>
use <../printed/door_hinge.scad>
include <../vitamins/sheets.scad>
use <../vitamins/screw.scad>

View File

@ -17,7 +17,7 @@
// If not, see <https://www.gnu.org/licenses/>.
//
include <../core.scad>
use <../door_latch.scad>
use <../printed/door_latch.scad>
module door_latches()
translate([door_latch_offset(), 0])

View File

@ -19,7 +19,7 @@
include <../core.scad>
use <../utils/layout.scad>
include <../fan_guard.scad>
include <../printed/fan_guard.scad>
include <../vitamins/fans.scad>
module fan_guards()

View File

@ -19,7 +19,7 @@
include <../core.scad>
use <../utils/layout.scad>
include <../fan_guard.scad>
include <../printed/fan_guard.scad>
include <../vitamins/fans.scad>

View File

@ -17,7 +17,7 @@
// If not, see <https://www.gnu.org/licenses/>.
//
include <../core.scad>
use <../fixing_block.scad>
use <../printed/fixing_block.scad>
use <../utils/layout.scad>
include <../vitamins/screws.scad>

View File

@ -17,7 +17,7 @@
// If not, see <https://www.gnu.org/licenses/>.
//
include <../core.scad>
use <../foot.scad>
use <../printed/foot.scad>
module feet()
if($preview) {

View File

@ -17,7 +17,7 @@
// If not, see <https://www.gnu.org/licenses/>.
//
include <../core.scad>
use <../handle.scad>
use <../printed/handle.scad>
module handle()
translate([handle_length() / 2, 0])

View File

@ -17,7 +17,7 @@
// If not, see <https://www.gnu.org/licenses/>.
//
include <../core.scad>
use <../ribbon_clamp.scad>
use <../printed/ribbon_clamp.scad>
use <../vitamins/wire.scad>
ways = 20;

View File

@ -17,7 +17,7 @@
// If not, see <https://www.gnu.org/licenses/>.
//
include <../core.scad>
use <../screw_knob.scad>
use <../printed/screw_knob.scad>
include <../vitamins/screws.scad>

View File

@ -17,10 +17,12 @@
// If not, see <https://www.gnu.org/licenses/>.
//
$explode = 1;
include <../core.scad>
use <../utils/layout.scad>
include <../vitamins/mains_sockets.scad>
use <../socket_box.scad>
use <../printed/socket_box.scad>
module socket_boxes()
layout([for(s = mains_sockets) mains_socket_width(s)], 20)
if($preview)

View File

@ -30,7 +30,7 @@ include <screws.scad>
use <fan.scad>
use <iec.scad>
use <rocker.scad>
include <../fan_guard.scad>
include <../printed/fan_guard.scad>
function psu_face_holes(type) = type[0]; //! List of screw hole positions
function psu_face_thickness(type) = type[1]; //! The thickness