Model.morphconstraintupdatesurf#
- Model.morphconstraintupdatesurf(ncollection, type, mcon, vec, surf, dist, ivec, color)#
Updates a surface type morphconstraint for the selected nodes with the option of having those nodes either move along the surface or be bounded by it.
- Parameters:
ncollection (Collection) – The collection containing the node entities that are constrained.
type (int) –
0 - Moves along the surface
1 - Bounded by the surface
3 - Remains a set distance from the surface
5 - Remains its original distance from the surface
+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.
surf (Entity) – The surface entity.
dist (double) – The minimum distance from the bounding surface.
ivec (int) –
0 - The surface normal is used for distance and projection. The nodes will be moved normally to the surface when constraining them or measuring the distance the nodes are away from the surface.
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 plane.
color (int) – The color of the constraint. Valid values are 1-64.
Example#
Update a morphconstraint for nodes to move along a surface and projected normally to the surface#import hm import hm.entities as ent model = hm.Model() model.morphconstraintupdatesurf( 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], surf=ent.Surface(model, 12), dist=0.0, ivec=0, color=32, )