Model.morphhandleprojectline#

Model.morphhandleprojectline(h_collection, p_collection, line_list, node_list, nproj, proj, sym, con)#

Moves each of the selected handles onto the line defined by the lines and nodes on the lists along a direction defined by the projection type. Applying symmetry links and constraints is optional. All domains influenced by the selected handles will be morphed accordingly.

If nproj=2, the elements on the collection will be used to determine the projection direction for the handles. If no elements are on the collection then all shell elements will be used to determine the projection directions.

Handles linked through symmetry to those selected will be moved in a way that mirrors the selected handles which may or may not move them to other lines in the model.

Constraints may move the perturbed handles off of the selected line after the handles are moved to the line.

Parameters:
  • h_collection (Collection) – The collection containing the handle entities to move.

  • p_collection (Collection) – The collection containing the normal element entities.

  • line_list (EntityList) – The list of the line entities.

  • node_list (EntityList) – The list of the node entities.

  • nproj (int) –

    0 - Project along vector proj

    1 - Project normal to line

    2 - Project normal to elements in p_collection

  • proj (hwTriple) – Temporary projection vector ID

  • sym (int) –

    0 - Ignore symmetry links

    1 - Apply symmetry links

  • con (int) –

    0 - Ignore constraints

    1 - Apply constraints after perturbing handles

Examples#

Project handles to a line along a vector#
import hm
import hm.entities as ent

model = hm.Model()

model.morphhandleprojectline(
    h_collection=hm.Collection(model, ent.Handle),
    p_collection=hm.CollectionByInteractiveSelection(model, ent.Element),
    line_list=[ent.Line(model, 1)],
    node_list=[ent.Node(model, 1)],
    nproj=0,
    proj=[1.0, 0.0, 0.0],
    sym=1,
    con=1,
)
Project handles to a line normal to the line#
import hm
import hm.entities as ent

model = hm.Model()

model.morphhandleprojectline(
    h_collection=hm.Collection(model, ent.Handle),
    p_collection=hm.CollectionByInteractiveSelection(model, ent.Element),
    line_list=[ent.Line(model, 1)],
    node_list=[ent.Node(model, 1)],
    nproj=1,
    proj=[1.0, 0.0, 0.0],
    sym=1,
    con=1,
)
Project handles to a line normal to the elements#
import hm
import hm.entities as ent

model = hm.Model()

model.morphhandleprojectline(
    h_collection=hm.Collection(model, ent.Handle),
    p_collection=hm.Collection(model, ent.Element, [1, 2, 3, 4, 5, 6]),
    line_list=[ent.Line(model, 1)],
    node_list=[ent.Node(model, 1)],
    nproj=2,
    proj=[1.0, 0.0, 0.0],
    sym=1,
    con=1,
)