doc fixes, allow threads=true with screw specs

This commit is contained in:
Adrian Mariano 2023-02-06 18:31:01 -05:00
parent f9b06bf8f6
commit 2d35733980
3 changed files with 12 additions and 10 deletions

View file

@ -29,7 +29,7 @@
// then the `c` variable is set only in the scope of the `if` and `else` clauses and is not available later on when you actually // then the `c` variable is set only in the scope of the `if` and `else` clauses and is not available later on when you actually
// try to use it. Instead you must use the ternary operator and write: // try to use it. Instead you must use the ternary operator and write:
// ``` // ```
/// c = condition ? "red" : "green"; // c = condition ? "red" : "green";
// ``` // ```
// The second complication is // The second complication is
// that in OpenSCAD version 2021.01 and earlier, assignments in children were executed before their parent. This means // that in OpenSCAD version 2021.01 and earlier, assignments in children were executed before their parent. This means

View file

@ -470,7 +470,7 @@ function _get_spec(spec, needtype, origin, thread, // common parameters
: nut_info(name,_origin=origin, thread=thread, shape=shape, thickness=thickness)) : nut_info(name,_origin=origin, thread=thread, shape=shape, thickness=thickness))
: :
assert(in_list(struct_val(spec,"type"), ["nut_info","screw_info"]), "Screw/nut spec is invalid struct type") assert(in_list(struct_val(spec,"type"), ["nut_info","screw_info"]), "Screw/nut spec is invalid struct type")
assert(is_undef(thread) || thread=="none" || thread==false || is_num(thread), assert(is_undef(thread) || thread=="none" || thread==false || thread==true || is_num(thread),
str("Thread type applied to struct specification must be numeric, \"none\" or false but got ",thread)) str("Thread type applied to struct specification must be numeric, \"none\" or false but got ",thread))
assert(is_undef(thickness) || is_num(thickness), str("thickness applied to struct specification must be numeric but is ",thickness)) assert(is_undef(thickness) || is_num(thickness), str("thickness applied to struct specification must be numeric but is ",thickness))
assert(is_undef(head) || head=="none", str("The only head type allowed with struct specifications is \"none\" but got ",head)) assert(is_undef(head) || head=="none", str("The only head type allowed with struct specifications is \"none\" but got ",head))
@ -483,7 +483,7 @@ function _get_spec(spec, needtype, origin, thread, // common parameters
if (head=="none") ["head","none"], if (head=="none") ["head","none"],
if (head=="none") ["drive","none"], if (head=="none") ["drive","none"],
if (thread==false || thread=="none") ["pitch",0] if (thread==false || thread=="none") ["pitch",0]
else ["pitch",thread], else if (thread!=true) ["pitch",thread],
["thickness", thickness], ["thickness", thickness],
], grow=false) ], grow=false)
) )
@ -738,8 +738,8 @@ module screw(spec, head, drive, thread, drive_size,
// thread = thread type or specification for threaded masks, or false to make an unthreaded mask. See [screw pitch](#subsection-standard-screw-pitch). Default: false // thread = thread type or specification for threaded masks, or false to make an unthreaded mask. See [screw pitch](#subsection-standard-screw-pitch). Default: false
// teardrop = if true produce teardrop hole. Only compatible with clearance holes, not threaded. Default: false // teardrop = if true produce teardrop hole. Only compatible with clearance holes, not threaded. Default: false
// oversize = amount to increase diameter of all screw parts, a scalar or length 3 vector. Default: 0 // oversize = amount to increase diameter of all screw parts, a scalar or length 3 vector. Default: 0
// oversize_hole = amount to increase diameter of the hole. // hole_oversize = amount to increase diameter of the hole.
// oversize_head = amount to increase diameter of head. // head_oversize = amount to increase diameter of head.
// length / l= length of screw (in mm) // length / l= length of screw (in mm)
// counterbore = set to length of counterbore, or true to make a counterbore equal to head height. Default: false for flat heads and headless, true otherwise // counterbore = set to length of counterbore, or true to make a counterbore equal to head height. Default: false for flat heads and headless, true otherwise
// tolerance = threading or clearance hole tolerance. For internal threads, detrmines actual thread geometry based on nominal sizing. See [tolerance](#subsection-tolerance). Default is "2B" for UTS and 6H for ISO. For clearance holes, determines how much clearance to add. Default is "normal". // tolerance = threading or clearance hole tolerance. For internal threads, detrmines actual thread geometry based on nominal sizing. See [tolerance](#subsection-tolerance). Default is "2B" for UTS and 6H for ISO. For clearance holes, determines how much clearance to add. Default is "normal".
@ -810,6 +810,8 @@ module screw_hole(spec, head, thread, oversize, hole_oversize, head_oversize,
if (threaded || is_def(oversize) || is_def(hole_oversize) || tolerance==0 || tolerance=="none") { if (threaded || is_def(oversize) || is_def(hole_oversize) || tolerance==0 || tolerance=="none") {
undersize = is_def(oversize) ? -oversize undersize = is_def(oversize) ? -oversize
: -[default(hole_oversize,0), default(head_oversize,0)]; : -[default(hole_oversize,0), default(head_oversize,0)];
echo_struct(spec);
fdsa= echo(undersize=undersize);
default_tag("remove") default_tag("remove")
screw(spec,head=head,thread=thread,undersize=undersize, higbee=higbee, screw(spec,head=head,thread=thread,undersize=undersize, higbee=higbee,
length=length,l=l,thread_len=thread_len, tolerance=tolerance, _counterbore=counterbore, length=length,l=l,thread_len=thread_len, tolerance=tolerance, _counterbore=counterbore,
@ -1775,7 +1777,7 @@ module nut_trap_inline(length, spec, shape, l, height, h, nutwidth, anchor, orie
// --- // ---
// thread = thread type or specification. See [screw pitch](#subsection-standard-screw-pitch). Default: "coarse" // thread = thread type or specification. See [screw pitch](#subsection-standard-screw-pitch). Default: "coarse"
// drive_size = size of drive recess to override computed value // drive_size = size of drive recess to override computed value
// oversize = amount to increase screw diameter for clearance holes. Default: 0 // threads_oversize = amount to increase screw diameter for clearance holes. Default: 0
// head_oversize = amount to increase head diameter for countersink holes. Default: 0 // head_oversize = amount to increase head diameter for countersink holes. Default: 0
function screw_info(name, head, drive, thread, drive_size, threads_oversize=0, head_oversize=0, _origin) = function screw_info(name, head, drive, thread, drive_size, threads_oversize=0, head_oversize=0, _origin) =

View file

@ -2691,13 +2691,13 @@ function associate_vertices(polygons, split, curpoly=0) =
// rect(30), texture=tex, h=30, // rect(30), texture=tex, h=30,
// tex_size=[10,10] // tex_size=[10,10]
// ); // );
// Example(3D,VPR=[84.4,0,4.7]): **"checkers"** (VNF) = A pattern of alternating checkerboard squares. Giving `inset=` specifies that the top face of the checker surface is smaller than the bottom by `inset` on each of the four sides. As `inset` approaches 0.5 the tops come to sharp corners. You must set `inset` strictly between 0 and 0.5. Default: 0.05. // Example(3D,VPR=[84.4,0,4.7],VPT=[2.44496,6.53317,14.6135],VPD = 126): **"checkers"** (VNF) = A pattern of alternating checkerboard squares. Giving `inset=` specifies that the top face of the checker surface is smaller than the bottom by `inset` on each of the four sides. As `inset` approaches 0.5 the tops come to sharp corners. You must set `inset` strictly between 0 and 0.5. Default: 0.05.
// tex = texture("checkers"); // tex = texture("checkers");
// linear_sweep( // linear_sweep(
// rect(30), texture=tex, h=30, // rect(30), texture=tex, h=30,
// tex_size=[10,10] // tex_size=[10,10]
// ); // );
// Example(3D,VPR=[76,0,24]): "checkers" texture with large inset. // Example(3D,VPR=[84.4,0,4.7],VPT=[2.44496,6.53317,14.6135],VPD = 126): "checkers" texture with large inset.
// tex = texture("checkers",inset=0.25); // tex = texture("checkers",inset=0.25);
// linear_sweep( // linear_sweep(
// rect(30), texture=tex, h=30, // rect(30), texture=tex, h=30,
@ -2709,13 +2709,13 @@ function associate_vertices(polygons, split, curpoly=0) =
// rect(30), texture=tex, h=30, tex_scale=3, // rect(30), texture=tex, h=30, tex_scale=3,
// tex_size=[10,10] // tex_size=[10,10]
// ); // );
// Example(3D): **"cubes"** (VNF) = Corner-cubes texture. Note that this texture needs to be scaled in vertically by sqrt(3) to have its correct aspect // Example(3D): **"cubes"** (VNF) = Corner-cubes texture. This texture needs to be scaled in vertically by sqrt(3) to have its correct aspect
// tex = texture("cubes"); // tex = texture("cubes");
// linear_sweep( // linear_sweep(
// rect(30), texture=tex, h=30, // rect(30), texture=tex, h=30,
// tex_size=[10,10] // tex_size=[10,10]
// ); // );
// Example(3D): "cubes" texture at approximately the correct scale. // Example(3D): "cubes" texture at the correct scale.
// tex = texture("cubes"); // tex = texture("cubes");
// linear_sweep( // linear_sweep(
// rect(30), texture=tex, h=20*sqrt(3), tex_scale=3, // rect(30), texture=tex, h=20*sqrt(3), tex_scale=3,