omdl  v0.9.5
OpenSCAD Mechanical Design Library
Config

Drafting defaults and configurations. More...

+ Collaboration diagram for Config:

Files

file  config.scad
 Drafting defaults and configurations.
 

Globals

 $draft_make_3d = false
 <boolean> Extrude 2D drafted constructions to 3D.
 
 $draft_line_fn = 4
 <integer> Arc fragment size for line construction.
 
 $draft_arrow_fn = 8
 <integer> Arc fragment size for arrowhead construction.
 
 $draft_scale = 1
 <integer> Line construction drafting scale multiplier.
 
 draft_sheet_scale = 1
 <integer> Sheet construction drafting scale multiplier.
 
 draft_sheet_size = "A"
 <string> Drafting sheet size identifier. More...
 
 draft_sheet_config = "L84TS"
 <string> Drafting sheet configuration identifier. More...
 
 draft_layers_show = ["all"]
 <string-list> List of active drafting layer names. More...
 
 draft_config_map = draft_config_map_style1
 <map> Drafting configuration defaults map. More...
 

Maps

 draft_config_map_style1
 <map> A drafting configuration map; style1. More...
 
 draft_title_block_map_style1
 <map> A title block map; style 1. More...
 
 draft_table_format_map_ccc
 <map> Table format map; centered, centered, centered –justified.
 
 draft_table_format_map_cll
 <map> Table format map; centered, left, left –justified.
 
 draft_table_format_map_crr
 <map> Table format map; centered, right, right –justified.
 

Getters

function draft_get_config (k)
 Get drafting configuration default helper function. More...
 
function draft_get_sheet_size (ci)
 Get sheet size value helper function. More...
 
function draft_get_sheet_config (ci)
 Get sheet configuration value helper function. More...
 

Detailed Description

Drafting defaults and configurations.

Function Documentation

◆ draft_get_config()

function draft_get_config ( )

Get drafting configuration default helper function.

Parameters
k<string> A map key.
Returns
<value> The value associated with key k in the configuration map assigned to draft_config_map.

Example:

    layers = draft_get_config("layers-dim");
    dimll1 = draft_get_config("dim-leader-length");
See also
draft_config_map.
+ Here is the caller graph for this function:

◆ draft_get_sheet_config()

function draft_get_sheet_config ( ci  )

Get sheet configuration value helper function.

Parameters
ci<string> The column identifier.
Returns
<value> The value of the identified column for the current sheet configured by draft_sheet_config.

Example:

    zoy = draft_get_sheet_config(ci="zoy")

    smx = draft_get_sheet_config(ci="smx") * draft_sheet_scale;
    smy = draft_get_sheet_config(ci="smy") * draft_sheet_scale;
See also
draft_sheet_config.
+ Here is the caller graph for this function:

◆ draft_get_sheet_size()

function draft_get_sheet_size ( ci  )

Get sheet size value helper function.

Parameters
ci<string> The column identifier.
Returns
<value> The value of the identified column for the configured sheet size set by draft_sheet_size.

Example:

    std = draft_get_sheet_size(ci="std");

    sdx = draft_get_sheet_size(ci="sdx") * draft_sheet_scale;
    sdy = draft_get_sheet_size(ci="sdy") * draft_sheet_scale;
See also
draft_sheet_size.
+ Here is the caller graph for this function:

Variable Documentation

◆ draft_config_map

draft_config_map = draft_config_map_style1

<map> Drafting configuration defaults map.

The following examples demonstrates how to override select values of an existing configuration map.

Example:

(
[ // define value overrides first
["line-use-hull", false],
["dim-offset", length(2/64)],
["dim-leader-length", length(3/8)],
["dim-line-distance", length(3/8)],
["dim-line-extension-length", length(2/8)]
],
// start with existing style map
);
function map_merge(m1, m2)
Merge the unique key-value pairs of a second map with those of a first.
draft_config_map
<map> Drafting configuration defaults map.
Definition: config.scad:860
draft_config_map_style1
<map> A drafting configuration map; style1.
Definition: config.scad:715
function length(v, from=length_unit_default, to=length_unit_base, d=1)
Convert a value from from one units to another with dimensions.

Definition at line 860 of file config.scad.

◆ draft_config_map_style1

draft_config_map_style1

<map> A drafting configuration map; style1.

Configuration values for drafting primitives and tools. Specific values can be overridden as shown in draft_config_map or completely new maps may assembled to implement new styles as desired.

style1 table

keyvalue
font-sheet-zone-referenceLiberation Sans
font-title-block-headingLiberation Sans
font-title-block-entryLiberation Sans
font-table-titleLiberation Sans
font-table-headingLiberation Sans
font-table-entryLiberation Sans
make-3d-height1
line-width-min0.2
line-segment-min1.25
line-use-hulltrue
arrow-line-length-min4
arrow-angle-min15
table-cmh6.35
table-cmv6.35
table-coh1
table-cov-1
table-hlines[[0, 0], [0, 0], [0, 0], [0, 0], [0, 0]]
table-vlines[[0, 0], [0, 0], [0, 0]]
table-text-format["", [-1, -1], [0.4, -0.9], [0, -1.2], 0, 1, ["left", "center"]]
note-cmh6.35
note-cmv6.35
dim-cmh3.175
dim-cmv3.175
dim-text-place[0, 1]
dim-text-sizeundef
dim-round-mode[1, 2]
dim-offset0.79375
dim-leader-length12.7
dim-leader-weight1
dim-leader-style1
dim-leader-arrow[2, 1]
dim-leader-box-weight1
dim-leader-box-style1
dim-line-weight1
dim-line-style1
dim-line-arrow2
dim-line-extension-style1
dim-line-extension-length6.35
dim-line-distance9.525
dim-radius-weight1
dim-radius-style1
dim-radius-arrow2
dim-angle-weight1
dim-angle-style1
dim-angle-arrow2
dim-angle-extension-style3
dim-angle-extension-ratio1
dim-center-length1.5875
dim-center-weight0.5
dim-center-style1
dim-center-extension-style3
layers-default["all", "default"]
layers-sheet["all", "sheet"]
layers-table["all", "table"]
layers-note["all", "note"]
layers-titleblock["all", "titleblock"]
layers-dim["all", "dim"]

All dimensions are in millimeters.

Definition at line 715 of file config.scad.

◆ draft_layers_show

draft_layers_show = ["all"]

<string-list> List of active drafting layer names.

Layer identifiers may be assigned arbitrary names. A set of default names are used when not explicitly assigned. Multiple layers can be set active as in the following example.

Example:

draft_layers_show = ["default", "sheet", "dim"];
draft_layers_show
<string-list> List of active drafting layer names.
Definition: config.scad:554

Definition at line 554 of file config.scad.

◆ draft_sheet_config

draft_sheet_config = "L84TS"

<string> Drafting sheet configuration identifier.

Available configurations:

Sheet configurations table

configuration name (id)configuration description (info)
L84TSSmall sheet landscape layout with 8x4 traditional zones
P48TSSmall sheet Portrait layout with 4x8 traditional zones

Configuration keys table

keyvalue
idconfiguration name
infoconfiguration description
sllsheet landscape layout
smxsheet margin x
smysheet margin y
szmzone margin xy
zoxzone ordering x
zoyzone ordering y
zlxzone labels x
zlyzone labels y
zrfzone reference font
zfszone font scaling
slcsheet line config
flcframe line config
zlczone line config
glcgrid line config
olcorigin line and arrow config

Definition at line 538 of file config.scad.

◆ draft_sheet_size

draft_sheet_size = "A"

<string> Drafting sheet size identifier.

Sheet sizes

Available sizes in inches table

sheet size (id)standard (std)sheet x-dimension (sdx)sheet y-dimension (sdy)
AANSI8.511
BANSI1117
CANSI1722
DANSI2234
EANSI3444
A5ISO A5.866148.26772
A4ISO A8.2677211.6929
A3ISO A11.692916.5354
A2ISO A16.535423.3858
A1ISO A23.385833.1102
A0ISO A33.110246.811
B5ISO B6.96859.84252
B4ISO B9.8425213.937
B3ISO B13.93719.685
B2ISO B19.68527.8346
B1ISO B27.834639.3701
B0ISO B39.370155.6693
LetterOther8.511
LegalOther8.514
ExecutiveOther7.510
C5EOther6.417329.01575
Comm10Other4.133869.48819
DLEOther4.330718.66142
FolioOther8.2677212.9921
LedgerOther17.007910.9843
TabloidOther10.984317.0079

Available sizes in mm table

sheet size (id)standard (std)sheet x-dimension (sdx)sheet y-dimension (sdy)
AANSI215.9279.4
BANSI279.4431.8
CANSI431.8558.8
DANSI558.8863.6
EANSI863.61117.6
A5ISO A149210
A4ISO A210297
A3ISO A297420
A2ISO A420594
A1ISO A594841
A0ISO A8411189
B5ISO B177250
B4ISO B250354
B3ISO B354500
B2ISO B500707
B1ISO B7071000
B0ISO B10001414
LetterOther215.9279.4
LegalOther215.9355.6
ExecutiveOther190.5254
C5EOther163229
Comm10Other105241
DLEOther110220
FolioOther210330
LedgerOther432279
TabloidOther279432

Definition at line 318 of file config.scad.

◆ draft_title_block_map_style1

draft_title_block_map_style1

<map> A title block map; style 1.

A title block is constructed using zoned tables. A new layout can be designed by defining a new map or by merging overrides to this style map. The map keys and structure depends on the implementation of the title block rendering operation.

See also
draft_title_block().
draft_ztable().

Definition at line 1107 of file config.scad.