Model.setfacetfactor#

Model.setfacetfactor(refine_max, deviation_factor, angle, total)#

Refines geometry graphical facets based on user settings.

Parameters:
  • refine_max (int) –

    The number of times facets should be refined. Valid values are:

    -1 - Return to unrefined display and clear all refinement memory usage.

    0 - Return to unrefined display but do not clear memory.

    > 0 - The number of times to refine the facets.

  • deviation_factor (double) – A value between 0 and 1. The max chordal deviation of all facets is calculated. The chordal deviation of each facet from its surface will be calculated and if the deviation value is more than the tolerance*max chordal deviation, the facet will be refined.

  • angle (double) – If the angle between the lines connecting the facet vertices and the max chordal deviation location for a facet exceed this value, the facet will be refined.

  • total (int) – Ignores all other parameters and tries to refine the model to the specified number of total facets.

Examples#

Refine facets based on a factor of 0.1 and an angle of 10#
import hm
import hm.entities as ent

model = hm.Model()

model.setfacetfactor(refine_max=1, deviation_factor=0.1, angle=10.0, total=0)
Refie facets based on a total of 500 facets#
import hm
import hm.entities as ent

model = hm.Model()

model.setfacetfactor(refine_max=1, deviation_factor=0.1, angle=10.0, total=500)
Clear memory and return to the unrefined display#
import hm
import hm.entities as ent

model = hm.Model()

model.setfacetfactor(refine_max=-1, deviation_factor=0.1, angle=10.0, total=0)