![]() |
omdl
v0.9.7
OpenSCAD Mechanical Design Library
|
Drafting tools and general operations. More...
Collaboration diagram for Operations:Files | |
| file | operation.scad |
| Drafting tools and general operations. | |
Layers | |
| module | draft_in_layers (layers=draft_get_config("layers-default")) |
| Assign one or more layers to child objects. More... | |
Placement | |
| module | draft_move (list) |
| Move one or more child objects to sheet a reference zone. More... | |
Sheet | |
| module | draft_sheet (sheet, frame, zone, grid, origin, check=false, layers=draft_get_config("layers-sheet")) |
| Construct a drafting sheet with frame, zone, grid, and origin. More... | |
| module | draft_axes (size, w=1, s=2, a=0, ts=0, layers=draft_get_config("layers-sheet")) |
| Construct drafting sheet axes. More... | |
| module | draft_ruler (units="mm", marks=10, groups=5, mark_size=1, group_height=5, label_scale=2/3, label_hide=false, order=1, w=1, layers=draft_get_config("layers-sheet")) |
| Construct a drafting sheet ruler. More... | |
Tables | |
| module | draft_table (map, fmap, zp=0, window=false, layers=draft_get_config("layers-table")) |
| Construct a text table that is populated by rows and columns. More... | |
| module | draft_ztable (text, map, zp=0, number=false, window=false, layers=draft_get_config("layers-table")) |
| Construct a text table that is populated by predefined zones. More... | |
| module | draft_note (head, note, size, line, halign="left", cmh=draft_get_config("note-cmh"), cmv=draft_get_config("note-cmv"), zp=0, window=false, layers=draft_get_config("layers-note")) |
| Construct a text note with optional heading and boarder. More... | |
| module | draft_title_block (text, map=draft_title_block_map_style1, zp=0, number=false, window=false, layers=draft_get_config("layers-titleblock")) |
| Construct a sheet title block. More... | |
Drafting tools and general operations.
| module draft_axes | ( | size | , |
| w | = 1, |
||
| s | = 2, |
||
| a | = 0, |
||
| ts | = 0, |
||
| layers | = draft_get_config("layers-sheet") |
||
| ) |
Construct drafting sheet axes.
| size | <decimal-list-2-list-2|decimal-list-2|decimal> An optional list [[-x, +x], [-y, +y]] or [-x/y, +x/y] of decimals or a single decimal for (-+x=-+y). The x and y negative and positive axes lengths. |
| w | <decimal-list-2 | decimal> A list [-w, +w] or a single decimal for (-w=+w). The negative and positive axes segment weights. |
| s | <integer-list-2-list|integer-list-2|integer> A list [-[s], +[s]] or [-s, +s] of integers or a single integer for (-s=+s). The negative and positive axes styles. |
| a | <integer-list-2-list|integer-list-2|integer> A list [-[a], +[a]] or [-a, +a] of integers or a single integer for (-a=+a). The negative and positive axes arrows. |
| ts | <decimal> The axes label text size. |
| layers | <string-list> The List of drafting layer names. |
Object example
When size is not specified, the axes will span the entire sheet frame.
Definition at line 530 of file operation.scad.
Here is the call graph for this function:| module draft_in_layers | ( | layers | = draft_get_config("layers-default") | ) |
Assign one or more layers to child objects.
| layers | <string-list> The List of drafting layer names. |
All children will be assigned the specified layer or layers and will be subsequently shown only when one of these layers are active as indicated by draft_layers_show.
Definition at line 180 of file operation.scad.
Here is the call graph for this function:| module draft_move | ( | list | ) |
Move one or more child objects to sheet a reference zone.
| list | <datastruct-list> A List alignment references, zones, and child object indexes. |
Each list element specified the placement of a child object and has the form:
<datastruct> = [ 0:<alignment-point>, 1:<zone-reference>, 2:<child-index> ]
| field | description | data type |
|---|---|---|
| 0 | [px, py] | <decimal-list-2> |
| 1 | [rx, ry] or [ix, iy] | <string-list-2 | decimal-list-2> |
| 2 | index | <integer> |
Object example
Definition at line 224 of file operation.scad.
Here is the call graph for this function:| module draft_note | ( | head | , |
| note | , | ||
| size | , | ||
| line | , | ||
| halign | = "left", |
||
| cmh | = draft_get_config("note-cmh"), |
||
| cmv | = draft_get_config("note-cmv"), |
||
| zp | = 0, |
||
| window | = false, |
||
| layers | = draft_get_config("layers-note") |
||
| ) |
Construct a text note with optional heading and boarder.
| head | <string> The optional note heading. |
| note | <string | string-list> A single or multi-line note text string. |
| size | <decimal-list-3> A list of decimals that define the <width, line-height, heading-height> of the note. |
| line | <value-list-2> The boarder line configuration override that sets the line construction width and style; <width, style>. |
| halign | <string> The text horizontal alignment. One of the predefined strings: < "left" | "center" | "right" >. |
| cmh | <decimal> The horizontal width minimum unit cell size. |
| cmv | <decimal> The vertical height minimum unit cell size. |
| zp | <integer-list-2 | integer> The center coordinate scaler. A list [zpx, zpy] of decimals or a single decimal for (zpx=zpy). |
| window | <boolean> Return table window rectangle. |
| layers | <string-list> The List of drafting layer names. |
The boarder line style value may be configure as as documented in draft_line().
Object example
Definition at line 1043 of file operation.scad.
Here is the call graph for this function:
Here is the caller graph for this function:| module draft_ruler | ( | units | = "mm", |
| marks | = 10, |
||
| groups | = 5, |
||
| mark_size | = 1, |
||
| group_height | = 5, |
||
| label_scale | = 2/3, |
||
| label_hide | = false, |
||
| order | = 1, |
||
| w | = 1, |
||
| layers | = draft_get_config("layers-sheet") |
||
| ) |
Construct a drafting sheet ruler.
| units | <string> The ruler units. |
| marks | <integer> The number of unit marks per group. |
| groups | <integer> The number of groups. |
| mark_size | <decimal> The distance between unit marks (in units). |
| group_height | <decimal> The group-line mark height. |
| label_scale | <decimal> The text label size scaler. |
| label_hide | <boolean> Hide ruler text label. |
| order | <integer-list-2 | integer> The ruler marks horizontal and vertical direction. A list [x, y] of decimals or a single decimal for (x=y). |
| w | <decimal> The line segment weight. |
| layers | <string-list> The List of drafting layer names. |
Object example
Definition at line 647 of file operation.scad.
Here is the call graph for this function:| module draft_sheet | ( | sheet | , |
| frame | , | ||
| zone | , | ||
| grid | , | ||
| origin | , | ||
| check | = false, |
||
| layers | = draft_get_config("layers-sheet") |
||
| ) |
Construct a drafting sheet with frame, zone, grid, and origin.
| sheet | <value-list-2> A sheet line configuration that overrides sheet line <width, style>. |
| frame | <value-list-2> A frame line configuration that overrides frame line <width, style>. |
| zone | <value-list-2> A zone line configuration that overrides zone line <width, style>. |
| grid | <value-list-2> A grid line configuration that overrides grid line <width, style>. |
| origin | <value-list-4> An origin line configuration that overrides origin line <width, style, length, arrow>. |
| check | <boolean> Check current sheet configuration. |
| layers | <string-list> The List of drafting layer names. |
When a parameter is not specified, the default value is use for the current sheet configuration. The sheet configuration defaults are set by draft_sheet_config.
The parameters sheet, frame, zone, and grid accepts a list of two values. The first value sets the construction line width and the second sets the construction line style; <width, style>. The style value may also be a list to configure the details of the style as documented in draft_line(). The parameter origin accepts a list of four values: <width, style, length, arrow>. The style may be any of those available in draft_line() and the arrow may be any available in draft_arrow().
Object example
Definition at line 307 of file operation.scad.
Here is the call graph for this function:| module draft_table | ( | map | , |
| fmap | , | ||
| zp | = 0, |
||
| window | = false, |
||
| layers | = draft_get_config("layers-table") |
||
| ) |
Construct a text table that is populated by rows and columns.
| map | <map> A table definition map. |
| fmap | <map> A table format map. |
| zp | <integer-list-2 | integer> The center coordinate scaler. A list [zpx, zpy] of decimals or a single decimal for (zpx=zpy). |
| window | <boolean> Return table window rectangle. |
| layers | <string-list> The List of drafting layer names. |
Object example
| see: draft_config_map |
|---|
| table-text-format |
Definition at line 752 of file operation.scad.
Here is the call graph for this function:
Here is the caller graph for this function:| module draft_title_block | ( | text | , |
| map | = draft_title_block_map_style1, |
||
| zp | = 0, |
||
| number | = false, |
||
| window | = false, |
||
| layers | = draft_get_config("layers-titleblock") |
||
| ) |
Construct a sheet title block.
| text | <value-list> The list of zone values, where each value is <string | string-list>, a single or multi-line string for the corresponding zone. |
| map | <map> A zone table definition map. |
| zp | <integer-list-2 | integer> The center coordinate scaler. A list [zpx, zpy] of decimals or a single decimal for (zpx=zpy). |
| number | <boolean> Number the defined table zones. |
| window | <boolean> Return table window rectangle. |
| layers | <string-list> The List of drafting layer names. |
Object example
A title block is a ztable with a predetermined layout specified by a style map. See the configuration section for the available title block style maps.
Definition at line 1108 of file operation.scad.
Here is the call graph for this function:| module draft_ztable | ( | text | , |
| map | , | ||
| zp | = 0, |
||
| number | = false, |
||
| window | = false, |
||
| layers | = draft_get_config("layers-table") |
||
| ) |
Construct a text table that is populated by predefined zones.
| text | <value-list> The list of zone values, where each value is <string | string-list>, a single or multi-line string for the corresponding zone. |
| map | <map> A zone table definition map. |
| zp | <integer-list-2 | integer> The center coordinate scaler. A list [zpx, zpy] of decimals or a single decimal for (zpx=zpy). |
| number | <boolean> Number the defined table zones. |
| window | <boolean> Return table window rectangle. |
| layers | <string-list> The List of drafting layer names. |
Object example
Definition at line 889 of file operation.scad.
Here is the call graph for this function:
Here is the caller graph for this function: