From ca0063972f1d6bf7dba3d417d776d028771c0fd9 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Thu, 10 Apr 2025 23:06:38 -0400 Subject: [PATCH] bugfixes --- bottlecaps.scad | 16 ++++++++-------- shapes3d.scad | 6 +++--- skin.scad | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/bottlecaps.scad b/bottlecaps.scad index 8e398f90..a3cb99e2 100644 --- a/bottlecaps.scad +++ b/bottlecaps.scad @@ -198,9 +198,9 @@ module pco1810_cap(h, r, d, wall, texture="none", anchor=BOTTOM, spin=0, orient= difference() { union() { if (texture == "knurled") { - cyl(d=w, h=hh, texture="diamonds", tex_size=[3,3], tex_style="concave", anchor=BOT); + cyl(d=w, h=hh, texture="diamonds", tex_size=[3,3], style="concave", anchor=BOT); } else if (texture == "ribbed") { - cyl(d=w, h=hh, texture="ribs", tex_size=[3,3], tex_style="min_edge", anchor=BOT); + cyl(d=w, h=hh, texture="ribs", tex_size=[3,3], style="min_edge", anchor=BOT); } else { cyl(d=w, l=hh, anchor=BOTTOM); } @@ -387,9 +387,9 @@ module pco1881_cap(wall=2, texture="none", anchor=BOTTOM, spin=0, orient=UP) difference() { union() { if (texture == "knurled") { - cyl(d=w, h=11.2+wall, texture="diamonds", tex_size=[3,3], tex_style="concave", anchor=BOT); + cyl(d=w, h=11.2+wall, texture="diamonds", tex_size=[3,3], style="concave", anchor=BOT); } else if (texture == "ribbed") { - cyl(d=w, h=11.2+wall, texture="ribs", tex_size=[3,3], tex_style="min_edge", anchor=BOT); + cyl(d=w, h=11.2+wall, texture="ribs", tex_size=[3,3], style="min_edge", anchor=BOT); } else { cyl(d=w, l=11.2+wall, anchor=BOTTOM); } @@ -610,9 +610,9 @@ module generic_bottle_cap( // thickness so the wall+texture are the specified wall thickness. That // seems wrong so this does specified thickness+texture if (texture == "knurled") - cyl(d=w + 1.5*diamMagMult, l=h, texture="diamonds", tex_size=[3,3], tex_style="concave", anchor=BOT); + cyl(d=w + 1.5*diamMagMult, l=h, texture="diamonds", tex_size=[3,3], style="concave", anchor=BOT); else if (texture == "ribbed") - cyl(d=w + 1.5*diamMagMult, l=h, texture="ribs", tex_size=[3,3], tex_style="min_edge", anchor=BOT); + cyl(d=w + 1.5*diamMagMult, l=h, texture="ribs", tex_size=[3,3], style="min_edge", anchor=BOT); else cyl(d = w, l = h, anchor = BOTTOM); } @@ -1314,9 +1314,9 @@ module sp_cap(diam,type,wall,style="L",top_adj=0, bot_adj=0, texture="none", anc difference(){ up(wall){ if (texture=="knurled") - cyl(d=T+space+2*wall,l=H+wall-bot_adj,anchor=TOP,texture="trunc_pyramids", tex_size=[3,3], tex_style="convex"); + cyl(d=T+space+2*wall,l=H+wall-bot_adj,anchor=TOP,texture="trunc_pyramids", tex_size=[3,3], style="convex"); else if (texture == "ribbed") - cyl(d=T+space+2*wall,l=H+wall-bot_adj,anchor=TOP,chamfer2=.8,tex_taper=0,texture="trunc_ribs", tex_size=[3,3], tex_style="min_edge"); + cyl(d=T+space+2*wall,l=H+wall-bot_adj,anchor=TOP,chamfer2=.8,tex_taper=0,texture="trunc_ribs", tex_size=[3,3], style="min_edge"); else cyl(d=T+space+2*wall,l=H+wall-bot_adj,anchor=TOP,chamfer2=.8); } diff --git a/shapes3d.scad b/shapes3d.scad index b0056522..0f1c6f87 100644 --- a/shapes3d.scad +++ b/shapes3d.scad @@ -2293,8 +2293,8 @@ function cyl( extra, extra1, extra2, anchor, spin=0, orient=UP ) = - assert(num_defined([style,tex_style])<2, "In cyl() the 'tex_style' parameters has been replaced by 'style'. You cannot give both.") - assert(num_defined([tex_reps,tex_counts])<2, "In cyl() the 'tex_counts' parameters has been replaced by 'tex_reps'. You cannot give both.") + assert(num_defined([style,tex_style])<2, "In cyl() the 'tex_style' parameter has been replaced by 'style'. You cannot give both.") + assert(num_defined([tex_reps,tex_counts])<2, "In cyl() the 'tex_counts' parameter has been replaced by 'tex_reps'. You cannot give both.") assert(num_defined([tex_scale,tex_depth])<2, "In cyl() the 'tex_scale' parameter has been replaced by 'tex_depth'. You cannot give both.") let( style = is_def(tex_style)? echo("In cyl() the 'tex_style' parameter is deprecated and has been replaced by 'style'")tex_style @@ -2393,7 +2393,7 @@ module cyl( assert(num_defined([style,tex_style])<2, "In cyl() the 'tex_style' parameters has been replaced by 'style'. You cannot give both.") assert(num_defined([tex_reps,tex_counts])<2, "In cyl() the 'tex_counts' parameters has been replaced by 'tex_reps'. You cannot give both.") assert(num_defined([tex_scale,tex_depth])<2, "In cyl() the 'tex_scale' parameter has been replaced by 'tex_depth'. You cannot give both."); - style = is_def(tex_style)? echo("In cyl the 'tex_style()' parameters is deprecated and has been replaced by 'style'")tex_style + style = is_def(tex_style)? echo("In cyl() the 'tex_style' parameter is deprecated and has been replaced by 'style'")tex_style : default(style,"min_edge"); tex_reps = is_def(tex_counts)? echo("In cyl() the 'tex_counts' parameter is deprecated and has been replaced by 'tex_reps'")tex_counts : tex_reps; diff --git a/skin.scad b/skin.scad index 7b41723d..5cbbde44 100644 --- a/skin.scad +++ b/skin.scad @@ -4040,7 +4040,7 @@ function _validate_texture(texture) = function _tex_height(scale, inset, z) = scale<0 ? -(1-z - inset) * scale : (z - inset) * scale; -function _get_texture(texture, tex_rot, extra_rot=0) = +function _get_texture(texture, tex_rot) = let( tex_rot=!is_bool(tex_rot)? tex_rot : echo("boolean value for tex_rot is deprecated. Use a numerical angle divisible by 90.") tex_rot?90:0 @@ -4049,7 +4049,7 @@ function _get_texture(texture, tex_rot, extra_rot=0) = let( tex = is_string(texture)? texture(texture,$fn=_tex_fn_default()) : texture, check_tex = _validate_texture(tex), - tex_rot = posmod(tex_rot+extra_rot,360) + tex_rot = posmod(tex_rot,360) ) tex_rot==0 ? tex : is_vnf(tex)? zrot(tex_rot, cp=[1/2,1/2], p=tex) @@ -4088,7 +4088,7 @@ function _textured_linear_sweep( caps = is_bool(caps) ? [caps,caps] : caps, regions = is_path(region,2)? [[region]] : region_parts(region), - texture = _get_texture(texture, tex_rot), + texture = _get_texture(texture, rot), dummy = assert(is_undef(samples) || is_vnf(texture), "You gave the tex_samples argument with a heightfield texture, which is not permitted. Use the n= argument to texture() instead"), h = first_defined([h, l, height, length, 1]), inset = is_num(inset)? inset : inset? 1 : 0, @@ -4368,7 +4368,7 @@ function _textured_revolution( ) assert(closed || is_path(shape,2)) let( - texture = _get_texture(texture, tex_rot), + texture = _get_texture(texture, rot), dummy = assert(is_undef(samples) || is_vnf(tex), "You gave the tex_samples argument with a heightfield texture, which is not permitted. Use the n= argument to texture() instead"), inset = is_num(inset)? inset : inset? 1 : 0, samples = !is_vnf(texture)? len(texture) :