Model.morphconstraintupdateline#

Model.morphconstraintupdateline(ncollection, type, mcon, vec, line, dist, ivec, color)#

Updates a line type morphconstraint for the selected nodes with the option of having those nodes either move along the line or be bounded by it.

Parameters:
  • ncollection (Collection) – The collection containing the node entities that are constrained.

  • type (int) –

    0 - moves along the line

    1 - bounded by the line

    3 - remains a set distance from the line

    5 - remains its original distance from the line

    +32 - enable mesh stretching around constrained nodes. Add this value to the type (thus 1, 3, and 5 become 33, 35, and 37).

  • mcon (Entity) – The morph constraint entity to update.

  • vec (hwTriple) – The hwTriple object defining the vector components. User can also supply a Python list of three doubles.

  • line (Entity) – The line entity.

  • dist (double) – The minimum distance from the bounding line.

  • ivec (int) –

    0 - The line normal is used for distance and projection. The nodes will be moved normally to the line when constraining them or measuring the distance the nodes are away from the line.

    1 - The vector is used for distance and projection. The nodes will be moved along the vector when constraining them or measuring the distance the nodes are away from the line.

  • color (int) – The color of the constraint. Valid values are 1-64.

Example#

Update a morphconstraint with ID 12 for nodes with IDs 1 , 2 , 3 , 4 , 5 to move along a line and projected normally to the line with ID 12#
import hm
import hm.entities as ent

model = hm.Model()


model.morphconstraintupdateline(
    ncollection=hm.Collection(model, ent.Node, [1, 2, 3, 4, 5]),
    type=0,
    mcon=ent.Morphconstraint(model, 12),
    vec=[1.0, 0.0, 0.0],
    line=ent.Line(model, 12),
    dist=0.0,
    ivec=0,
    color=32,
)