mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-08-20 14:21:40 +02:00
Screws.scad is now included in core.scad, so doesn't need to be included
anywhere else. utils/core/core.scad is the old version without fasteners to be used internally in the library.
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
//! Annotation used in this documentation
|
||||
//
|
||||
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
|
||||
module label(str, scale = 0.25, valign = "baseline", halign = "left") //! Draw text that always faces the camera
|
||||
color("black")
|
||||
|
39
utils/core/core.scad
Normal file
39
utils/core/core.scad
Normal file
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2018
|
||||
// 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/>.
|
||||
//
|
||||
|
||||
//
|
||||
// Include this file to use the miniumum library
|
||||
//
|
||||
include <../../global_defs.scad>
|
||||
//
|
||||
// Global functions and modules
|
||||
//
|
||||
use <global.scad>
|
||||
|
||||
module use_stl(name) { //! Import an STL to make a build platter
|
||||
stl(name);
|
||||
|
||||
import(str("../stls/", name, ".stl"));
|
||||
}
|
||||
|
||||
module use_dxf(name) { //! Import a DXF to make a build panel
|
||||
dxf(name);
|
||||
|
||||
import(str("../dxfs/", name, ".dxf"));
|
||||
}
|
@@ -21,7 +21,7 @@
|
||||
//! When square holes are cut with a CNC bit they get rounded corners. If it is important that
|
||||
//! a square cornered part fits in the hole then circles are placed in the corners making a bone shape.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
|
||||
module dogbone_square(size, r = cnc_bit_r, center = true) //! Square with circles at the corners
|
||||
{
|
||||
|
@@ -20,7 +20,7 @@
|
||||
//
|
||||
//! Rounded fillet for adding to corners.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
|
||||
module fillet(r, h, center = false) //! Fillet with specified radius and height
|
||||
extrude_if(h, center = center)
|
||||
|
@@ -20,7 +20,7 @@
|
||||
//
|
||||
//! Method to print holes in mid air. See <https://hydraraptor.blogspot.com/2014/03/buried-nuts-and-hanging-holes.html>
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
|
||||
module hanging_hole(z, ir, h = 100, h2 = 100) { //! Hole radius ```ir``` hanging at the specified ```z``` value above a void who's shape is given by a 2D child
|
||||
module polyhole(r, h, n = 8) {
|
||||
|
@@ -22,7 +22,7 @@
|
||||
//! Can be used to round corners. Positive offsets will round convex corners, negative offsets round concave corners. To round both use [`round_3D()`](#round).
|
||||
//!
|
||||
//! If `chamfer_base` is true then the bottom edge is made suitable for 3D printing by chamfering when the angle gets shallower than 45 degrees.
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
|
||||
module offset_3D(r, chamfer_base = false) { //! Offset 3D shape by specified radius ```r```, positive or negative.
|
||||
module ball(r)
|
||||
|
@@ -20,7 +20,7 @@
|
||||
//
|
||||
//! Square with one rounded corner.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
|
||||
module quadrant(w, r, center = false) { //! Draw a square with one rounded corner, can be centered on the arc centre, when ```center``` is ```true```.
|
||||
offset = center ? r - w : 0;
|
||||
|
@@ -22,7 +22,7 @@
|
||||
//! A single radius can be specified or separate internal and external radii.
|
||||
//! If `chamfer_base` is `true` for `round_3D()` then the bottom edge is made suitable for 3D printing by chamfering once the
|
||||
//! the angle gets shallower than 45 degrees.
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
use <offset.scad>
|
||||
|
||||
module round(r, ir = undef, or = undef) { //! Round a 2D child, single radius or separate inside and outside radii
|
||||
|
@@ -20,7 +20,7 @@
|
||||
//
|
||||
//! Cylinder with a rounded end.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
|
||||
module rounded_corner(r, h, r2, ir = 0) { //! 2D version
|
||||
assert(ir <= r - r2);
|
||||
|
@@ -22,7 +22,7 @@
|
||||
//!
|
||||
//! Because the tangents need to be calculated to find the length these can be calculated separately and re-used when drawing to save calculating them twice.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
|
||||
function circle_tangent(p1, p2) =
|
||||
let(
|
||||
|
@@ -20,7 +20,7 @@
|
||||
//
|
||||
//! A sector of a circle between two angles.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
|
||||
module sector(r, start_angle, end_angle) { //! Create specified sector given radius ```r```, ```start_angle``` and ```end_angle```
|
||||
R = r * sqrt(2) + 1;
|
||||
|
@@ -26,7 +26,7 @@
|
||||
//! The path can be open or closed. If closed sweep ensures that the start and end have the same rotation to line up.
|
||||
//! An additional twist around the path can be specified. If the path is closed this should be a multiple of 360.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
|
||||
use <maths.scad>
|
||||
|
||||
|
@@ -36,7 +36,7 @@
|
||||
//!
|
||||
//! Threads obey the $fn, $fa, $fs variables.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
use <sweep.scad>
|
||||
use <maths.scad>
|
||||
use <tube.scad>
|
||||
|
@@ -20,7 +20,7 @@
|
||||
//
|
||||
//! Simple tube or ring
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
|
||||
module ring(or, ir) //! Create a ring with specified external and internal radii
|
||||
difference() {
|
||||
|
Reference in New Issue
Block a user