Model.fix_surfaces_orientation#

Model.fix_surfaces_orientation(surfaces, orientation)#

The direction in which reoriented normals point can then be collectively reoriented based on treating the group of 2D surfaces as if they were surfaces of a 3D entity. For example, three adjacent triangular surfaces might define a tetrahedral space even if they are not actually faces of a tetrahedral entity.

Parameters:
  • surfaces (Collection) – The collection containing the surfaces at which you want to make normals consistent.

  • orientation (int) –

    Valid options are:

    0 - All normals point toward the center of the hypothetical 3D element.

    1 - Normals point away from the center of the hypothetical 3D element.

Note

If the selection of surfaces in surfaces includes T-intersections, the results will be unpredictable. Similarly, if the selected surfaces do not define a 3D space (such as in the case of coplanar surfaces) then the final swap of normals determined by the orientation argument may be unpredictable.

Example#

Orient all three surfaces , ( the surface with ID 72 and its two adjacent ) such that their normals point toward the center of the cube . This is happen because this surface and its adjacent surfaces form three adjacent sides of a cubic space .#
import hm
import hm.entities as ent

model = hm.Model()

# Orienting all three surfaces (surface with ID 72 and its 2 adjacents) such that their normals point toward the center of the cube

model.fix_surfaces_orientation(
    surfaces=hm.Collection(model, ent.Surface, [72]), orientation=1
)