Create Best Fit Trend Surface

Use Case Description

This script was generated to provide the ability to create a best fit trend surface from an input solid. This trend surface can then be used to create dip and dip direction information for use in dynamic anisotropy within resource estimation workflows. It should be noted that this tool seeks to create a general trend rather than a precise mid-plane of a solid. As such the position may not lie exactly at the mid point of the solid.

Capability

The script works by firstly converting the input solid to a .obj file for use in the python script, this eases the transfer of the points of the solid but could have been done with a point list instead or a .str file. This may be improved in future versions. The script then utilises the vertices of the solid and fits a best fit plane to the input point and a selection of neighbour points. This best fit plane is used as a local co-ordinate structure to make the following maths easier. 

A polynomial surface is then fit to these points based on the Poly Degree parameter, this applies a smoothing effect to the output model. The edges of the polynomial model are controlled by building a convex hull around all input points, if the trend surface goes outside this hull then the trend of the last known points are used. This helps to prevent wild edge cases where the output surface can behave badly.

Finally we sample the polynomial model at a fixed grid spacing to find where the output points should be located for the output surface and transform these back in to real world co-ords. The points are then triangulated to an output .obj file for python simplicity and converted back in to a Surpac .sdm file.

It should be noted that this script will only work if you have the required python libraries installed and have a version of Surpac that can execute python scripts. It is recommended to use it on GA versions of Surpac 2026 RF2 and above

Output

The script will output a trend surface based on the points of the input sdm.

Video

Script

Example Dataset

​​​​​​​