tri2string

NAME

tri2string - format a triangle cloud using a given pattern

SYNOPSIS

tri2string [-H STRING|--header STRING] [-F STRING|--footer STRING] [-S INT|--shift INT] [-Sp INT|--shift-point INT] [-?|-h|--help] PATTERN

DESCRIPTION

tri2string converts a triangle cloud to a new format described by a given PATTERN. For each triangle of the cloud, a string derived from PATTERN is output, in which all occurrences of 'x1', 'x2', 'x3' are replaced by the coordinates of the first, second and third point, all occurrences of 'p1', 'p2' and 'p3' are replaced by the reference number of the point (possibly shifted by option --shift-point) and all occurrences of 'ref' are replaced by the triangle reference number (possibly shifted by option --shift). The triangle cloud is read from the standard input and the results are sent to the standard output. By default, the number of triangles is output to the first line. Options --header and --footer can be used to add headers and footers to the output. To have no header, the option should be 'tri2string -H '' PATTERN'. Example of patterns: '(x1+x2+x3)/3.' or '<triangle>p1,p2,p3</triangle>'. The program can be used in conjunction with octave to prepare scalar files which can be used for visualisation (view_tri(1)) or selection (select_tri(1)).

TRIANGLE CLOUD FORMAT

> number_of_points
> x1 y1 z1
> x2 y2 z2
> ...
> xn yn zn
> number_of_triangles
> r11 r12 r13
> r21 r22 r23
> ...
> rn1 rn2 rn3

OPTIONS

-h,--help,-?

Returns the manual page

-H STRING, --header STRING

header to output before the point processing. Example: '<table>'. By default, the header is the number of points in the cloud. If the string is empty '', no header is output. If the patterns contains 'ntris' or 'npts', their occurrences are replaced by the number of triangles and/ord the number of points.

-F STRING, --footer STRING

footer output after the point processing. Example: '</table>'. By default, not footer is output. If the patterns contains 'ntris' or 'npts', their occurrences are replaced by the number of triangles and/ord the number of points.

-S INT, --shift INT

if 'ref' is used, its value are shifted by a given integer using this option.

-Sp INT, --shift-point INT

if 'p1', 'p2' and/or 'p3' are used, their values are shifted by a given integer using this option.

AUTHORS

Written by Pierre Smars (first version: 2016)

BUGS

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

COPYRIGHT

Copyright (C) 2016-2021 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_tri(1), select_tri(1)

Pierre SMARS (tools, home page)