259 function _draft_get_config
298 [
"font-sheet-zone-reference",
"Liberation Sans"],
300 [
"font-title-block-heading",
"Liberation Sans"],
301 [
"font-title-block-entry",
"Liberation Sans"],
303 [
"font-table-title",
"Liberation Sans"],
304 [
"font-table-heading",
"Liberation Sans"],
305 [
"font-table-entry",
"Liberation Sans"],
311 [
"make-3d-height",
length(1,
"mm")],
317 [
"line-width-min",
length(0.2,
"mm")],
318 [
"line-segment-min",
length(1.25,
"mm")],
319 [
"line-use-hull",
true],
325 [
"arrow-line-length-min",
length(4.0,
"mm")],
326 [
"arrow-angle-min",
angle(15,
"d")],
332 [
"table-cmh",
length(1/4,
"in")],
333 [
"table-cmv",
length(1/4,
"in")],
336 [
"table-hlines",
consts(5,[0,0])],
337 [
"table-vlines",
consts(3,[0,0])],
338 [
"table-text-format", [
empty_str, [-1,-1],
339 [2/5,-9/10], [0,-1-1/5],
340 0, 1, [
"left",
"center"]]],
346 [
"note-cmh",
length(1/4,
"in")],
347 [
"note-cmv",
length(1/4,
"in")],
354 [
"dim-cmh",
length(1/8,
"in")],
355 [
"dim-cmv",
length(1/8,
"in")],
356 [
"dim-text-place", [0,1]],
357 [
"dim-text-size", undef],
358 [
"dim-round-mode", [1,2]],
359 [
"dim-offset",
length(1/32,
"in")],
362 [
"dim-leader-length",
length(1/2,
"in")],
363 [
"dim-leader-weight", 1],
364 [
"dim-leader-style", 1],
365 [
"dim-leader-arrow", [2,1]],
366 [
"dim-leader-box-weight", 1],
367 [
"dim-leader-box-style", 1],
370 [
"dim-line-weight", 1],
371 [
"dim-line-style", 1],
372 [
"dim-line-arrow", 2],
373 [
"dim-line-extension-style", 1],
374 [
"dim-line-extension-length",
length(2/8,
"in")],
375 [
"dim-line-distance",
length(3/8,
"in")],
378 [
"dim-radius-weight", 1],
379 [
"dim-radius-style", 1],
380 [
"dim-radius-arrow", 2],
383 [
"dim-angle-weight", 1],
384 [
"dim-angle-style", 1],
385 [
"dim-angle-arrow", 2],
386 [
"dim-angle-extension-style", 3],
387 [
"dim-angle-extension-ratio", 1],
390 [
"dim-center-length",
length(1/16,
"in")],
391 [
"dim-center-weight", 1/2],
392 [
"dim-center-style", 1],
393 [
"dim-center-extension-style", 3],
399 [
"layers-default", [
"all",
"default"]],
400 [
"layers-sheet", [
"all",
"sheet"]],
401 [
"layers-table", [
"all",
"table"]],
402 [
"layers-note", [
"all",
"note"]],
403 [
"layers-titleblock", [
"all",
"titleblock"]],
404 [
"layers-dim", [
"all",
"dim"]]
480 function _draft_get_sheet_size
485 r=draft_sheet_size_tr,
486 c=draft_sheet_size_tc,
496 draft_sheet_size_tc =
498 [
"id",
"sheet size"],
500 [
"sdx",
"sheet x-dimension"],
501 [
"sdy",
"sheet y-dimension"]
509 draft_sheet_size_tr =
519 [
"A5",
"ISO A",
length( 149,
"mm"),
length( 210,
"mm")],
520 [
"A4",
"ISO A",
length( 210,
"mm"),
length( 297,
"mm")],
521 [
"A3",
"ISO A",
length( 297,
"mm"),
length( 420,
"mm")],
522 [
"A2",
"ISO A",
length( 420,
"mm"),
length( 594,
"mm")],
523 [
"A1",
"ISO A",
length( 594,
"mm"),
length( 841,
"mm")],
524 [
"A0",
"ISO A",
length( 841,
"mm"),
length(1189,
"mm")],
527 [
"B5",
"ISO B",
length( 177,
"mm"),
length( 250,
"mm")],
528 [
"B4",
"ISO B",
length( 250,
"mm"),
length( 354,
"mm")],
529 [
"B3",
"ISO B",
length( 354,
"mm"),
length( 500,
"mm")],
530 [
"B2",
"ISO B",
length( 500,
"mm"),
length( 707,
"mm")],
531 [
"B1",
"ISO B",
length( 707,
"mm"),
length(1000,
"mm")],
532 [
"B0",
"ISO B",
length(1000,
"mm"),
length(1414,
"mm")],
535 [
"Letter",
"Other",
length( 215.9,
"mm"),
length( 279.4,
"mm")],
536 [
"Legal",
"Other",
length( 215.9,
"mm"),
length( 355.6,
"mm")],
537 [
"Executive",
"Other",
length( 190.5,
"mm"),
length( 254.0,
"mm")],
538 [
"C5E",
"Other",
length( 163.0,
"mm"),
length( 229.0,
"mm")],
539 [
"Comm10",
"Other",
length( 105.0,
"mm"),
length( 241.0,
"mm")],
540 [
"DLE",
"Other",
length( 110.0,
"mm"),
length( 220.0,
"mm")],
541 [
"Folio",
"Other",
length( 210.0,
"mm"),
length( 330.0,
"mm")],
542 [
"Ledger",
"Other",
length( 432.0,
"mm"),
length( 279.0,
"mm")],
543 [
"Tabloid",
"Other",
length( 279.0,
"mm"),
length( 432.0,
"mm")]
574 function _draft_get_sheet_config
579 r=draft_sheet_config_tr,
580 c=draft_sheet_config_tc,
590 draft_sheet_config_tc =
592 [
"id",
"configuration name"],
593 [
"info",
"configuration description"],
596 [
"sll",
"sheet landscape layout"],
597 [
"smx",
"sheet margin x"],
598 [
"smy",
"sheet margin y"],
599 [
"szm",
"zone margin xy"],
602 [
"zox",
"zone ordering x"],
603 [
"zoy",
"zone ordering y"],
604 [
"zlx",
"zone labels x"],
605 [
"zly",
"zone labels y"],
606 [
"zrf",
"zone reference font"],
607 [
"zfs",
"zone font scaling"],
610 [
"slc",
"sheet line config"],
611 [
"flc",
"frame line config"],
612 [
"zlc",
"zone line config"],
613 [
"glc",
"grid line config"],
614 [
"olc",
"origin line and arrow config"]
622 draft_sheet_config_tr =
626 "Small sheet landscape layout with 8x4 traditional zones",
635 [
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H"],
636 [
"1",
"2",
"3",
"4"],
637 _draft_get_config(
"font-sheet-zone-reference"),
644 [3,1,13/8, [1,1,0,1,3]]
649 "Small sheet Portrait layout with 4x8 traditional zones",
658 [
"A",
"B",
"C",
"D"],
659 [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8"],
660 _draft_get_config(
"font-sheet-zone-reference"),
667 [3,1,13/8, [1,1,0,1,3]]
697 [
"cmh",
length(3/8,
"in") ],
700 [
"cmv",
length(3/8,
"in") ],
713 [3/2, [0, 11], 3, 1],
716 [1/2, [1, 11], 1, 1],
760 empty_str, [ 0, +1], [ 0, -1], [0, -1-4/10], 0, 1,
761 [
"center",
"center"], _draft_get_config(
"font-title-block-heading")
768 empty_str, [ 0, +1], [ 0, -2-1/2], [0, -1-4/10], 0, 3/2,
769 [
"center",
"center"], _draft_get_config(
"font-title-block-entry")
783 [ [ 3, 10], [ 0, 1], 0, [
"TITLE1"] ],
784 [ [ 5, 7], [ 1, 2], 0, [
"DATE"] ],
785 [ [ 5, 7], [ 2, 4], 0, [
"DRAWN BY"] ],
786 [ [ 0, 2], [ 0, 1], 0, [
"DRAWING NUMBER"] ],
787 [ [ 0, 1], [ 1, 3], 0, [
"SHEET"] ],
788 [ [ 9, 11], [ 1, 4], 0, [
"PROJECTION"] ],
789 [ [ 0, 1], [ 5, 7], 0, [
"MATERIAL"] ],
790 [ [ 0, 1], [ 3, 5], 0, [
"TREATMENT"] ],
791 [ [ 4, 5], [ 2, 4], 0, [
"CHECKED BY"] ],
792 [ [ 1, 4], [ 2, 4], 0, [
"APPROVED BY"] ],
793 [ [ 1, 6], [ 6, 7], 0, [
"NOTE1"] ],
794 [ [ 1, 6], [ 4, 6], 0, [
"NOTE2"] ],
795 [ [ 6, 11], [ 4, 7], 0, [
"NOTE3"] ],
796 [ [ 8, 9], [ 1, 4], 0, [
"SCALE"], [str(
"1:",
draft_sheet_scale), [0,0], [0,0]] ],
799 [ [10, 11], [ 0, 1], 0, [
"LOGO"], [
"omdl"] ]
809 _draft_table_format_map_common =
811 [
"cmh",
length(1/4,
"in") ],
812 [
"cmv",
length(1/4,
"in") ],
835 empty_str, [ 0, -1], [ 0, -1/2-4/10], [0, -1-2/10], 0, 1,
836 [
"center",
"center"], _draft_get_config(
"font-table-title")
848 _draft_table_format_map_common,
852 empty_str, [ 0, -1], [ 0, -1/2-3/10], [0, -1-2/10], 0, 1,
853 [
"center",
"center"], _draft_get_config(
"font-table-heading")
858 empty_str, [ 0, -1], [ 0, -1/2-4/10], [0, -1-2/10], 0, 1,
859 [
"center",
"center"], _draft_get_config(
"font-table-entry")
872 _draft_table_format_map_common,
876 empty_str, [-1, -1], [2/5, -4/5], [0, -1-1/5], 0, 1,
877 [
"left",
"center"], _draft_get_config(
"font-table-heading")
882 empty_str, [-1, -1], [2/5, -9/10], [0, -1-1/5], 0, 1,
883 [
"left",
"center"], _draft_get_config(
"font-table-entry")
896 _draft_table_format_map_common,
900 empty_str, [+1, -1], [-2/5, -4/5], [0, -1-1/5], 0, 1,
901 [
"right",
"center"], _draft_get_config(
"font-table-heading")
906 empty_str, [+1, -1], [-2/5, -9/10], [0, -1-1/5], 0, 1,
907 [
"right",
"center"], _draft_get_config(
"font-table-entry")
empty_str
<string> A string with no characters (the empty string).
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.
function angle(a, from=angle_unit_default, to=angle_unit_base)
Convert an angle value from one unit to another.
function length(v, from=length_unit_default, to=length_unit_base, d=1)
Convert a length value from one unit to another, with optional dimensional scaling.