quad2rect

NAME

quad2rect - transforms quadrangle(s) to rectangles, trying to fit it(/them) with a good approximation.

SYNOPSIS

quad2rect [-p INT|--precision INT] [-?|-h|--help]

DESCRIPTION

quad2rect transforms quadrangle(s) to rectangle(s). The input data consists in a point cloud (see VIEW_PT(1) for the format definition). Each quadrangle is defined by four points: its vertices. The number of points should therefore be a multiple of four. The resulting rectangles vertices are also returned as a point cloud, with the same number of points as the input point cloud. The centre of gravity C of the quadrangle is preserved. The side lengths of the rectangle (l, L) are taken as the averaged lengths of the opposite sides of the quadrangle. The direction of longest side of the rectangle is taken as the average of the directions of the longest opposite sides of the quadrangle. The normal of the rectangle is taken as the normalised cross product of the averaged opposite sides of the quadrangle. The program reads the cloud from the standard input and returns the result to the standard output.

OPTIONS

-p INTEGER, --precision INTEGER

number of decimals (default: 6)

-h,--help,-?

Returns the manual page

AUTHORS

Written by Pierre Smars (first version: 2019)

BUGS

Reports of bugs or problems should be submitted via electronic mail to <smars@yuntech.edu.tw>.

COPYRIGHT

Copyright (C) 2019 Pierre Smars. License GPLv2 <http://www.gnu.org/licenses/gpl-2.0.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

SEE ALSO

view_pt(1), extract(1)

Pierre SMARS (tools, home page)