slippy.surface.get_height_of_mat_vr

slippy.surface.get_height_of_mat_vr(ratio: float, profile: numpy.ndarray, void=False, mask=None, accuracy=0.001)[source]

Finds the cut off height of a specified material or void volume ratio

Parameters
  • ratio (float {from 0 to 1}) – the target material or void volume ratio

  • profile (array-like) – The surface profile to be used in the calculation

  • void (bool optional (False)) – If set to true the height for the void volume ratio will be calculated otherwise the height for the material volume ratio will be calculated

  • mask (array-like (bool) same shape as profile or float (defaults to None)) – If an array, the array is used as a mask for the profile, must be the same shape as the profile, if a float is given, values which match are excluded from the calculation

  • accuracy (float optional (0.0001)) – The threshold value to stop iterations

Returns

height – the height at which the input surface has the specified material or void ratio

Return type

float

Notes

This function should not be used without first flattening the surface using subtract_polynomial

This function uses a simplified algorithm assuming that each point in the surface can be modeled as a column of material.

Examples