Model.hm_clustersurfaces#

Model.hm_clustersurfaces(collection, featAngle)#

Forms clusters of surfaces from the given input collection of surfaces, grouping surfaces that are adjacent with angle less than the specified threshold. The surfaces are grouped even across t-connection edges. The function returns a list of lists of surface IDs.

Parameters:
  • collection (Collection) – The collection containing the surface entities to cluster.

  • featAngle (double) – The angle threshold (in degrees) used for grouping two surfaces together. If the angle between two surfaces at common edge is less than this value, they are grouped together.

Returns:

Example#

Group all the surfaces that are connected at an angle less than 20 degrees at the common edge#
import hm
import hm.entities as ent

model = hm.Model()

surface_collection = hm.Collection(model, ent.Surface)

_, resultlist = model.hm_clustersurfaces(collection=surface_collection, featAngle=20.0)

for result in resultlist:
    print("Surfaces:", [s.id for s in result.clusterSurfs])