Fixes and docs tweaks for bottlecaps.scad

This commit is contained in:
Garth Minette 2021-01-27 17:18:06 -08:00
parent 1b8f28cf35
commit a0c21ffafb
4 changed files with 48 additions and 19 deletions

View file

@ -16,11 +16,12 @@ include <knurling.scad>
// Module: pco1810_neck()
// Usage:
// pco1810_neck()
// pco1810_neck(<wall>)
// Description:
// Creates an approximation of a standard PCO-1810 threaded beverage bottle neck.
// Arguments:
// wall = Wall thickness in mm.
// ---
// 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`
// orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#orient). Default: `UP`
@ -29,6 +30,12 @@ include <knurling.scad>
// "support-ring" = Centered at the bottom of the support ring.
// Example:
// pco1810_neck();
// Example: Standard Anchors
// pco1810_neck() show_anchors(custom=false);
// Example: Custom Named Anchors
// expose_anchors(0.3)
// pco1810_neck()
// show_anchors(std=false);
module pco1810_neck(wall=2, anchor="support-ring", spin=0, orient=UP)
{
inner_d = 21.74;
@ -62,7 +69,7 @@ module pco1810_neck(wall=2, anchor="support-ring", spin=0, orient=UP)
anchorpt("support-ring", [0,0,neck_h-h/2]),
anchorpt("tamper-ring", [0,0,h/2-tamper_base_h])
];
attachable(anchor,spin,orient, d=support_d, l=h, anchors=anchors) {
attachable(anchor,spin,orient, d1=neck_d, d2=lip_recess_d+2*lip_leadin_r, l=h, anchors=anchors) {
down(h/2) {
rotate_extrude(convexity=10) {
polygon(turtle(
@ -127,12 +134,13 @@ module pco1810_neck(wall=2, anchor="support-ring", spin=0, orient=UP)
// Module: pco1810_cap()
// Usage:
// pco1810_cap(wall, [texture]);
// pco1810_cap(<wall>, <texture>);
// Description:
// Creates a basic cap for a PCO1810 threaded beverage bottle.
// Arguments:
// 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`
// 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`
@ -142,6 +150,12 @@ module pco1810_neck(wall=2, anchor="support-ring", spin=0, orient=UP)
// pco1810_cap();
// pco1810_cap(texture="knurled");
// pco1810_cap(texture="ribbed");
// Examples: Standard Anchors
// pco1810_cap(texture="ribbed") show_anchors(custom=false);
// Examples: Custom Named Anchors
// expose_anchors(0.3)
// pco1810_cap(texture="ribbed")
// show_anchors(std=false);
module pco1810_cap(wall=2, texture="none", anchor=BOTTOM, spin=0, orient=UP)
{
cap_id = 28.58;
@ -187,11 +201,12 @@ module pco1810_cap(wall=2, texture="none", anchor=BOTTOM, spin=0, orient=UP)
// Module: pco1881_neck()
// Usage:
// pco1881_neck()
// pco1881_neck(<wall>)
// Description:
// Creates an approximation of a standard PCO-1881 threaded beverage bottle neck.
// Arguments:
// wall = Wall thickness in mm.
// ---
// 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`
// orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#orient). Default: `UP`
@ -200,6 +215,12 @@ module pco1810_cap(wall=2, texture="none", anchor=BOTTOM, spin=0, orient=UP)
// "support-ring" = Centered at the bottom of the support ring.
// Example:
// pco1881_neck();
// Example:
// pco1881_neck() show_anchors(custom=false);
// Example:
// expose_anchors(0.3)
// pco1881_neck()
// show_anchors(std=false);
module pco1881_neck(wall=2, anchor="support-ring", spin=0, orient=UP)
{
inner_d = 21.74;
@ -234,7 +255,7 @@ module pco1881_neck(wall=2, anchor="support-ring", spin=0, orient=UP)
anchorpt("support-ring", [0,0,neck_h-h/2]),
anchorpt("tamper-ring", [0,0,h/2-tamper_base_h])
];
attachable(anchor,spin,orient, d=support_d, l=h, anchors=anchors) {
attachable(anchor,spin,orient, d1=neck_d, d2=lip_recess_d+2*lip_leadin_r, l=h, anchors=anchors) {
down(h/2) {
rotate_extrude(convexity=10) {
polygon(turtle(
@ -313,6 +334,12 @@ module pco1881_neck(wall=2, anchor="support-ring", spin=0, orient=UP)
// pco1881_cap();
// pco1881_cap(texture="knurled");
// pco1881_cap(texture="ribbed");
// Example: Standard Anchors
// pco1881_cap(texture="ribbed") show_anchors(custom=false);
// Example: Custom Named Anchors
// expose_anchors(0.5)
// pco1881_cap(texture="ribbed")
// show_anchors(std=false);
module pco1881_cap(wall=2, texture="none", anchor=BOTTOM, spin=0, orient=UP)
{
$fn = segs(33/2);

View file

@ -334,25 +334,27 @@ module anchor_arrow2d(s=15, color=[0.333,0.333,1], $tags="anchor-arrow") {
// Module: show_internal_anchors()
// Module: expose_anchors()
// Usage:
// show_internal_anchors(<opacity>) {...}
// expose_anchors(opacity) {...}
// Description:
// Makes the children transparent gray, while showing any
// anchor arrows that may exist.
// Makes the children transparent gray, while showing any anchor arrows that may exist.
// Arguments:
// opacity = The opacity of the arrow. 0.0 is invisible, 1.0 is opaque. Default: 0.2
// Example(FlatSpin):
// show_internal_anchors() cube(50, center=true) show_anchors();
module show_internal_anchors(opacity=0.2) {
show("anchor-arrow") children() show_anchors();
hide("anchor-arrow") recolor(list_pad(point3d($color),4,fill=opacity)) children();
// expose_anchors() cube(50, center=true) show_anchors();
module expose_anchors(opacity=0.2) {
show("anchor-arrow")
children();
hide("anchor-arrow")
color(is_string($color)? $color : point3d($color), opacity)
children();
}
// Module: show_anchors()
// Usage:
// show_anchors(<s>, <std=>, <custom=>);
// ... show_anchors(<s>, <std=>, <custom=>);
// Description:
// Show all standard anchors for the parent object.
// Arguments:

View file

@ -379,8 +379,8 @@ function get_metric_nut_thickness(size) = lookup(size, [
// Example(FlatSpin): Standard Anchors
// screw(screwsize=3,screwlen=10,headsize=6,headlen=3)
// show_anchors(5, custom=false);
// Example(FlatSpin): Standard Anchors
// show_internal_anchors()
// Example(FlatSpin): Custom Named Anchors
// expose_anchors()
// screw(screwsize=3,screwlen=10,headsize=6,headlen=3)
// show_anchors(5, std=false);
module screw(
@ -470,8 +470,8 @@ module screw(
// Example(FlatSpin): Standard Anchors
// metric_bolt(headtype="oval", size=10, l=15, shank=5, details=true, phillips="#2")
// show_anchors(5, custom=false);
// Example(FlatSpin): Custom Anchors
// show_internal_anchors(0.125)
// Example(FlatSpin): Custom Named Anchors
// expose_anchors(0.125)
// metric_bolt(headtype="oval", size=10, l=15, shank=5, details=true, phillips="#2")
// show_anchors(5, std=false);
module metric_bolt(

View file

@ -6,7 +6,7 @@
//////////////////////////////////////////////////////////////////////
BOSL_VERSION = [2,0,542];
BOSL_VERSION = [2,0,543];
// Section: BOSL Library Version Functions