Model.morphconstraintcreateline#
- Model.morphconstraintcreateline(ncollection, type, name, vec, line, dist, ivec, color)#
Creates 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 to be 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).
name (hwString) – The name of the morph constraint.
vec (hwTriple) – The hwTriple object defining the vector. 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#
Create a morphconstraint for nodes ID 1 - 5 to move along the line ID 12 and projected normally to the line#import hm import hm.entities as ent model = hm.Model() model.morphconstraintcreateline( ncollection=hm.Collection(model, ent.Node, [1, 2, 3, 4, 5]), type=0, name="line", vec=[1.0, 0.0, 0.0], line=ent.Line(model, 12), dist=0.0, ivec=0, color=32, )