big function re-org to eliminate debug.scad and hide affine.scad from docs

This commit is contained in:
Adrian Mariano
2021-10-01 00:30:28 -04:00
parent 261099e102
commit 6e3efd68a4
14 changed files with 707 additions and 881 deletions

View File

@@ -1985,4 +1985,29 @@ function is_matrix_symmetric(A,eps=1e-12) =
approx(A,transpose(A), eps);
// Function&Module: echo_matrix()
// Usage:
// echo_matrix(M, [description=], [sig=], [eps=]);
// dummy = echo_matrix(M, [description=], [sig=], [eps=]),
// Description:
// Display a numerical matrix in a readable columnar format with `sig` significant
// digits. Values smaller than eps display as zero. If you give a description
// it is displayed at the top.
function echo_matrix(M,description,sig=4,eps=1e-9) =
let(
horiz_line = chr(8213),
matstr = matrix_strings(M,sig=sig,eps=eps),
separator = str_join(repeat(horiz_line,10)),
dummy=echo(str(separator," ",is_def(description) ? description : ""))
[for(row=matstr) echo(row)]
)
echo(separator);
module echo_matrix(M,description,sig=4,eps=1e-9)
{
dummy = echo_matrix(M,description,sig,eps);
}
// vim: expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap