90 layers = _draft_get_config(
"layers-default")
93 if (_draft_layers_any_active(layers))
164 let( imax = max($children-1, len(list)-1) )
181 _draft_sheet_get_zone
186 frame=
false, window=
false
254 layers = _draft_get_config("layers-sheet")
263 if (_draft_layers_any_active(layers))
264 _draft_make_3d_if_configured()
269 table_check( r=draft_sheet_config_tr, c=draft_sheet_config_tc );
270 table_check( r=draft_sheet_size_tr, c=draft_sheet_size_tc );
282 sll = _draft_get_sheet_config(ci=
"sll");
290 zox = _draft_get_sheet_config(ci=
"zox");
291 zoy = _draft_get_sheet_config(ci=
"zoy");
292 zlx = _draft_get_sheet_config(ci=
"zlx");
293 zly = _draft_get_sheet_config(ci=
"zly");
294 zrf = _draft_get_sheet_config(ci=
"zrf");
295 zfs = _draft_get_sheet_config(ci=
"zfs");
298 slc = _draft_get_sheet_config(ci=
"slc");
299 flc = _draft_get_sheet_config(ci=
"flc");
300 zlc = _draft_get_sheet_config(ci=
"zlc");
301 glc = _draft_get_sheet_config(ci=
"glc");
302 olc = _draft_get_sheet_config(ci=
"olc");
312 ldx = sll ? sdy : sdx;
313 ldy = sll ? sdx : sdy;
355 for ( ix = [0:len(zlx)-1], iyo = [1,-1] )
357 x = ix * fdx/len(zlx) - fdx/2;
358 yo = iyo * (fdy/2 - szm/2);
361 draft_line( l=[ [x, yo-szm/2], [x, yo+szm/2] ], w=zone_w, s=zone_s );
363 zlt = (zox > 0) ? zlx[ix] : zlx[len(zlx)-1-ix];
364 translate( [x + fdx/len(zlx)/2, yo] )
365 text(zlt, font=zrf, size=szm*zfs, halign=
"center", valign=
"center");
369 for ( iy = [0:len(zly)-1], ixo = [1,-1] )
371 y = iy * fdy/len(zly) - fdy/2;
372 xo = ixo * (fdx/2 - szm/2);
375 draft_line( l=[ [xo-szm/2, y], [xo+szm/2, y] ], w=zone_w, s=zone_s );
377 zlt = (zoy > 0) ? zly[iy] : zly[len(zly)-1-iy];
378 translate( [xo, y + fdy/len(zly)/2] )
379 text(zlt, font=zrf, size=szm*zfs, halign="center", valign="center");
392 for ( ix = [1:len(zlx)-1], iyo = [1,-1] )
394 x = ix * fdx/len(zlx) - fdx/2;
395 draft_line( l=[ [x, -fdy/2], [x, fdy/2] ], w=grid_w, s=grid_s );
398 for ( iy = [1:len(zly)-1], ixo = [1,-1] )
400 y = iy * fdy/len(zly) - fdy/2;
401 draft_line( l=[ [-fdx/2, y], [fdx/2, y] ], w=grid_w, s=grid_s );
419 l=ix*[[fdx/2-szm, 0], [fdx/2-szm*origin_l, 0]],
420 w=origin_w, s=origin_s, a2=origin_a
427 l=iy*[[0, fdy/2-szm], [0, fdy/2-szm*origin_l]],
428 w=origin_w, s=origin_s, a2=origin_a
477 layers = _draft_get_config(
"layers-sheet")
480 if (_draft_layers_any_active(layers))
481 _draft_make_3d_if_configured()
495 sll = _draft_get_sheet_config(ci=
"sll"),
507 ldx = sll ? sdy : sdx,
508 ldy = sll ? sdx : sdy,
515 [fdx/2-szm, fdy/2-szm];
548 text(
third(i), valign=
"center", halign=
"center", size=ts);
596 layers = _draft_get_config(
"layers-sheet")
600 if (_draft_layers_any_active(layers))
601 _draft_make_3d_if_configured()
604 ul =
length(mark_size, units);
616 for ( i=[marks/2:groups*marks], j=[0, 1] )
622 (i%marks == marks/2) ? s*2/3
626 p1 = (j == 0) ? [p, 0] : [0, p],
631 draft_line (l=l, w=(i%marks) ? w/2 : w, s=1 );
634 if ((i == groups*marks) && !label_hide)
642 (j == 0 ? [offset, 0] : [0, offset])
644 rotate( (j == 0) ? 0 : 90 )
652 valign=
"center", size=s*label_scale
699 layers = _draft_get_config(
"layers-table")
702 if (_draft_layers_any_active(layers))
703 _draft_make_3d_if_configured()
705 translate( -_draft_table_get_cell(zp=zp, map=map, fmap=fmap) )
708 polygon(_draft_table_get_cell(window=
true, map=map, fmap=fmap));
751 xs = [
for( i=[0:nc] ) _draft_table_get_point( ix=i, map=map, fmap=fmap )[0] ];
752 ys = [
for( i=[0:nr+2] ) _draft_table_get_point( iy=i, map=map, fmap=fmap )[1] ];
761 lc = (i == 0) ? hlines[0]
762 : (i == nr+2) ? hlines[1]
763 : (i == 1) ? hlines[2]
764 : (i == 2) ? hlines[3]
772 ls = (is_undef(title) && (i==1)) ? 0
773 : (is_undef(heads) && (i==2)) ? 0
776 ip = [ xs[ic], ys[i] ];
777 tp = [ xs[tc], ys[i] ];
785 ic = (i==0||i==nc) ? 0 : 1;
789 lc = (i == 0) ? vlines[0]
790 : (i == nc) ? vlines[1]
796 ip = [ xs[i], ys[ic] ];
797 tp = [ xs[i], ys[tc] ];
803 _draft_table_text( 0, 0, title[0], cmh, tdefs, map, fmap );
807 _draft_table_text( c, 1, heads[0][c], cmh/2, hdefs, map, fmap );
810 for ( r = [2:nr+1], c = [0:nc-1] )
811 _draft_table_text( c, r, rows[r-2][0][c], cmh/2, edefs, map, fmap );
849 layers = _draft_get_config(
"layers-table")
852 if (_draft_layers_any_active(layers))
853 _draft_make_3d_if_configured()
855 translate( -_draft_ztable_get_zone(zp=zp, map=map) )
858 polygon(_draft_ztable_get_zone(window=
true, map=map));
885 for( i=[0:len(hldata)-1] )
887 ic = hldata[i][1][0];
888 tc = hldata[i][1][1];
892 ip = _draft_ztable_get_point( ix=ic, iy=i, map=map );
893 tp = _draft_ztable_get_point( ix=tc, iy=i, map=map );
900 translate(tp + [lts, lts/2, 0])
901 text(str("H", i), size=lts);
906 for( i=[0:len(vldata)-1] )
908 ic = vldata[i][1][0];
909 tc = vldata[i][1][1];
913 ip = _draft_ztable_get_point( ix=i, iy=ic, map=map );
914 tp = _draft_ztable_get_point( ix=i, iy=tc, map=map );
921 translate(ip - [lts/2, -lts, 0]) rotate(90)
922 text(str("V", i), size=lts);
927 for( i=[0:len(zddata)-1] )
929 hidden = zddata[i][2];
938 _draft_ztable_get_zone( i=i, zp=[1,1], map=map ) - [1/2, 1] * lts
940 text ( str(
"Z", i ), valign=
"center", halign=
"right", size=lts );
944 _draft_ztable_text( i, zddata[i][3][0], tts, htdefs, zddata[i][3], map );
947 et = (
is_empty(text[i]) || is_undef(text[i])) ?
951 _draft_ztable_text( i, et, tts, etdefs, zddata[i][4], map );
1002 cmh = _draft_get_config(
"note-cmh"),
1003 cmv = _draft_get_config(
"note-cmv"),
1006 layers = _draft_get_config(
"layers-note")
1009 if (_draft_layers_any_active(layers))
1014 lnc = is_list(lnd[0]) ? [lnd[0], lnd[1]] : [lnd, lnd];
1031 [
"hlines", concat(
consts(3,lnc[0]),
consts(2,lnc[1]))],
1032 [
"vlines",
consts(3,lnc[0])]
1043 map=map, fmap=fmap, zp=zp, window=window, layers=layers
1066 layers = _draft_get_config(
"layers-titleblock")
1071 text=text, map=map, zp=zp, number=number, window=window, layers=layers
x_axis_ci
<integer> The coordinate axis index for the Euclidean space x-axis.
y_axis_ci
<integer> The coordinate axis index for the Euclidean space y-axis.
x_axis2d_uv
<vector-2d> The unit vector of the positive x-axis in 2d Euclidean space.
y_axis2d_uv
<vector-2d> The unit vector of the positive y-axis in 2d Euclidean space.
pi
<decimal> The ratio of a circle's circumference to its diameter.
empty_str
<string> A string with no characters (the empty string).
empty_lst
<list> A list with no values (the empty list).
function line_tp(l)
Return the terminal point of a line or vector.
function line_ip(l)
Return the initial point of a line or vector.
function line2d_new(m=1, a=0, p1=origin2d, p2, v)
Construct a 2 dimensional directed line.
function defined_e_or(v, i, d)
Returns an element from an iterable if it exists, or a default value if not.
function third(v)
Return the third element of an iterable value.
function second(v)
Return the second element of an iterable value.
function first(v)
Return the first element of an iterable value.
function is_empty(v)
Test if an iterable value is empty.
function all_strings(v)
Test if all elements of an iterable value are strings.
function all_numbers(v)
Test if all elements of an iterable value are numbers.
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 map_get_firstof2_or(m1, m2, k, d)
Get the the first value associated with an existing key in one of two maps.
function defined_or(v, d)
Return given value, if defined, or a secondary value, if primary is not defined.
function is_defined(v)
Test if a value is defined.
function table_exists(r, c, ri, ci)
Test the existence of a table row identifier, table column identifier, or both.
module table_check(r, c, verbose=false)
Perform basic format checks on a table and output errors to console.
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.