Model.marksmoothelements#

Model.marksmoothelements(tosmoothcollection, toanchorcollection, smoothmethod, iterations)#

Applies a smoothing algorithm to a collection of elements for a given number of iterations. Optionally, one or more nodes may be specified as being anchored in place and not movable.

Parameters:
  • tosmoothcollection (Collection) – The collection containing the element entities to be smoothed.

  • toanchorcollection (Collection) – The collection containing the node entities on those elements that are not adjustable.

  • smoothmethod (int) –

    The smoothing method to use.

    1 - autodecide

    2 - size corrected

    3 - shape corrected

    4 - angle corrected

  • iterations (int) – The number of times to apply the smoothing operator.

Example#

Smooth elements with IDs 100 through 110 twelve times with no nodes fixed#
import hm
import hm.entities as ent

model = hm.Model()

Elements = hm.Collection(model, ent.Element, list(range(100, 111)))
Nodes = hm.Collection(model, ent.Node, [2])
model.marksmoothelements(
    tosmoothcollection=Elements, toanchorcollection=Nodes, smoothmethod=1, iterations=12
)