Enabled knurling or ribbing of pco1881_cap()

This commit is contained in:
Revar Desmera 2019-08-30 16:20:34 -07:00
parent 9ed027a0cd
commit cb398bd7ff
3 changed files with 27 additions and 9 deletions

View file

@ -4,7 +4,6 @@
// To use, add the following lines to the beginning of your file: // To use, add the following lines to the beginning of your file:
// ``` // ```
// include <BOSL2/std.scad> // include <BOSL2/std.scad>
// include <BOSL2/knurling.scad>
// ``` // ```
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -12,20 +12,24 @@ include <constants.scad>
include <edges.scad> include <edges.scad>
include <common.scad> include <common.scad>
include <errors.scad> include <errors.scad>
include <math.scad>
include <arrays.scad> include <arrays.scad>
include <math.scad>
include <vectors.scad> include <vectors.scad>
include <affine.scad>
include <quaternions.scad> include <quaternions.scad>
include <affine.scad>
include <coords.scad> include <coords.scad>
include <geometry.scad> include <geometry.scad>
include <paths.scad>
include <attachments.scad>
include <transforms.scad> include <transforms.scad>
include <attachments.scad>
include <primitives.scad> include <primitives.scad>
include <shapes.scad> include <shapes.scad>
include <shapes2d.scad> include <shapes2d.scad>
include <masks.scad> include <masks.scad>
include <paths.scad>
include <knurling.scad>
// vim: noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap // vim: noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap

View file

@ -980,11 +980,12 @@ module pco1881_neck(wall=2, anchor="support-ring", spin=0, orient=UP)
// Module: pco1881_cap() // Module: pco1881_cap()
// Usage: // Usage:
// pco1881_cap(wall); // pco1881_cap(wall, [texture]);
// Description: // Description:
// Creates a basic cap for a PCO1881 threaded beverage bottle. // Creates a basic cap for a PCO1881 threaded beverage bottle.
// Arguments: // Arguments:
// wall = Wall thickness in mm. // wall = Wall thickness in mm.
// texture = The surface texture of the cap. Valid values are "none", "knurled", or "ribbed". Default: "none"
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#anchor). Default: `CENTER` // anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#anchor). Default: `CENTER`
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#spin). Default: `0` // spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#spin). Default: `0`
// orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#orient). Default: `UP` // orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#orient). Default: `UP`
@ -992,7 +993,7 @@ module pco1881_neck(wall=2, anchor="support-ring", spin=0, orient=UP)
// "inside-top" = Centered on the inside top of the cap. // "inside-top" = Centered on the inside top of the cap.
// Example: // Example:
// pco1881_cap(); // pco1881_cap();
module pco1881_cap(wall=2, anchor=BOTTOM, spin=0, orient=UP) module pco1881_cap(wall=2, texture="none", anchor=BOTTOM, spin=0, orient=UP)
{ {
$fn = segs(33/2); $fn = segs(33/2);
w = 28.58 + 2*wall; w = 28.58 + 2*wall;
@ -1002,8 +1003,22 @@ module pco1881_cap(wall=2, anchor=BOTTOM, spin=0, orient=UP)
]; ];
orient_and_anchor([w, w, h], orient, anchor, spin=spin, anchors=anchors, chain=true) { orient_and_anchor([w, w, h], orient, anchor, spin=spin, anchors=anchors, chain=true) {
down(h/2) zrot(45) { down(h/2) zrot(45) {
tube(id=28.58, wall=wall, h=11.2+wall, anchor=BOTTOM); difference() {
cylinder(d=w, h=wall, anchor=BOTTOM); union() {
if (texture == "knurled") {
knurled_cylinder(d=w, helix=45, l=11.2+wall, anchor=BOTTOM);
cyl(d=w-1.5, l=11.2+wall, anchor=BOTTOM);
} else if (texture == "ribbed") {
zrot_copies(n=30, r=(w-1)/2) {
cube([1, 1, 11.2+wall], anchor=BOTTOM);
}
cyl(d=w-1, l=11.2+wall, anchor=BOTTOM);
} else {
cyl(d=w, l=11.2+wall, anchor=BOTTOM);
}
}
up(wall) cyl(d=28.58, h=11.2+wall, anchor=BOTTOM);
}
up(wall+2) thread_helix(base_d=25.5, pitch=2.7, thread_depth=1.6, thread_angle=15, twist=650, higbee=45, internal=true, anchor=BOTTOM); up(wall+2) thread_helix(base_d=25.5, pitch=2.7, thread_depth=1.6, thread_angle=15, twist=650, higbee=45, internal=true, anchor=BOTTOM);
} }
children(); children();