omdl  v0.9.5
OpenSCAD Mechanical Design Library
config.scad
Go to the documentation of this file.
1 //! Drafting defaults and configurations.
2 /***************************************************************************//**
3  \file
4  \author Roy Allen Sutton
5  \date 2019-2024
6 
7  \copyright
8 
9  This file is part of [omdl] (https://github.com/royasutton/omdl),
10  an OpenSCAD mechanical design library.
11 
12  The \em omdl is free software; you can redistribute it and/or modify
13  it under the terms of the [GNU Lesser General Public License]
14  (http://www.gnu.org/licenses/lgpl.html) as published by the Free
15  Software Foundation; either version 2.1 of the License, or (at
16  your option) any later version.
17 
18  The \em omdl is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  Lesser General Public License for more details.
22 
23  You should have received a copy of the GNU Lesser General Public
24  License along with the \em omdl; if not, write to the Free Software
25  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26  02110-1301, USA; or see <http://www.gnu.org/licenses/>.
27 
28  \details
29 
30  \amu_define group_name (Config)
31  \amu_define group_brief (Drafting defaults and configurations.)
32 
33  \amu_include (include/amu/pgid_path_pstem_g.amu)
34 *******************************************************************************/
35 
36 //----------------------------------------------------------------------------//
37 // group.
38 //----------------------------------------------------------------------------//
39 
40 /***************************************************************************//**
41  \amu_include (include/amu/group_in_parent_start.amu)
42 *******************************************************************************/
43 
44 //----------------------------------------------------------------------------//
45 // global configuration variables
46 //----------------------------------------------------------------------------//
47 
48 //! \name Globals
49 //! @{
50 
51 //! <boolean> Extrude 2D drafted constructions to 3D.
52 $draft_make_3d = false;
53 
54 //! <integer> Arc fragment size for line construction.
55 $draft_line_fn = 4;
56 
57 //! <integer> Arc fragment size for arrowhead construction.
58 $draft_arrow_fn = 8;
59 
60 //! <integer> Line construction drafting scale multiplier.
61 $draft_scale = 1;
62 
63 //! <integer> Sheet construction drafting scale multiplier.
65 
66 //! <string> Drafting sheet size identifier.
67 /***************************************************************************//**
68  \details
69 
70  <b>Sheet sizes</b>
71 
72  \amu_define output_scad (false)
73  \amu_define output_console (false)
74 
75  \amu_define title (Available sizes in inches)
76  \amu_define scope_id (sheet_sizes_in)
77  \amu_include (include/amu/scope_table.amu)
78 
79  \amu_define title (Available sizes in mm)
80  \amu_define scope_id (sheet_sizes_mm)
81  \amu_include (include/amu/scope_table.amu)
82 *******************************************************************************/
83 draft_sheet_size = "A";
84 
85 //! <string> Drafting sheet configuration identifier.
86 /***************************************************************************//**
87  \details
88 
89  Available configurations:
90 
91  \amu_define title (Sheet configurations)
92  \amu_define scope_id (sheet_config)
93  \amu_define output_scad (false)
94  \amu_define output_console (false)
95 
96  \amu_include (include/amu/scope_table.amu)
97 
98  \amu_define title (Configuration keys)
99  \amu_define scope_id (sheet_config_keys)
100  \amu_define output_scad (false)
101  \amu_define output_console (false)
102 
103  \amu_include (include/amu/scope_table.amu)
104 *******************************************************************************/
105 draft_sheet_config = "L84TS";
106 
107 //! <string-list> List of active drafting layer names.
108 /***************************************************************************//**
109  \details
110 
111  Layer identifiers may be assigned arbitrary names. A set of default
112  names are used when not explicitly assigned. Multiple layers can be
113  set active as in the following example.
114 
115  \b Example:
116 
117  \code{.C}
118  draft_layers_show = ["default", "sheet", "dim"];
119  \endcode
120 *******************************************************************************/
121 draft_layers_show = ["all"];
122 
123 //! @}
124 
125 //! \name Getters
126 //! @{
127 
128 //----------------------------------------------------------------------------//
129 // drafting style defaults:
130 //
131 // (1) configuration getter function
132 // (2) configuration map "style1"
133 // (3) user assignable style map variable
134 //----------------------------------------------------------------------------//
135 
136 //! Get drafting configuration default helper function.
137 /***************************************************************************//**
138  \param k <string> A map key.
139 
140  \returns <value> The value associated with key \p k in the
141  configuration map assigned to \ref draft_config_map.
142 
143  \details
144 
145  \b Example:
146 
147  \verbatim
148  layers = draft_get_config("layers-dim");
149  dimll1 = draft_get_config("dim-leader-length");
150  \endverbatim
151 
152  \sa draft_config_map.
153 *******************************************************************************/
154 function draft_get_config
155 (
156  k
158 
159 //! @}
160 
161 //! \name Maps
162 //! @{
163 
164 //! <map> A drafting configuration map; style1.
165 /***************************************************************************//**
166  \details
167 
168  Configuration values for drafting primitives and tools. Specific
169  values can be overridden as shown in \ref draft_config_map or
170  completely new maps may assembled to implement new styles as
171  desired.
172 
173  \amu_define title (style1)
174  \amu_define scope_id (dfraft_style1)
175  \amu_define output_scad (false)
176  \amu_define output_console (false)
177  \amu_define notes_table (All dimensions are in millimeters.)
178 
179  \amu_include (include/amu/scope_table.amu)
180 
181  \hideinitializer
182 *******************************************************************************/
184 [
185  //
186  // fonts
187  //
188 
189  ["font-sheet-zone-reference", "Liberation Sans"],
190 
191  ["font-title-block-heading", "Liberation Sans"],
192  ["font-title-block-entry", "Liberation Sans"],
193 
194  ["font-table-title", "Liberation Sans"],
195  ["font-table-heading", "Liberation Sans"],
196  ["font-table-entry", "Liberation Sans"],
197 
198  //
199  // make 3d
200  //
201 
202  ["make-3d-height", length(1, "mm")],
203 
204  //
205  // lines
206  //
207 
208  ["line-width-min", length(0.2, "mm")],
209  ["line-segment-min", length(1.25, "mm")],
210  ["line-use-hull", true],
211 
212  //
213  // arrows
214  //
215 
216  ["arrow-line-length-min", length(4.0, "mm")],
217  ["arrow-angle-min", angle(15, "d")],
218 
219  //
220  // table
221  //
222 
223  ["table-cmh", length(1/4,"in")], // horizontal width minimum
224  ["table-cmv", length(1/4,"in")], // vertical height minimum
225  ["table-coh", +1], // horizontal line ordering
226  ["table-cov", -1], // vertical line ordering
227  ["table-hlines", consts(5,[0,0])], // horizontal lines
228  ["table-vlines", consts(3,[0,0])], // vertical line
229  ["table-text-format", [empty_str, [-1,-1],
230  [2/5,-9/10], [0,-1-1/5],
231  0, 1, ["left", "center"]]],
232 
233  //
234  // note
235  //
236 
237  ["note-cmh", length(1/4,"in")],
238  ["note-cmv", length(1/4,"in")],
239 
240  //
241  // dim
242  //
243 
244  // common
245  ["dim-cmh", length(1/8,"in")],
246  ["dim-cmv", length(1/8,"in")],
247  ["dim-text-place", [0,1]],
248  ["dim-text-size", undef],
249  ["dim-round-mode", [1,2]], // [mode, digits]
250  ["dim-offset", length(1/32,"in")],
251 
252  // leader
253  ["dim-leader-length", length(1/2,"in")],
254  ["dim-leader-weight", 1],
255  ["dim-leader-style", 1],
256  ["dim-leader-arrow", [2,1]],
257  ["dim-leader-box-weight", 1],
258  ["dim-leader-box-style", 1],
259 
260  // line
261  ["dim-line-weight", 1],
262  ["dim-line-style", 1],
263  ["dim-line-arrow", 2],
264  ["dim-line-extension-style", 1],
265  ["dim-line-extension-length", length(2/8,"in")],
266  ["dim-line-distance", length(3/8,"in")],
267 
268  // radius
269  ["dim-radius-weight", 1],
270  ["dim-radius-style", 1],
271  ["dim-radius-arrow", 2],
272 
273  // angle
274  ["dim-angle-weight", 1],
275  ["dim-angle-style", 1],
276  ["dim-angle-arrow", 2],
277  ["dim-angle-extension-style", 3],
278  ["dim-angle-extension-ratio", 1],
279 
280  // center
281  ["dim-center-length", length(1/16,"in")],
282  ["dim-center-weight", 1/2],
283  ["dim-center-style", 1],
284  ["dim-center-extension-style", 3],
285 
286  //
287  // layers
288  //
289 
290  ["layers-default", ["all", "default"]],
291  ["layers-sheet", ["all", "sheet"]],
292  ["layers-table", ["all", "table"]],
293  ["layers-note", ["all", "note"]],
294  ["layers-titleblock", ["all", "titleblock"]],
295  ["layers-dim", ["all", "dim"]]
296 ];
297 
298 //! @}
299 
300 //! \name Globals
301 //! @{
302 
303 //! <map> Drafting configuration defaults map.
304 /***************************************************************************//**
305  \details
306 
307  The following examples demonstrates how to override select values
308  of an existing configuration map.
309 
310  \b Example:
311 
312  \code{.C}
313  draft_config_map =
314  map_merge
315  (
316  [ // define value overrides first
317  ["line-use-hull", false],
318  ["dim-offset", length(2/64)],
319  ["dim-leader-length", length(3/8)],
320  ["dim-line-distance", length(3/8)],
321  ["dim-line-extension-length", length(2/8)]
322  ],
323  // start with existing style map
324  draft_config_map_style1
325  );
326  \endcode
327 *******************************************************************************/
329 
330 //! @}
331 
332 //! \name Getters
333 //! @{
334 
335 //----------------------------------------------------------------------------//
336 // sheet size:
337 //
338 // (1) configuration getter function
339 // (2) internal table definitions
340 //----------------------------------------------------------------------------//
341 
342 //! Get sheet size value helper function.
343 /***************************************************************************//**
344  \param ci <string> The column identifier.
345 
346  \returns <value> The value of the identified column for the
347  configured sheet size set by \ref draft_sheet_size.
348 
349  \details
350 
351  \b Example:
352 
353  \verbatim
354  std = draft_get_sheet_size(ci="std");
355 
356  sdx = draft_get_sheet_size(ci="sdx") * draft_sheet_scale;
357  sdy = draft_get_sheet_size(ci="sdy") * draft_sheet_scale;
358  \endverbatim
359 
360  \sa draft_sheet_size.
361 *******************************************************************************/
362 function draft_get_sheet_size
363 (
364  ci
365 ) = table_get_value
366  (
367  r=draft_sheet_size_tr,
368  c=draft_sheet_size_tc,
369  ri=draft_sheet_size,
370  ci=ci
371  );
372 
373 //! <map> sheet sizes data table columns definition.
374 /***************************************************************************//**
375  \hideinitializer
376  \private
377 *******************************************************************************/
378 draft_sheet_size_tc =
379 [
380  ["id", "sheet size"],
381  ["std", "standard"],
382  ["sdx", "sheet x-dimension"],
383  ["sdy", "sheet y-dimension"]
384 ];
385 
386 //! <table> sheet sizes data table rows.
387 /***************************************************************************//**
388  \hideinitializer
389  \private
390 *******************************************************************************/
391 draft_sheet_size_tr =
392 [
393  // ANSI
394  [ "A", "ANSI", length( 8.5, "in"), length( 11, "in")],
395  [ "B", "ANSI", length( 11, "in"), length( 17, "in")],
396  [ "C", "ANSI", length( 17, "in"), length( 22, "in")],
397  [ "D", "ANSI", length( 22, "in"), length( 34, "in")],
398  [ "E", "ANSI", length( 34, "in"), length( 44, "in")],
399 
400  // ISO A
401  ["A5", "ISO A", length( 149, "mm"), length( 210, "mm")],
402  ["A4", "ISO A", length( 210, "mm"), length( 297, "mm")],
403  ["A3", "ISO A", length( 297, "mm"), length( 420, "mm")],
404  ["A2", "ISO A", length( 420, "mm"), length( 594, "mm")],
405  ["A1", "ISO A", length( 594, "mm"), length( 841, "mm")],
406  ["A0", "ISO A", length( 841, "mm"), length(1189, "mm")],
407 
408  // ISO B
409  ["B5", "ISO B", length( 177, "mm"), length( 250, "mm")],
410  ["B4", "ISO B", length( 250, "mm"), length( 354, "mm")],
411  ["B3", "ISO B", length( 354, "mm"), length( 500, "mm")],
412  ["B2", "ISO B", length( 500, "mm"), length( 707, "mm")],
413  ["B1", "ISO B", length( 707, "mm"), length(1000, "mm")],
414  ["B0", "ISO B", length(1000, "mm"), length(1414, "mm")],
415 
416  // Others
417  ["Letter", "Other", length( 215.9, "mm"), length( 279.4, "mm")],
418  ["Legal", "Other", length( 215.9, "mm"), length( 355.6, "mm")],
419  ["Executive", "Other", length( 190.5, "mm"), length( 254.0, "mm")],
420  ["C5E", "Other", length( 163.0, "mm"), length( 229.0, "mm")],
421  ["Comm10", "Other", length( 105.0, "mm"), length( 241.0, "mm")],
422  ["DLE", "Other", length( 110.0, "mm"), length( 220.0, "mm")],
423  ["Folio", "Other", length( 210.0, "mm"), length( 330.0, "mm")],
424  ["Ledger", "Other", length( 432.0, "mm"), length( 279.0, "mm")],
425  ["Tabloid", "Other", length( 279.0, "mm"), length( 432.0, "mm")]
426 ];
427 
428 //----------------------------------------------------------------------------//
429 // sheet layout configuration:
430 //
431 // (1) configuration getter function
432 // (2) internal table definitions
433 //----------------------------------------------------------------------------//
434 
435 //! Get sheet configuration value helper function.
436 /***************************************************************************//**
437  \param ci <string> The column identifier.
438 
439  \returns <value> The value of the identified column for the
440  current sheet configured by \ref draft_sheet_config.
441 
442  \details
443 
444  \b Example:
445 
446  \verbatim
447  zoy = draft_get_sheet_config(ci="zoy")
448 
449  smx = draft_get_sheet_config(ci="smx") * draft_sheet_scale;
450  smy = draft_get_sheet_config(ci="smy") * draft_sheet_scale;
451  \endverbatim
452 
453  \sa draft_sheet_config.
454 *******************************************************************************/
455 function draft_get_sheet_config
456 (
457  ci
458 ) = table_get_value
459  (
460  r=draft_sheet_config_tr,
461  c=draft_sheet_config_tc,
463  ci=ci
464  );
465 
466 //! <map> Sheet configuration data table columns definition.
467 /***************************************************************************//**
468  \hideinitializer
469  \private
470 *******************************************************************************/
471 draft_sheet_config_tc =
472 [
473  ["id", "configuration name"],
474  ["info", "configuration description"],
475 
476  // sheet layout
477  ["sll", "sheet landscape layout"],
478  ["smx", "sheet margin x"],
479  ["smy", "sheet margin y"],
480  ["szm", "zone margin xy"],
481 
482  // zone reference
483  ["zox", "zone ordering x"],
484  ["zoy", "zone ordering y"],
485  ["zlx", "zone labels x"],
486  ["zly", "zone labels y"],
487  ["zrf", "zone reference font"],
488  ["zfs", "zone font scaling"],
489 
490  // lines [ weight, {style | [style]} ]
491  ["slc", "sheet line config"],
492  ["flc", "frame line config"],
493  ["zlc", "zone line config"],
494  ["glc", "grid line config"],
495  ["olc", "origin line and arrow config"]
496 ];
497 
498 //! <table> Sheet configuration data table rows.
499 /***************************************************************************//**
500  \hideinitializer
501  \private
502 *******************************************************************************/
503 draft_sheet_config_tr =
504 [
505  [
506  "L84TS",
507  "Small sheet landscape layout with 8x4 traditional zones",
508 
509  true,
510  length(3/4, "in"),
511  length(1/2, "in"),
512  length(3/16, "in"),
513 
514  -1,
515  +1,
516  ["A", "B", "C", "D", "E", "F", "G", "H"],
517  ["1", "2", "3", "4"],
518  draft_get_config("font-sheet-zone-reference"),
519  5/8,
520 
521  [1,[4,3,2,5]],
522  8,
523  4,
524  [1/2,3],
525  [3,1,13/8, [1,1,0,1,3]]
526  ],
527 
528  [
529  "P48TS",
530  "Small sheet Portrait layout with 4x8 traditional zones",
531 
532  false,
533  length(1/2, "in"),
534  length(3/4, "in"),
535  length(3/16, "in"),
536 
537  -1,
538  +1,
539  ["A", "B", "C", "D"],
540  ["1", "2", "3", "4", "5", "6", "7", "8"],
541  draft_get_config("font-sheet-zone-reference"),
542  5/8,
543 
544  [1,[4,3,2,5]],
545  8,
546  4,
547  [1/2,3],
548  [3,1,13/8, [1,1,0,1,3]]
549  ]
550 ];
551 
552 //! @}
553 
554 //----------------------------------------------------------------------------//
555 // layout, style and formatting maps:
556 //----------------------------------------------------------------------------//
557 
558 //! \name Maps
559 //! @{
560 
561 //! <map> A title block map; style 1.
562 /***************************************************************************//**
563  \details
564 
565  A title block is constructed using \ref draft_ztable "zoned tables".
566  A new layout can be designed by defining a new map or by merging
567  overrides to this style map. The map keys and structure depends on
568  the implementation of the \ref draft_title_block "title block"
569  rendering operation.
570 
571  \sa draft_title_block().
572  \sa draft_ztable().
573  \hideinitializer
574 *******************************************************************************/
576 [
577  // table cell horizontal width minimum
578  [ "cmh", length(3/8, "in") ],
579 
580  // table cell vertical height minimum
581  [ "cmv", length(3/8, "in") ],
582 
583  // table cell horizontal line ordering
584  [ "coh", -1 ],
585 
586  // table cell vertical line ordering
587  [ "cov", +1 ],
588 
589  // table horizontal lines
590  // height-factor, [vl-start, vl-end], line-weight, line-style
591  [ "hlines",
592  [
593  [0, [0, 11], 3, 1],
594  [3/2, [0, 11], 3, 1],
595  [1, [1, 8], 1, 1],
596  [1/2, [0, 1], 1, 1],
597  [1/2, [1, 11], 1, 1],
598  [1/2, [0, 1], 1, 1],
599  [1/2, [1, 6], 1, 1],
600  [1, [0, 11], 3, 1]
601  ]
602  ],
603 
604  // table vertical lines
605  // width-factor, [hl-start, hl-end], line-weight, line-style
606  [ "vlines",
607  [
608  [0, [0, 7], 3, 1],
609  [4, [1, 7], 1, 1],
610  [1, [0, 1], 1, 1],
611  [1, [0, 1], 1, 1],
612  [1, [1, 4], 1, 1],
613  [3, [1, 4], 1, 1],
614  [3/4, [4, 7], 1, 1],
615  [2, [1, 4], 1, 1],
616  [1, [1, 4], 1, 1],
617  [1, [1, 4], 1, 1],
618  [1/2, [0, 1], 1, 1],
619  [2, [0, 7], 3, 1]
620  ]
621  ],
622 
623  /*
624  text configuration format:
625 
626  [
627  0:"text", 1:<align-point>, 2:<align-offset>, 3:<mline-offset>,
628  4:rotate, 5:text-scale, 6:<text-align>, 7:"font",
629  8:spacing, 9:direction, 10:language, 11:script
630  ]
631 
632  <align-point> = [hl-align, vl-align]
633  <align-offset> = [h-offset, v-offset]
634  <mline-offset> = [h-offset, v-offset] // multi-line
635  <text-align> = [halign, valign]
636  */
637 
638  // zone heading text configuration defaults
639  [ "hdefs",
640  [
641  empty_str, [ 0, +1], [ 0, -1], [0, -1-4/10], 0, 1,
642  ["center", "center"], draft_get_config("font-title-block-heading")
643  ]
644  ],
645 
646  // zone entry text configuration defaults
647  [ "edefs",
648  [
649  empty_str, [ 0, +1], [ 0, -2-1/2], [0, -1-4/10], 0, 3/2,
650  ["center", "center"], draft_get_config("font-title-block-entry")
651  ]
652  ],
653 
654  /*
655  title block configuration format:
656 
657  [ <vl-limits>, <hl-limits>, hidden, <heading-text>, <entry-text> ]
658 
659  <vl-limits> = [vl-start, vl-end]
660  <hl-limits> = [hl-start, hl-end]
661  */
662  [ "zones",
663  [
664  [ [ 3, 10], [ 0, 1], 0, ["TITLE1"] ],
665  [ [ 5, 7], [ 1, 2], 0, ["DATE"] ],
666  [ [ 5, 7], [ 2, 4], 0, ["DRAWN BY"] ],
667  [ [ 0, 2], [ 0, 1], 0, ["DRAWING NUMBER"] ],
668  [ [ 0, 1], [ 1, 3], 0, ["SHEET"] ],
669  [ [ 9, 11], [ 1, 4], 0, ["PROJECTION"] ],
670  [ [ 0, 1], [ 5, 7], 0, ["MATERIAL"] ],
671  [ [ 0, 1], [ 3, 5], 0, ["TREATMENT"] ],
672  [ [ 4, 5], [ 2, 4], 0, ["CHECKED BY"] ],
673  [ [ 1, 4], [ 2, 4], 0, ["APPROVED BY"] ],
674  [ [ 1, 6], [ 6, 7], 0, ["NOTE1"] ],
675  [ [ 1, 6], [ 4, 6], 0, ["NOTE2"] ],
676  [ [ 6, 11], [ 4, 7], 0, ["NOTE3"] ],
677  [ [ 8, 9], [ 1, 4], 0, ["SCALE"], [str("1:", draft_sheet_scale), [0,0], [0,0]] ],
678  [ [ 7, 8], [ 2, 4], 0, ["UNITS"], [length_unit_base] ],
679  [ [ 7, 8], [ 1, 2], 0, ["SIZE"], [draft_sheet_size] ],
680  [ [10, 11], [ 0, 1], 0, ["LOGO"], ["omdl"] ]
681  ]
682  ]
683 ];
684 
685 //! <map> Table format map; common.
686 /***************************************************************************//**
687  \hideinitializer
688  \private
689 *******************************************************************************/
690 draft_table_format_map_common =
691 [
692  [ "cmh", length(1/4, "in") ],
693  [ "cmv", length(1/4, "in") ],
694  [ "coh", +1 ],
695  [ "cov", -1 ],
696 
697  [ "hlines",
698  [
699  [2, 1], // top
700  [2, 1], // bottom
701  [2, 1], // title
702  [1, 1], // headings
703  [1/2, 1] // rows
704  ]
705  ],
706  [ "vlines",
707  [
708  [2, 1], // left
709  [2, 1], // right
710  [1/2, 1] // cols...
711  ]
712  ],
713 
714  [ "tdefs",
715  [
716  empty_str, [ 0, -1], [ 0, -1/2-4/10], [0, -1-2/10], 0, 1,
717  ["center", "center"], draft_get_config("font-table-title")
718  ]
719  ]
720 ];
721 
722 //! <map> Table format map; centered, centered, centered --justified.
723 /***************************************************************************//**
724  \hideinitializer
725 *******************************************************************************/
727 concat
728 (
729  draft_table_format_map_common,
730  [
731  [ "hdefs",
732  [
733  empty_str, [ 0, -1], [ 0, -1/2-3/10], [0, -1-2/10], 0, 1,
734  ["center", "center"], draft_get_config("font-table-heading")
735  ]
736  ],
737  [ "edefs",
738  [
739  empty_str, [ 0, -1], [ 0, -1/2-4/10], [0, -1-2/10], 0, 1,
740  ["center", "center"], draft_get_config("font-table-entry")
741  ]
742  ]
743  ]
744 );
745 
746 //! <map> Table format map; centered, left, left --justified.
747 /***************************************************************************//**
748  \hideinitializer
749 *******************************************************************************/
751 concat
752 (
753  draft_table_format_map_common,
754  [
755  [ "hdefs",
756  [
757  empty_str, [-1, -1], [2/5, -4/5], [0, -1-1/5], 0, 1,
758  ["left", "center"], draft_get_config("font-table-heading")
759  ]
760  ],
761  [ "edefs",
762  [
763  empty_str, [-1, -1], [2/5, -9/10], [0, -1-1/5], 0, 1,
764  ["left", "center"], draft_get_config("font-table-entry")
765  ]
766  ]
767  ]
768 );
769 
770 //! <map> Table format map; centered, right, right --justified.
771 /***************************************************************************//**
772  \hideinitializer
773 *******************************************************************************/
775 concat
776 (
777  draft_table_format_map_common,
778  [
779  [ "hdefs",
780  [
781  empty_str, [+1, -1], [-2/5, -4/5], [0, -1-1/5], 0, 1,
782  ["right", "center"], draft_get_config("font-table-heading")
783  ]
784  ],
785  [ "edefs",
786  [
787  empty_str, [+1, -1], [-2/5, -9/10], [0, -1-1/5], 0, 1,
788  ["right", "center"], draft_get_config("font-table-entry")
789  ]
790  ]
791  ]
792 );
793 
794 //! @}
795 
796 //! @}
797 //! @}
798 
799 //----------------------------------------------------------------------------//
800 // openscad-amu auxiliary scripts
801 //----------------------------------------------------------------------------//
802 
803 /*
804 BEGIN_SCOPE dfraft_style1;
805  BEGIN_OPENSCAD;
806  include <omdl-base.scad>;
807  include <tools/drafting/draft-base.scad>;
808  length_unit_base = "mm";
809 
810  map_write( draft_config_map_style1 );
811  END_OPENSCAD;
812 
813  BEGIN_MFSCRIPT;
814  include --path "${INCLUDE_PATH}" {var_init,var_gen_term}.mfs;
815  include --path "${INCLUDE_PATH}" scr_make_mf.mfs;
816  END_MFSCRIPT;
817 END_SCOPE;
818 
819 BEGIN_SCOPE sheet_sizes;
820  BEGIN_OPENSCAD;
821  include <omdl-base.scad>;
822  include <tools/drafting/draft-base.scad>;
823  length_unit_base = "in";
824 
825  table_write( draft_sheet_size_tr, draft_sheet_size_tc, heading_text=true );
826  END_OPENSCAD;
827 
828  BEGIN_MFSCRIPT;
829  include --path "${INCLUDE_PATH}" {var_init,var_gen_term}.mfs;
830 
831  defines name "units" define "length_unit_base" strings "in mm";
832  variables add_opts_combine "units";
833 
834  include --path "${INCLUDE_PATH}" scr_make_mf.mfs;
835  END_MFSCRIPT;
836 END_SCOPE;
837 
838 BEGIN_SCOPE sheet_config;
839  BEGIN_OPENSCAD;
840  include <omdl-base.scad>;
841  include <tools/drafting/draft-base.scad>;
842  length_unit_base = "mm";
843 
844  table_write ( r=draft_sheet_config_tr, c=draft_sheet_config_tc,
845  cs=["id", "info"], heading_text=true );
846  END_OPENSCAD;
847 
848  BEGIN_MFSCRIPT;
849  include --path "${INCLUDE_PATH}" {var_init,var_gen_term}.mfs;
850  include --path "${INCLUDE_PATH}" scr_make_mf.mfs;
851  END_MFSCRIPT;
852 END_SCOPE;
853 
854 BEGIN_SCOPE sheet_config_keys;
855  BEGIN_OPENSCAD;
856  include <omdl-base.scad>;
857  include <tools/drafting/draft-base.scad>;
858  length_unit_base = "mm";
859 
860  map_write( draft_sheet_config_tc );
861  END_OPENSCAD;
862 
863  BEGIN_MFSCRIPT;
864  include --path "${INCLUDE_PATH}" {var_init,var_gen_term}.mfs;
865  include --path "${INCLUDE_PATH}" scr_make_mf.mfs;
866  END_MFSCRIPT;
867 END_SCOPE;
868 */
869 
870 //----------------------------------------------------------------------------//
871 // end of file
872 //----------------------------------------------------------------------------//
empty_str
<string> A string with no characters (the empty string).
Definition: constants.scad:301
function consts(l, v, u=false)
Create a list of constant or incrementing elements.
function map_get_value(m, k)
Get the map value associated with a key.
function table_get_value(r, c, ri, ci)
Get the table cell value for a specified row and column identifier.
draft_table_format_map_cll
<map> Table format map; centered, left, left –justified.
Definition: config.scad:1282
draft_table_format_map_crr
<map> Table format map; centered, right, right –justified.
Definition: config.scad:1306
function draft_get_sheet_config(ci)
Get sheet configuration value helper function.
draft_layers_show
<string-list> List of active drafting layer names.
Definition: config.scad:554
$draft_make_3d
<boolean> Extrude 2D drafted constructions to 3D.
Definition: config.scad:89
$draft_scale
<integer> Line construction drafting scale multiplier.
Definition: config.scad:98
draft_table_format_map_ccc
<map> Table format map; centered, centered, centered –justified.
Definition: config.scad:1258
$draft_line_fn
<integer> Arc fragment size for line construction.
Definition: config.scad:92
draft_config_map
<map> Drafting configuration defaults map.
Definition: config.scad:860
draft_title_block_map_style1
<map> A title block map; style 1.
Definition: config.scad:1107
function draft_get_config(k)
Get drafting configuration default helper function.
$draft_arrow_fn
<integer> Arc fragment size for arrowhead construction.
Definition: config.scad:95
function draft_get_sheet_size(ci)
Get sheet size value helper function.
draft_sheet_config
<string> Drafting sheet configuration identifier.
Definition: config.scad:538
draft_sheet_size
<string> Drafting sheet size identifier.
Definition: config.scad:318
draft_sheet_scale
<integer> Sheet construction drafting scale multiplier.
Definition: config.scad:101
draft_config_map_style1
<map> A drafting configuration map; style1.
Definition: config.scad:715
function angle(a, from=angle_unit_default, to=angle_unit_base)
Convert an angle from some units to another.
function length(v, from=length_unit_default, to=length_unit_base, d=1)
Convert a value from from one units to another with dimensions.
length_unit_base
<string> The base units for value storage.
Definition: length.scad:736