MGH_TRIANGULATE_RECTANGLE Name
MGH_TRIANGULATE_RECTANGLE Purpose
This function returns a triangulation for a 2D rectangular grid.
Calling Sequence
Result = MGH_TRIANGULATE_RECTANGLE(dims)
Positional Parameters
dims (input, 2-element integer vector)
Dimensions of the grid. Minimum value for each element is 2.
Keyword Parameters
POLYGONS (input, switch)
Set this keyword to return a polygon-descriptor array as
required by an IDLgrPolygon object. Default is to return a
list of triangles as required by GRIDDATA.
Return Value
The function returns a long integer array. Dimensions are
[4,2*(m-1)*(n-1)] if the POLYGONS keyword is set and
[3,2*(m-1)*(n-1)] if it is not, where [m,n] are the input
dimensions.
PERFORMANCE:
Approx linear with number of vertices @ 10^6 vertices per second
on Pentium 3 800 MHz.
###########################################################################
This software is provided subject to the following conditions:
1. NIWA makes no representations or warranties regarding the
accuracy of the software, the use to which the software may
be put or the results to be obtained from the use of the
software. Accordingly NIWA accepts no liability for any loss
or damage (whether direct of indirect) incurred by any person
through the use of or reliance on the software.
2. NIWA is to be acknowledged as the original author of the
software where the software is used or presented in any form.
###########################################################################
Modification History
Mark Hadfield, 2002-07:
Written.
Mark Hadfield, 2008-04:
For the case of polygon-descriptor output (POLYGONS keyword set), the
output is no longer reformed to one dimension, as this is unnecessary.