[vtkusers] matrix output VERY hard to read

David Doria daviddoria+vtk at gmail.com
Thu Oct 15 07:54:40 EDT 2009


On Tue, Oct 13, 2009 at 9:34 AM, Jeff Baumes <jeff.baumes at kitware.com>wrote:

> I agree that this would likely be a good change. Could you add a
> little more clarity to this? What class(es)/method(s) are you
> proposing to change?
>
> Jeff
>

Jeff,

I think just vtkMatrix4x4::PrintSelf would need to be changed? Maybe
something more like this:
http://www.rpi.edu/~doriad/VTK_List/MatrixOutput/

It's tough to get the formatting VERY nice because of variable width
character fonts, but there is still quite an improvement (in my opinion).
Here are two examples:

Existing method, hard matrix:
    1 -4.12726e-10 3.91703e-10 5.2556e-12
    4.12726e-10 1 7.75407e-10 -7.62694e-10
    -3.91703e-10 -7.75407e-10 1 7.57439e-10
    0 0 0 1

Proposed method, hard matrix:
   1.000  -0.000   0.000   0.000
   0.000   1.000   0.000  -0.000
  -0.000  -0.000   1.000   0.000
   0.000   0.000   0.000   1.000


Existing method, easy matrix:
    1 2 3 4
    5 6 7 8
    9 10 11 12
    13 14 15 16

Proposed method, easy matrix:
   1.000   2.000   3.000   4.000
   5.000   6.000   7.000   8.000
   9.000  10.000  11.000  12.000
  13.000  14.000  15.000  16.000

As you can see there is a HUGE difference in the hard case, while the easy
case remains ok. The precision of the decimal outputs is clearly a user
preference sort of thing - maybe we could even make some options for the
formatting? That may be hard to do in the PrintSelf sort of framework
though..

Thoughts?

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091015/109e1ed9/attachment.htm>


More information about the vtkusers mailing list