Model.morphhandlepertnormal#

Model.morphhandlepertnormal(collectionhandle, collectionelem, dist, sym, con, umark)#

Perturbs handles on collection normal to elements

Parameters:
  • collectionhandle (Collection) – The collection containing the handle entities to perturb.

  • collectionelem (Collection) – The collection containing the element entities that tha handles should be normal to.

  • dist (double) – Distance of perturbation

  • sym (int) –

    Flag to use symmetry:

    0 - Do not use symmetry

    1 - Use symmetry

  • con (int) –

    Flag to use constraints:

    0 - Do not use constraints

    1 - Use constraints

  • umark (int) –

    Flag to only use in the collection:

    0 - Use all elements to calculate normals

    1 - Use only the selected elements to calculate normals

Example#

All handles on the collection will be given a perturbation equal to dist in the normal direction as determined by either the selected elements or by all elements. If symmetry is used,all handles linked to marked handles by symmetry will also be perturbed. If constraints are used, they will be applied to the perturbations.#
import hm
import hm.entities as ent

model = hm.Model()

model.morphhandlepertnormal(
collectionhandle=hm.CollectionByInteractiveSelection(model, ent.Handle),
collectionelem=hm.CollectionByInteractiveSelection(model, ent.Element),
dist=3.0,
sym=1,
con=1,
umark=1,
)