mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-14 05:14:14 +02:00
bugfixes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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) :
|
||||
|
Reference in New Issue
Block a user