Skip to content

Commit b7cbbcf

Browse files
tex_scale->tex_depth, tex_count->tex_reps
1 parent cb4169d commit b7cbbcf

File tree

2 files changed

+120
-62
lines changed

2 files changed

+120
-62
lines changed

shapes3d.scad

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,10 +1363,10 @@ function cylinder(h, r1, r2, center, r, d, d1, d2, anchor, spin=0, orient=UP) =
13631363
// teardrop = If given as a number, rounding around the bottom edge of the cylinder won't exceed this many degrees from vertical. If true, the limit angle is 45 degrees. Default: `false`
13641364
// texture = A texture name string, or a rectangular array of scalar height values (0.0 to 1.0), or a VNF tile that defines the texture to apply to vertical surfaces. See {{texture()}} for what named textures are supported.
13651365
// tex_size = An optional 2D target size for the textures. Actual texture sizes will be scaled somewhat to evenly fit the available surface. Default: `[5,5]`
1366-
// tex_reps = If given instead of tex_size, gives the tile repetition counts for textures over the surface length and height.
1366+
// tex_reps = If given instead of tex_size, a 2-vector giving the number of texture tile repetitions in the horizontal and vertical directions.
13671367
// tex_inset = If numeric, lowers the texture into the surface by that amount, before the tex_scale multiplier is applied. If `true`, insets by exactly `1`. Default: `false`
1368-
// tex_rot = If true, rotates the texture 90º.
1369-
// tex_scale = Scaling multiplier for the texture depth.
1368+
// tex_rot = Rotate texture by specified angle, which must be a multiple of 90 degrees. A value of true is equivalent to 90 deg, and false to 0. Default: 0
1369+
// tex_depth = Specify texture depth; if negative, invert the texture. Default: 1.
13701370
// tex_samples = Minimum number of "bend points" to have in VNF texture tiles. Default: 8
13711371
// tex_taper = If given as a number, tapers the texture height to zero over the first and last given percentage of the path. If given as a lookup table with indices between 0 and 100, uses the percentage lookup table to ramp the texture heights. Default: `undef` (no taper)
13721372
// style = {{vnf_vertex_array()}} style used to triangulate heightfield textures. Default: "min_edge"
@@ -1510,17 +1510,20 @@ function cyl(
15101510
from_end, from_end1, from_end2,
15111511
texture, tex_size=[5,5], tex_reps, tex_counts,
15121512
tex_inset=false, tex_rot=false,
1513-
tex_scale=1, tex_samples, length, height,
1513+
tex_scale, tex_depth, tex_samples, length, height,
15141514
tex_taper, style, tex_style,
15151515
anchor, spin=0, orient=UP
15161516
) =
15171517
assert(num_defined([style,tex_style])<2, "In cyl() the 'tex_style' parameters has been replaced by 'style'. You cannot give both.")
15181518
assert(num_defined([tex_reps,tex_counts])<2, "In cyl() the 'tex_counts' parameters has been replaced by 'tex_reps'. You cannot give both.")
1519+
assert(num_defined([tex_scale,tex_depth])<2, "In linear_sweep() the 'tex_scale' parameter has been replaced by 'tex_depth'. You cannot give both.")
15191520
let(
15201521
style = is_def(tex_style)? echo("In cyl() the 'tex_style' parameter is deprecated and has been replaced by 'style'")tex_style
15211522
: default(style,"min_edge"),
15221523
tex_reps = is_def(tex_counts)? echo("In cyl() the 'tex_counts' parameter is deprecated and has been replaced by 'tex_reps'")tex_counts
15231524
: tex_reps,
1525+
tex_depth = is_def(tex_scale)? echo("In rotate_sweep() the 'tex_scale' parameter is deprecated and has been replaced by 'tex_depth'")tex_scale
1526+
: default(tex_depth,1),
15241527
l = one_defined([l, h, length, height],"l,h,length,height",dflt=1),
15251528
_r1 = get_radius(r1=r1, r=r, d1=d1, d=d, dflt=1),
15261529
_r2 = get_radius(r1=r2, r=r, d1=d2, d=d, dflt=1),
@@ -1668,17 +1671,20 @@ module cyl(
16681671
from_end, from_end1, from_end2,
16691672
texture, tex_size=[5,5], tex_reps, tex_counts,
16701673
tex_inset=false, tex_rot=false,
1671-
tex_scale=1, tex_samples, length, height,
1674+
tex_scale, tex_depth, tex_samples, length, height,
16721675
tex_taper, style, tex_style,
16731676
anchor, spin=0, orient=UP
16741677
) {
16751678
dummy=
16761679
assert(num_defined([style,tex_style])<2, "In cyl() the 'tex_style' parameters has been replaced by 'style'. You cannot give both.")
1677-
assert(num_defined([tex_reps,tex_counts])<2, "In cyl() the 'tex_counts' parameters has been replaced by 'tex_reps'. You cannot give both.");
1680+
assert(num_defined([tex_reps,tex_counts])<2, "In cyl() the 'tex_counts' parameters has been replaced by 'tex_reps'. You cannot give both.")
1681+
assert(num_defined([tex_scale,tex_depth])<2, "In cyl() the 'tex_scale' parameter has been replaced by 'tex_depth'. You cannot give both.");
16781682
style = is_def(tex_style)? echo("In cyl the 'tex_style()' parameters is deprecated and has been replaced by 'style'")tex_style
16791683
: default(style,"min_edge");
16801684
tex_reps = is_def(tex_counts)? echo("In cyl() the 'tex_counts' parameter is deprecated and has been replaced by 'tex_reps'")tex_counts
16811685
: tex_reps;
1686+
tex_depth = is_def(tex_scale)? echo("In rotate_sweep() the 'tex_scale' parameter is deprecated and has been replaced by 'tex_depth'")tex_scale
1687+
: default(tex_depth,1);
16821688
l = one_defined([l, h, length, height],"l,h,length,height",dflt=1);
16831689
_r1 = get_radius(r1=r1, r=r, d1=d1, d=d, dflt=1);
16841690
_r2 = get_radius(r1=r2, r=r, d1=d2, d=d, dflt=1);

0 commit comments

Comments
 (0)