DGtalTools  1.3.beta
mesh2heightfield

Converts a mesh file into a projected 2D image given from a normal direction N and from a starting point P.

The 3D mesh is discretized and scanned in the normal direction N, starting from P with a step 1.

Usage: mesh2heightfield [input] [output]

Allowed options are:

ositionals:
1 TEXT:FILE REQUIRED mesh file (.off)
2 TEXT=result.pgm sequence of discrete point file (.sdp)
Options:
-h,--help Print this help message and exit
-i,--input TEXT:FILE REQUIRED mesh file (.off)
-o,--output TEXT=result.pgm sequence of discrete point file (.sdp)
-s,--meshScale FLOAT change the default mesh scale (each vertex multiplied by the scale)
--heightFieldMaxScan INT=255 set the maximal scan deep.
-x,--centerX INT=0 choose x center of the projected image.
-y,--centerY INT=0 choose y center of the projected image.
-z,--centerZ INT=1 choose z center of the projected image.
--nx FLOAT=0 set the x component of the projection direction.
--ny FLOAT=0 set the y component of the projection direction.
--nz FLOAT=1 set the z component of the projection direction.
--width UINT=100 set the width of the area to be extracted as an height field image.
--height UINT=100 set the height of the area to extracted as an height field image.
--orientAutoFrontX automatically orients the camera in front according the x axis.
--orientAutoFrontY automatically orients the camera in front according the y axis.
--orientAutoFrontZ automatically orients the camera in front according the z axis.
--orientBack change the camera direction to back instead front as given in orientAutoFront{X,Y,Z} options.
--exportNormals export mesh normal vectors (given in the image height field basis).
--backgroundNormalBack set the normals of background in camera opposite direction (to obtain a black background in rendering).
--setBackgroundLastDepth change the default background (black with the last filled intensity).

Example:

$mesh2heightfield -i${DGtal}/examples/samples/tref.off --orientAutoFrontZ --width 25 --height 25 -o heighfield.pgm -s 10

You will obtain such image:

Resulting heightfield.