Model.morphconstraintcreateangle#

Model.morphconstraintcreateangle(scollection, type, name, n1, n2, n3, vec, angle, bound, color)#

Creates a model type constraint based on the angle between three nodes.

Parameters:
  • scollection (Collection) – The collection containing the input shape entities.

  • type (int) –

    0 - Measure angle node to node

    1 - Measure angle using vector

  • name (hwString) – Name of morph constraint.

  • n1 (Entity) – The node entity defining the first end of angle.

  • n2 (Entity) – The node entity defining the the vertex of the angle.

  • n3 (Entity) – The node entity defining the second end of angle.

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

  • angle (double) – Constrained angle.

  • bound (int) –

    -1 - Greater than specified angle

    0 - Equal to specified angle

    1 - Less than specified angle

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

Example#

This function creates a model type constraint for the three selected nodes with the option of having those nodes measured in the plane that they lie in or perpendicular to a vector and the option of having the angle forced to be greater than, less than, or equal to the specified angle.#
import hm
import hm.entities as ent

model = hm.Model()

model.morphconstraintcreateangle(
     scollection=hm.CollectionByInteractiveSelection(model, ent.Shape),
     type=0,
     name="angle",
     n1=ent.Node(model,21),
     n2=ent.Node(model,22),
     n3=ent.Node(model,23),
     vec=[1.0, 0.0, 0.0],
     angle=45.0,
     bound=0,
     color=32,
)

Note

The shapes on the scollection will be used to force the model into compliance with the specified constraint, if possible.