================================== ``grail.engines.sgr`` Module ================================== .. include:: ..\..\version.h .. contents:: Table of Contents :backlinks: top ----------- Description ----------- A standard interface to the SGR (Surface Gridding) standalone engine executable. -------------------- Standard Definitions -------------------- point_list: A list of points, defined as: [[x0, y0, z0], ..., [xN, yN, zN]]. coded_point_list: A tuple containing two items: the first item is a code (string), the second is the corresponding point_list. This data type is intended to mimic the srv file format. The code should match with an accompanying parameter file (survey code file). For example, ['BENCH', [[x0, y0, z0], ..., [xN, yN, zN]]] face_list: All face lists are described such that the first index indicates how many faces are in the face. For example, [**3**, 1, 2, **3**, 3, 4, 5, 6] States that there are 3 vertexes in the first face, and those vertexes are 1, 2, 3. Then the next face contains 3 vertexes, which are 4, 5, 6. This may seem a bit confusing, but using this structure buys us some definite efficiencies. Note that all faces in MineSightŪ products have 3 vertexes. --------- Functions --------- .. Note:: Be careful with the filepath strings used in these functions. Since the backslash character is used in Python as an escape character, it is best to use forward slashes (or two backslashes) in the filepaths. Most arguments in these functions correspond to an option in the Standalone engine. All arguments in these functions have a default value of `'None'`, which makes the arguments optional. If left unspecified, the option will **not** be included in the call to the engine executable. Calls to these functions must use **`keyword arguments`** (keywords are the formal parameter names). See the examples below for more details. :df:`sgr(topPointList, topFaceList, botPointList, botFaceList, limitPointList, limitFaceList, bench, prt, grid, vol, xmin, ymin, nx, ny, dx, dy, sbx, sby, hx, hy, dip, azim, mem, cover, extend, feet, real, dat, tmp, e, debug)` Surface Gridding and Volume Calculation Utility. The function creates one of three possible output files (see: `prt`, `grid`, and `vol`) Arguments: :a:`topPointList` : point_list (see `Standard Definitions`_). Points for upper surface or a single surface to grid. :a:`topFaceList` : face_list (see `Standard Definitions`_). Faces for upper surface or a single surface to grid. :a:`botPointList` : point_list (see `Standard Definitions`_).- Points for lower surface (for volume and partials calculations between the upper and lower surfaces). :a:`botFaceList` : face_list (see `Standard Definitions`_). Faces for lower surface (for volume and partials calculations between the upper and lower surfaces). :a:`limitPointList` : point_list (see `Standard Definitions`_). Points for limiting surface. :a:`limitFaceList` : face_list (see `Standard Definitions`_). Faces for limiting surface. :a:`bench` : string Input file containing a list of benches for partials calculations. Contains bench toe elevations arranged in descending order one entry per line. :a:`prt` : string Output cutting and filling partials. Program will create two files (file.cut and file.fil) coded in m659v1 program format and a file.vol with volumes per bench. :a:`grid` : string Output file with a grid coded in m610v1 program format. :a:`vol` : string Output file with cut and fill volumes between upper and lower surfaces. :a:`xmin/ymin` : integer X/Y coordinates of the origin of the grid. :a:`nx/ny` : integer Number of columns/rows in a grid. :a:`dx/dy` : integer Width/height of a cell. :a:`sbx/sby` : integer Number of sub-columns/sub-rows in a cell. :a:`hx/hy` : integer X/Y coordinates of hinge point. :a:`dip` : integer Dip of bench inclination (degrees). :a:`azimuth` : integer Azimuth of bench (degrees). :a:`mem` : integer Maximal allowed size of allocated memory in Megabytes. Default size is 10. :a:`cover` : integer Program defines -xmin,-ymin, -nx and -ny parameters to cover all surface(s) with the grid. Set value to 1 to turn on this option. :a:`extend` : integer Program defines -nx and -ny parameters to cover surface(s), starting from the user specified origin. Set value to 1 to turn on this option. :a:`feet` : integer Report imperial measurements. Set value to 1 to turn on this option. :a:`real` : integer Output real co-ordinates rather then indices in files produced with grid and prt arguments. Set value to 1 to turn on this option. :a:`dat` : string Define a directory for input and output files. :a:`tmp` : string Define a directory for intermediate files. :a:`e` : integer Economy mode - Program dumps out results to the disk as soon as possible to save memory. Set value to 1 to turn on this option. :a:`debug` : integer Debug option will output the command string used to call the engine executable and will relay any output messages from the engine. Set value to 1 to turn on this option. Example: .. Python:: from grail.engines import sgr #use keyword arguments in function call sgr.sgr(topPointList=upper_pts, topFaceList=upper_faces, botPointList=lower_pts, botFaceList=lower_faces, vol="C:/out.prt", xmin=0, ymin=0, nx=20, ny=20, dx=10, dy=10, sbx=10, sby=10)