view_tri

NAME

view_tri - triangle mesh visualisation

SYNOPSIS

view_tri [OPTIONS]

DESCRIPTION

view_tri visualises a triangle mesh in 3D. It takes its input from the standard input.

Various colouring options are available ( -0 , -x , -y , -z , -sf , -g , -zb , -b , -rgb ).

New data or files can be produced using keystrokes.

DATA 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
The rij make reference to the nodes defined in the first part of the file. The node references start from 0.

rgb file (values in range 0..255):

> number_of_points
> r1 g1 b1
> r2 g2 b2
> ...
> rn gn bn

OPTIONS

-b INTEGER, --bands INTEGER

INTEGER is the number of colours to use for visualisation (default:256).

-c FILE, --camera FILE

FILE contains the projection matrix (3x4) of the image [see p_compute(1)].

-g,--greyscale

use a greyscale scalar map (default is colour).

-zb,--zebra

use a zebra pattern to color scalars (default is colour). Use option -b to change the density of lines.

-h,--help,-?

Returns the manual page.

-i FILE, --image FILE

Option used together with -c to project an image on a triangle file. FILE is the image file.

-m INTEGER, --magnification INTEGER

the exported 'jpeg' and 'tiff' images are magnified INTEGER times (default: 1).

-p

line_size: thickness of the lines in pixel used to draw the triangles in wireframe mode (default: 3).

-s,--smooth

smooth output of triangle file.

-si,--scalar-invert

invert the direction used by the scalar map.

-st,--scalar-triangles

scalar values are associated with triangles and not with the nodes of the triangles (always together with option -sf).

-sf FILE, --scalar-file FILE

FILE contains scalar values. By default, scalar values are associated to the nodes of the triangles. But, if option -st is activated, scalar values are associated to triangles. Triangles are coloured according to the scalar values. By default colours are used. A greyscale output is possible using the -g option. Scalar values are automatically scaled to fit the full output range.

-rgb FILE, --rgb FILE

For each point, FILE contains three values specifying its color: R [0-255], G [0-255], B [0-255].

-tr

triangle mesh is semi-trasparent.

-a,--axes

Draw a set of axes at the origin. x is red, y is green and z is blue and the lines are 1 unit long.

INTERACTIONS

Mouse

left mouse button: rotate 3D.
shift + left button: translate.
middle-button: idem (translate).
control + left button: rotate around axis of vision.
control + shift + left button: measure distance between 2 points.
right button: zoom.

keyboard

w/s

toggle between wireframe and solid rendering.

p/c

toggle between parallel and central projection.

m/b

fix light position at camera position and toggle between moving and fixed light.

i

toggle between black and white background.

e

toggle between erase and normal mode. erase mode: select the unwanted triangles by picking (control + shift + left button), & at the session end (pressing 'q'), output the remaining triangles to the standard output.

f

return camera and focus positions to the standard output.

n

export a point (picking a point 2 times introduces a newline character).

t

produce a tiff file (view_tri.tif).

j

produce a jpeg file (view_tri.jpg).

v

produce a vrml file (view_tri.wrl).

x

set the viewing direction to ( 1, 0, 0).

X

set the viewing direction to (-1, 0, 0).

y

set the viewing direction to ( 0, 1, 0).

Y

set the viewing direction to ( 0,-1, 0).

z

set the viewing direction to ( 0, 0, 1).

Z

set the viewing direction to ( 0, 0,-1).

0

snap to major viewing direction.

3

toggle visualisation mode between Red/Cyan (3D) and normal (colour or B&W).

AUTHORS

Written by Pierre Smars (first version: 2001).

BUGS

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

COPYRIGHT

Copyright (C) 2023 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), view_li(1)

Pierre SMARS (tools, home page)