More screws.scad docs formatting.

This commit is contained in:
Revar Desmera 2020-05-25 16:41:41 -07:00
parent 02789c91d9
commit 88699c12af
2 changed files with 157 additions and 172 deletions

View file

@ -56,113 +56,98 @@ function _parse_drive(drive=undef, drive_size=undef) =
// Function: screw_info() // Function: screw_info()
// Usage: // Usage:
// info = screw_info(name, [head], [thread], [drive], [drive_size], [oversize]) // info = screw_info(name, [head], [thread], [drive], [drive_size], [oversize])
//
// Description: // Description:
// Look up screw characteristics for the specified screw type. // Look up screw characteristics for the specified screw type.
// . // .
// For metric (ISO) `name` is M<size>x<pitch>,<length>, e.g. `"M6x1,10"` specifies a 6mm diameter screw with a thread pitch of 1mm and length of 10mm. // For metric (ISO) the `name=` argument is formatted in a string like: "M<size>x<pitch>,<length>".
// e.g. `"M6x1,10"` specifies a 6mm diameter screw with a thread pitch of 1mm and length of 10mm.
// You can omit the pitch or length, e.g. `"M6x1"`, or `"M6,10"`, or just `"M6"`. // You can omit the pitch or length, e.g. `"M6x1"`, or `"M6,10"`, or just `"M6"`.
// . // .
// For English (UTS) name is <size>-<threadcount>,<length>, e.g. `"#8-32,1/2"`, or `"1/4-20,1"`. Units are in inches, including the length. // For English (UTS) `name=` is a string like "<size>-<threadcount>,<length>".
// Size can be a number from 0 to 12 with or without a leading '#' to specify a screw gauge size, or any other value to specify // e.g. `"#8-32,1/2"`, or `"1/4-20,1"`. Units are in inches, including the length. Size can be a
// a diameter in inches, either as a float or a fraction, so `"0.5-13"` and `"1/2-13"` are equivalent. To force interpretation of the value // number from 0 to 12 with or without a leading '#' to specify a screw gauge size, or any other
// as inches add `''` to the end, e.g. `"1''-4"` is a one inch screw and `"1-80"` is a very small 1-gauge screw. The pitch is specified // value to specify a diameter in inches, either as a float or a fraction, so `"0.5-13"` and
// using a thread count, the number of threads per inch. The length is in inches. // `"1/2-13"` are equivalent. To force interpretation of the value as inches add `''` (two
// single-quotes) to the end, e.g. `"1''-4"` is a one inch screw and `"1-80"` is a very small
// 1-gauge screw. The pitch is specified using a thread count, the number of threads per inch.
// The length is in inches.
// . // .
// If you omit the pitch then a standard screw pitch will be supplied from lookup tables for the screw diameter you have chosen. // If you omit the pitch then a standard screw pitch will be supplied from lookup tables for the
// For each screw diameter, multiple standard pitches are possible. // screw diameter you have chosen. For each screw diameter, multiple standard pitches are possible.
// For the UTS system these the availble thread types are: // The available thread pitch types are:
// - "coarse" or "UNC" // - `"coarse"`
// - "fine" or "UNF" // - `"fine"`
// - "extra fine", "extrafine" or "UNEF". // - `"extrafine"` or `"extra fine"`
// The ISO system defines a coarse threading and three different fine threadings but does not give different names to the fine threadings. // - `"superfine"` or `"super fine"` (Metric/ISO only.)
// The thread options for ISO are: // - `"UNC"` (English/UTS only. Same as `"coarse"`.)
// - "coarse" // - `"UNF"` (English/UTS only. Same as `"fine"`.)
// - "fine" // - `"UNEF"` (English/UTS only. Same as `"extrafine"`.)
// - "extra fine" or "extrafine"
// - "super fine" or "superfine"
// The default pitch selection is "coarse". Note that this selection is case independent. Set
// `thread` to one of these values to choose a different pitch. Note that not every pitch category is defined at every
// diameter. You can also specify the thread pitch directly, for example you could set `thread=2` which would
// produce threads with a pitch of 2mm. The final option is to specify `thread="none"` to produce an unthreaded
// screw either to simplify the model or to use for cutting out screw holes. Setting the pitch to zero also produces
// an unthreaded screw. If you specify a numeric thread value it will override any value given in `name`.
// . // .
// The `head` parameter specifies the type of head the screw will have. Options for the head are // The default pitch selection is `"coarse"`. Note that this selection is case insensitive. Set the
// - "flat" // `thread=` argument to one of these values to choose a different pitch. Note that not every pitch
// - "flat small" // category is defined at every diameter. You can also specify the thread pitch directly, for example
// - "flat large" // you could set `thread=2` which would produce threads with a pitch of 2mm. The final option is to
// - "flat undercut" // specify `thread="none"` to produce an unthreaded screw either to simplify the model or to use for
// - "round" // cutting out screw holes. Setting the pitch to `0` (zero) also produces an unthreaded screw.
// - "pan" // If you specify a numeric thread value it will override any value given in the `name=` argument.
// - "pan flat"
// - "pan round"
// - "socket"
// - "hex"
// - "button"
// - "cheese"
// - "fillister"
// - "none"
// Note that different sized flat heads exist for the same screw type. Sometimes this depends on the type of recess. If you specify "flat" then
// the size will be chosen appropriately for the recess you specify. The default is "none".
// . // .
// The `drive` parameter specifies the recess type. Options for the drive are // The `head=` parameter specifies the type of head the screw will have. Options for the head are
// - "none" // `"flat"`, `"flat small"`, `"flat large"`, `"flat undercut"`, `"round"`, `"pan"`, `"pan flat"`,
// - "phillips" // `"pan round"`, `"socket"`, `"hex"`, `"button"`, `"cheese"`, `"fillister"`, or `"none"`
// - "slot"
// - "torx"
// - "hex"
// - "ph0", up to "ph4" for phillips of the specified size
// - "t<size>" for torx at a specified size, e.g. "t20"
// The default drive is "none"
// . // .
// Only some combinations of head and drive type are supported. Supported UTS (English) head and drive combinations: // Note that different sized flat heads exist for the same screw type. Sometimes this depends on
// the type of recess. If you specify `"flat"` then the size will be chosen appropriately for the
// recess you specify. The default is `"none"`.
// .
// The `drive=` argument specifies the recess type. Options for the drive are `"none"`, `"hex"`,
// `"slot"`, `"phillips"`, `"ph0"` to `"ph4"` (for phillips of the specified size), `"torx"` or
// `"t<size>"` (for Torx at a specified size, e.g. `"t20"`). The default drive is `"none"`
// .
// Only some combinations of head and drive type are supported:
// . // .
// Head | Drive // Head | Drive
// ------------- | ---------------------------- // ----------------- | ----------------------------
// none | hex, torx // `"none"` | hex, torx
// hex | // `"hex"` | *none*
// socket | hex, torx // `"socket"` | hex, torx
// button | hex, torx // `"button"` | hex, torx
// round | slot, phillips // `"flat"` | slot, phillips, hex, torx
// fillister | slot, phillips // `"round"` | slot, phillips (UTS/English only.)
// flat | slot, phillips, hex, torx // `"fillister"` | slot, phillips (UTS/English only.)
// flat small | phillips, slot // `"flat small"` | phillips, slot (UTS/English only.)
// flat large | hex, torx // `"flat large"` | hex, torx (UTS/English only.)
// flat undercut | slot, phillips // `"flat undercut"` | slot, phillips (UTS/English only.)
// `"pan"` | slot, phillips (ISO/Metric only.)
// `"cheese"` | slot, phillips (ISO/Metric only.)
// . // .
// Supported metric head and drive combinations: // The drive size is specified appropriately to the drive type: drive number for phillips or torx,
// and allen width in mm or inches (as appropriate) for hex. Drive size is determined automatically
// from the screw size, but by passing the `drive_size=` argument you can override the default, or
// in cases where no default exists you can specify it.
// . // .
// Head | Drive // The `oversize=` parameter adds the specified amount to the screw and head diameter to make an
// ------ | ---------------------------- // oversized screw. This is intended for generating clearance holes, not for dealing with printer
// none | hex, torx // inaccuracy. Does not affect length, thread pitch or head height.
// hex |
// socket | hex, torx
// pan | slot, phillips
// button | hex, torx
// cheese | slot, phillips
// flat | phillips, slot, hex, torx
// . // .
// The drive size is specified appropriately to the drive type: drive number for phillips or torx, and allen width in mm or inches (as appropriate) for hex. // The output is a [[struct|structs.scad]] with the following fields:
// Drive size is determined automatically from the screw size, but by passing the `drive_size` parameter
// you can override the default, or in cases where no default exists you can specify it.
// . // .
// The `oversize` parameter adds the specified amount to the screw and head diameter to make an oversized screw. // Field | What it is
// This is intended for generating clearance holes, not for dealing with printer inaccuracy. Does not affect length, thread pitch or head height. // ------------------ | ---------------
// . // `"system"` | Either `"UTS"` or `"ISO"` (used for correct tolerance computation).
// The output is a structure with the following fields: // `"diameter"` | The nominal diameter of the screw shaft in mm.
// - system: either "UTS" or "ISO" (used for correct tolerance computation) // `"pitch"` | The thread pitch in mm.
// - diameter: the nominal diameter of the screw shaft in mm // `"head"` | The type of head (a string from the list above).
// - pitch: the thread pitch in mm // `"head_size"` | Size of the head in mm.
// - head: the type of head (a string from the list above) // `"head_angle"` | Countersink angle for flat heads.
// - head_size: size of the head in mm // `"head_height"` | Height of the head (when needed to specify the head).
// - head_angle: countersink angle for flat heads // `"drive"` | The drive type (`"phillips"`, `"torx"`, `"slot"`, `"hex"`, `"none"`)
// - head_height: height of the head (when needed to specify the head) // `"drive_size"` | The drive size, either a drive number (phillips or torx) or a dimension in mm (hex). Not defined for slot drive.
// - drive: the drive type ("phillips", "torx", "slot", "hex", "none") // `"drive_diameter"` | Diameter of a phillips drive.
// - drive_size: the drive size, either a drive number (phillips or torx) or a dimension in mm (hex). Not defined for slot drive // `"drive_width"` | Width of the arms of the cross in a phillips drive or the slot for a slot drive.
// - drive_diameter: diameter of a phillips drive // `"drive_depth"` | Depth of the drive recess.
// - drive_width: width of the arms of the cross in a phillips drive or the slot for a slot drive // `"length"` | Length of the screw in mm measured in the customary fashion. For flat head screws the total length and for other screws, the length from the bottom of the head to the screw tip.
// - drive_depth: depth of the drive recess //
// - length: length of the screw in mm measured in the customary fashion: for flat head screws the total length and for other screws, the length from the bottom of the head to the screw tip.
// Arguments: // Arguments:
// name = screw specification, e.g. "M5x1" or "#8-32" // name = screw specification, e.g. "M5x1" or "#8-32"
// head = head type (see list above). Default: none // head = head type (see list above). Default: none

View file

@ -8,7 +8,7 @@
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
BOSL_VERSION = [2,0,326]; BOSL_VERSION = [2,0,327];
// Section: BOSL Library Version Functions // Section: BOSL Library Version Functions