Model.morphconstraintcreateplane#
- Model.morphconstraintcreateplane(ncollection, type, name, vec, plane_normal, plane_base, dist, ivec, color)#
Creates a plane type morphconstraint for the selected nodes with the option of having those nodes either move along the plane or be bounded by it.
- Parameters:
ncollection (Collection) – The collection containing the node entities to be constrained.
type (int) –
0 - Moves along the plane
1 - Bounded by the plane
3 - Remains a set distance from the plane
5 - Remains its original distance from the plane
+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 morph constraint.
vec (hwTriple) – The hwTriple object defining the vector. User can also supply a Python list of three doubles.
plane_normal (hwTriple) – The hwTriple object defining the plane normal components. User can also supply a Python list of three doubles.
plane_base (hwTriple) – The hwTriple object defining the base point components of the plane. User can also supply a Python list of three doubles.
dist (double) – The minimum distance from the bounding plane.
ivec (int) –
0 - The plane normal is used for distance and projection. The nodes will be moved normally to the plane when constraining them or measuring the distance the nodes are away from the plane.
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#
Create a morphconstraint for nodes to move along a plane and projected normally to the plane#import hm import hm.entities as ent model = hm.Model() model.morphconstraintcreateplane( ncollection=hm.Collection(model, ent.Node, [1, 2, 3, 4, 5]), type=0, name="plane", vec=[1.0, 0.0, 0.0], plane_normal=[1.0, 0.0, 0.0], plane_normal_base=[0.0, 0.0, 0.0], dist=0.0, ivec=0, color=32, )