mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2024-12-29 16:29:40 +00:00
More screws.scad docs formatting.
This commit is contained in:
parent
02789c91d9
commit
88699c12af
2 changed files with 157 additions and 172 deletions
169
screws.scad
169
screws.scad
|
@ -56,113 +56,98 @@ function _parse_drive(drive=undef, drive_size=undef) =
|
|||
// Function: screw_info()
|
||||
// Usage:
|
||||
// info = screw_info(name, [head], [thread], [drive], [drive_size], [oversize])
|
||||
//
|
||||
// Description:
|
||||
// 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"`.
|
||||
// .
|
||||
// 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.
|
||||
// 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
|
||||
// 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
|
||||
// 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
|
||||
// using a thread count, the number of threads per inch. The length is in inches.
|
||||
// For English (UTS) `name=` is a string like "<size>-<threadcount>,<length>".
|
||||
// e.g. `"#8-32,1/2"`, or `"1/4-20,1"`. Units are in inches, including the 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 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 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.
|
||||
// For each screw diameter, multiple standard pitches are possible.
|
||||
// For the UTS system these the availble thread types are:
|
||||
// - "coarse" or "UNC"
|
||||
// - "fine" or "UNF"
|
||||
// - "extra fine", "extrafine" or "UNEF".
|
||||
// The ISO system defines a coarse threading and three different fine threadings but does not give different names to the fine threadings.
|
||||
// The thread options for ISO are:
|
||||
// - "coarse"
|
||||
// - "fine"
|
||||
// - "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`.
|
||||
// If you omit the pitch then a standard screw pitch will be supplied from lookup tables for the
|
||||
// screw diameter you have chosen. For each screw diameter, multiple standard pitches are possible.
|
||||
// The available thread pitch types are:
|
||||
// - `"coarse"`
|
||||
// - `"fine"`
|
||||
// - `"extrafine"` or `"extra fine"`
|
||||
// - `"superfine"` or `"super fine"` (Metric/ISO only.)
|
||||
// - `"UNC"` (English/UTS only. Same as `"coarse"`.)
|
||||
// - `"UNF"` (English/UTS only. Same as `"fine"`.)
|
||||
// - `"UNEF"` (English/UTS only. Same as `"extrafine"`.)
|
||||
// .
|
||||
// The `head` parameter specifies the type of head the screw will have. Options for the head are
|
||||
// - "flat"
|
||||
// - "flat small"
|
||||
// - "flat large"
|
||||
// - "flat undercut"
|
||||
// - "round"
|
||||
// - "pan"
|
||||
// - "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 default pitch selection is `"coarse"`. Note that this selection is case insensitive. Set the
|
||||
// `thread=` argument 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 `0` (zero) also produces an unthreaded screw.
|
||||
// If you specify a numeric thread value it will override any value given in the `name=` argument.
|
||||
// .
|
||||
// The `drive` parameter specifies the recess type. Options for the drive are
|
||||
// - "none"
|
||||
// - "phillips"
|
||||
// - "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"
|
||||
// The `head=` parameter specifies the type of head the screw will have. Options for the head are
|
||||
// `"flat"`, `"flat small"`, `"flat large"`, `"flat undercut"`, `"round"`, `"pan"`, `"pan flat"`,
|
||||
// `"pan round"`, `"socket"`, `"hex"`, `"button"`, `"cheese"`, `"fillister"`, or `"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"`.
|
||||
// .
|
||||
// Head | Drive
|
||||
// ------------- | ----------------------------
|
||||
// none | hex, torx
|
||||
// hex |
|
||||
// socket | hex, torx
|
||||
// button | hex, torx
|
||||
// round | slot, phillips
|
||||
// fillister | slot, phillips
|
||||
// flat | slot, phillips, hex, torx
|
||||
// flat small | phillips, slot
|
||||
// flat large | hex, torx
|
||||
// flat undercut | slot, phillips
|
||||
// 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"`
|
||||
// .
|
||||
// Supported metric head and drive combinations:
|
||||
// Only some combinations of head and drive type are supported:
|
||||
// .
|
||||
// Head | Drive
|
||||
// ------ | ----------------------------
|
||||
// none | hex, torx
|
||||
// hex |
|
||||
// socket | hex, torx
|
||||
// pan | slot, phillips
|
||||
// button | hex, torx
|
||||
// cheese | slot, phillips
|
||||
// flat | phillips, slot, hex, torx
|
||||
// Head | Drive
|
||||
// ----------------- | ----------------------------
|
||||
// `"none"` | hex, torx
|
||||
// `"hex"` | *none*
|
||||
// `"socket"` | hex, torx
|
||||
// `"button"` | hex, torx
|
||||
// `"flat"` | slot, phillips, hex, torx
|
||||
// `"round"` | slot, phillips (UTS/English only.)
|
||||
// `"fillister"` | slot, phillips (UTS/English only.)
|
||||
// `"flat small"` | phillips, slot (UTS/English only.)
|
||||
// `"flat large"` | hex, torx (UTS/English only.)
|
||||
// `"flat undercut"` | slot, phillips (UTS/English only.)
|
||||
// `"pan"` | slot, phillips (ISO/Metric only.)
|
||||
// `"cheese"` | slot, phillips (ISO/Metric only.)
|
||||
// .
|
||||
// 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` parameter
|
||||
// you can override the default, or in cases where no default exists you can specify it.
|
||||
// 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.
|
||||
// .
|
||||
// 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 inaccuracy. Does not affect length, thread pitch or head height.
|
||||
// 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
|
||||
// inaccuracy. Does not affect length, thread pitch or head height.
|
||||
// .
|
||||
// The output is a structure with the following fields:
|
||||
// - system: either "UTS" or "ISO" (used for correct tolerance computation)
|
||||
// - diameter: the nominal diameter of the screw shaft in mm
|
||||
// - pitch: the thread pitch in mm
|
||||
// - head: the type of head (a string from the list above)
|
||||
// - head_size: size of the head in mm
|
||||
// - head_angle: countersink angle for flat heads
|
||||
// - head_height: height of the head (when needed to specify the head)
|
||||
// - drive: the drive type ("phillips", "torx", "slot", "hex", "none")
|
||||
// - drive_size: the drive size, either a drive number (phillips or torx) or a dimension in mm (hex). Not defined for slot drive
|
||||
// - drive_diameter: diameter of a phillips drive
|
||||
// - drive_width: width of the arms of the cross in a phillips drive or the slot for a slot drive
|
||||
// - 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.
|
||||
// The output is a [[struct|structs.scad]] with the following fields:
|
||||
// .
|
||||
// Field | What it is
|
||||
// ------------------ | ---------------
|
||||
// `"system"` | Either `"UTS"` or `"ISO"` (used for correct tolerance computation).
|
||||
// `"diameter"` | The nominal diameter of the screw shaft in mm.
|
||||
// `"pitch"` | The thread pitch in mm.
|
||||
// `"head"` | The type of head (a string from the list above).
|
||||
// `"head_size"` | Size of the head in mm.
|
||||
// `"head_angle"` | Countersink angle for flat heads.
|
||||
// `"head_height"` | Height of the head (when needed to specify the head).
|
||||
// `"drive"` | The drive type (`"phillips"`, `"torx"`, `"slot"`, `"hex"`, `"none"`)
|
||||
// `"drive_size"` | The drive size, either a drive number (phillips or torx) or a dimension in mm (hex). Not defined for slot drive.
|
||||
// `"drive_diameter"` | Diameter of a phillips drive.
|
||||
// `"drive_width"` | Width of the arms of the cross in a phillips drive or the slot for a slot drive.
|
||||
// `"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:
|
||||
// name = screw specification, e.g. "M5x1" or "#8-32"
|
||||
// head = head type (see list above). Default: none
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
BOSL_VERSION = [2,0,326];
|
||||
BOSL_VERSION = [2,0,327];
|
||||
|
||||
|
||||
// Section: BOSL Library Version Functions
|
||||
|
|
Loading…
Reference in a new issue