expand_tri

NAME

expand_tri - express a triangle cloud (nodes+topology) as a list of triangles defined by the coordinates of their apices.

SYNOPSIS

expand_tri [-n STRING|--name STRING] [-?|-h|--help]

DESCRIPTION

expand_tri read a triangle cloud in the format A specified below and convert it to a triangle cloud in the format B (non-standard). This program can for instance be used to produce scalar files to be used with view_tri(1). awk is particularly effective for that purpose. It takes its input from the standard input and returns the result to the standard output. Example computing the centre of gravity of the triangles:

expand_tri < test.tri | awk 'NR==1 {print} NR != 1 {print ($1+$4+$7)/3 " " ($2+$5+$8)/3 " " ($3+$6+$9)/3}'

DATA FORMAT A

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

DATA FORMAT B

> number_of_triangles
> x11 y11 z11 x12 y12 z12 x13 y13 z13
> x21 y21 z21 x22 y22 z22 x23 y23 z23
> ...
> xn1 yn1 zn1 xn2 yn2 zn2 xn3 yn3 zn3

OPTIONS

-h,--help,-?

Returns the manual page

AUTHORS

Written by Pierre Smars (first version: 2015)

BUGS

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

COPYRIGHT

Copyright (C) 2015 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), trisize(1)

Pierre SMARS (tools, home page)