From c32544dc4afb0452bf497872e85fc227c2d258ea Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Mon, 1 Apr 2024 23:06:14 -0400 Subject: [PATCH 1/5] doc fixes --- beziers.scad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beziers.scad b/beziers.scad index 605ce5e..4921722 100644 --- a/beziers.scad +++ b/beziers.scad @@ -1448,7 +1448,7 @@ function bezier_patch_normals(patch, u, v) = // Module: debug_bezier() -// Synopsis: Shows a bezier path and it's associated control points. +// Synopsis: Shows a bezier path and its associated control points. // SynTags: Geom // Topics: Bezier Paths, Debugging // See Also: bezpath_curve() @@ -1518,7 +1518,7 @@ module debug_bezier(bezpath, width=1, N=3) { // showcps = If true, show the controlpoints as well as the surface. Default: true. // showdots = If true, shows the calculated surface vertices. Default: false. // showpatch = If true, shows the surface faces. Default: true. -// size = Size to show control points and lines. +// size = Size to show control points and lines. Default: 1% of the maximum side length of a box bounding the patch. // style = The style of subdividing the quads into faces. Valid options are "default", "alt", and "quincunx". // convexity = Max number of times a line could intersect a wall of the shape. // Example: From bd81d4c251603db249a679828381dd1c3ff92f2a Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Mon, 1 Apr 2024 23:09:16 -0400 Subject: [PATCH 2/5] doc fix --- masks2d.scad | 1 + 1 file changed, 1 insertion(+) diff --git a/masks2d.scad b/masks2d.scad index 287c969..32355da 100644 --- a/masks2d.scad +++ b/masks2d.scad @@ -46,6 +46,7 @@ function _inset_corner(corner, mask_angle, inset, excess, flat_top) = // . // The roundover can be specified by radius, diameter, height, cut, or joint length. // ![Types of Roundovers](images/rounding/section-types-of-roundovers_fig1.png) +// . // If you need roundings to agree on edges of different mask_angle, e.g. to round the base of a prismoid, then you need all of the // masks used to have the same height. (Note that it may appear that matching joint would also work, but it does not because the joint distances are measured // in different directions.) You can get the same height by setting the `height` parameter, which is an alternate way to control the size of the rounding. From 1d7e1b4a2ad5125dddb23e6a9551c5af7a221549 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Mon, 1 Apr 2024 23:10:07 -0400 Subject: [PATCH 3/5] doc fix --- skin.scad | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/skin.scad b/skin.scad index fd6c4ef..ce9ba10 100644 --- a/skin.scad +++ b/skin.scad @@ -2806,7 +2806,7 @@ function associate_vertices(polygons, split, curpoly=0) = // are based on rectangular tiling, this means adding textures to curved shapes may result in distortion of the basic texture unit. For example, if you // texture a cone, the scale of the texture will be larger at the wide end of the cone and smaller at the narrower end of the cone. // . -// You can specify a texture using to method: a height field or a VNF. For each method you also must specify the scale of the texture, which +// You can specify a texture using two methods: a height field or a VNF. For each method you also must specify the scale of the texture, which // gives the size of the rectangular unit in your object that will correspond to one texture tile. Note that this scale does not preserve // aspect ratio: you can stretch the texture as desired. // Subsection: Height Field Texture Maps @@ -2959,10 +2959,10 @@ function associate_vertices(polygons, split, curpoly=0) = // extra points can be introduced in the interior of faces leading to unexpected irregularities in the textures, which appear // as extra triangles. These artifacts can be minimized by making the VNF texture's faces as large as possible rather than using // a triangulated VNF, but depending on the specific VNF texture, it may be impossible to entirely eliminate them. -// Figure(3D,Big,NoAxes,VPR=[140.9,0,345.7],VPT=[9.48289,-0.88709,5.7837],VPD=39.5401): The left shows a normal bricks_vnf texture. The right shows a texture that was first passed through {{vnf_triangulate()}}. Note the extra triangle artifacts visible across the brick faces. +// Figure(3D,Big,NoAxes,VPR=[140.9,0,345.7],VPT=[9.48289,-0.88709,5.7837],VPD=39.5401): The left shows a normal bricks_vnf texture. The right shows a texture that was first passed through {{vnf_triangulate()}}. Note the extra triangle artifacts visible at the ends on the brick faces. // tex = texture("bricks_vnf"); -// cyl(d=10,h=15,texture=tex, tex_reps=[4,2],tex_samples=5); -// up(7)fwd(-3)right(15)cyl(d=10,h=15,texture=vnf_triangulate(tex), tex_reps=[4,2],tex_samples=5); +// cyl(d=10,h=15,texture=tex, tex_reps=[4,2],tex_samples=5,rounding=2); +// up(7)fwd(-3)right(15)cyl(d=10,h=15,texture=vnf_triangulate(tex), tex_reps=[4,2],tex_samples=5,rounding=2); // Function: texture() From aae2653fa55165866cf0f974f1dfd9a010f05ccd Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Mon, 1 Apr 2024 23:10:21 -0400 Subject: [PATCH 4/5] overhaul interface to generic_bottle_cap --- bottlecaps.scad | 58 +++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/bottlecaps.scad b/bottlecaps.scad index e0996f9..5b9cf17 100644 --- a/bottlecaps.scad +++ b/bottlecaps.scad @@ -544,37 +544,40 @@ function generic_bottle_neck( // Synopsis: Creates a generic cap for a bottle. // SynTags: Geom // Topics: Bottles, Threading -// See Also: generic_bottle_neck() +// See Also: generic_bottle_neck(), sp_cap() // Usage: // generic_bottle_cap(wall, [texture], ...) [ATTACHMENTS]; // Description: -// Creates a basic threaded cap given specifications. +// Creates a basic threaded cap given specifications. You must give exactly two of `thread_od`, `neck_od` and `thread_depth` to +// specify the thread geometry. Note that most glass bottles conform to the SPI standard and caps for them may be more easily produced using {{sp_cap()}}. // Arguments: -// wall = Wall thickness in mm. +// wall = Wall thickness. Default: 2 // texture = The surface texture of the cap. Valid values are "none", "knurled", or "ribbed". Default: "none" // --- -// height = Interior height of the cap in mm. -// thread_od = Outer diameter of the threads in mm. -// tolerance = Extra space to add to the outer diameter of threads and neck in mm. Applied to radius. -// neck_od = Outer diameter of neck in mm. -// flank_angle = Angle of taper on threads. -// pitch = Thread pitch in mm. +// height = Interior height of the cap +// thread_od = Outer diameter of the threads +// neck_od = Outer diameter of neck +// thread_depth = Depth of the threads +// tolerance = Extra space to add to the outer diameter of threads and neck. Applied to radius. Default: 0.2 +// flank_angle = Angle of taper on threads. Default: 15 +// pitch = Thread pitch. Default: 4 // anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER` // spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0` // orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#subsection-orient). Default: `UP` // Extra Anchors: // "inside-top" = Centered on the inside top of the cap. // Examples: -// generic_bottle_cap(); -// generic_bottle_cap(texture="knurled"); -// generic_bottle_cap(texture="ribbed"); +// generic_bottle_cap(thread_depth=2,neck_od=INCH,height=INCH/2); +// generic_bottle_cap(texture="knurled",neck_od=30,thread_od=25,height=10); +// generic_bottle_cap(texture="ribbed",thread_depth=3,thread_od=25,height=13); module generic_bottle_cap( wall = 2, texture = "none", - height = 11.2, - thread_depth = 2.34, + height, + thread_depth, + thread_od, tolerance = .2, - neck_od = 25.5, + neck_od, flank_angle = 15, pitch = 4, anchor = BOTTOM, @@ -582,8 +585,14 @@ module generic_bottle_cap( orient = UP ) { $fn = segs(33 / 2); - threadOuterDTol = neck_od + 2*(thread_depth - 0.8) + 2 * tolerance; // WTF; Engineered for consistency with old code, but - w = threadOuterDTol + 2 * wall; // no clue why this was chosen + dummy = assert(num_defined([thread_od,neck_od,thread_depth])==2, "Must define exactly two of thread_od, neck_od and thread_depth") + assert(is_def(thread_depth) || (all_positive([neck_od,thread_od]) && thread_od>neck_od), "thread_od must be larger than neck_od") + assert(is_undef(thread_depth) || all_positive([thread_depth,first_defined([neck_od,thread_od])]), "thread_depth, and neck_od/thread_od must be positive"); + thread_depth = !is_undef(thread_depth) ? thread_depth : (thread_od - neck_od)/2; + neck_od = !is_undef(neck_od) ? neck_od : thread_od-2*thread_depth; + thread_od = !is_undef(thread_od) ? thread_od : neck_od+2*thread_depth; + threadOuterDTol = thread_od + 2*tolerance; + w = threadOuterDTol + 2 * wall; h = height + wall; neckOuterDTol = neck_od + 2 * tolerance; @@ -600,21 +609,18 @@ module generic_bottle_cap( // For the knurled and ribbed caps the PCO caps in BOSL2 cut into the wall // thickness so the wall+texture are the specified wall thickness. That // seems wrong so this does specified thickness+texture - if (texture == "knurled") { + if (texture == "knurled") cyl(d=w + 1.5*diamMagMult, l=h, texture="diamonds", tex_size=[3,3], tex_style="concave", anchor=BOT); - } else if (texture == "ribbed") { + else if (texture == "ribbed") cyl(d=w + 1.5*diamMagMult, l=h, texture="ribs", tex_size=[3,3], tex_style="min_edge", anchor=BOT); - } else { + else cyl(d = w, l = h, anchor = BOTTOM); - } } up(wall) cyl(d = threadOuterDTol, h = h, anchor = BOTTOM); } - difference(){ - up(wall + pitch / 2) { - thread_helix(d = neckOuterDTol, pitch = pitch, thread_depth = thread_depth, flank_angle = flank_angle, - turns = ((height - pitch) / pitch), lead_in = -thread_depth, internal = true, anchor = BOTTOM); - } + up(wall + pitch / 2) { + thread_helix(d = neckOuterDTol+.02, pitch = pitch, thread_depth = thread_depth+.01, flank_angle = flank_angle, + turns = ((height - pitch) / pitch), lead_in = -thread_depth, internal = true, anchor = BOTTOM); } } children(); From 8e3c2675e8f388717364a88052e910c89a01d387 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Mon, 1 Apr 2024 23:59:51 -0400 Subject: [PATCH 5/5] fix example error --- bottlecaps.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bottlecaps.scad b/bottlecaps.scad index 5b9cf17..0a15080 100644 --- a/bottlecaps.scad +++ b/bottlecaps.scad @@ -568,7 +568,7 @@ function generic_bottle_neck( // "inside-top" = Centered on the inside top of the cap. // Examples: // generic_bottle_cap(thread_depth=2,neck_od=INCH,height=INCH/2); -// generic_bottle_cap(texture="knurled",neck_od=30,thread_od=25,height=10); +// generic_bottle_cap(texture="knurled",neck_od=25,thread_od=30,height=10); // generic_bottle_cap(texture="ribbed",thread_depth=3,thread_od=25,height=13); module generic_bottle_cap( wall = 2,