Model.morphconstraintcreatefc#
- Model.morphconstraintcreatefc(ncollection, type, name, color)#
Creates either a fixed type morphconstraint, or a cluster type morphconstraint for the selected nodes with the option of having mesh stretching around those nodes. Rotation options are also available for cluster type morphconstraints.
There are three options for rotation: in-plane, out-of-plane, and full rotation. In-plane will limit rotation of the cluster to the plane in which the cluster lies (spinning) while out-of-plane limits the rotation of the cluster to take place normal to the plane of the cluster (tilting). Full rotation allows both in-plane and out-of-plane rotation. For cluster constraints where the nodes do not lie in a discernable plane any rotation option results in full rotation.
- Parameters:
ncollection (Collection) – The collection containing the node entities to be constrained.
type (int) –
0 - Fixed type constraint without mesh stretching
6 - Fixed type constraint with mesh stretching
7 - Cluster type constraint with mesh stretching (no rotation)
9 - Cluster type constraint without mesh stretching (no rotation)
+10 - (types 17 and 19) enables out-of-plane rotation for clusters
+20 - (types 27 and 29) enables in-plane rotation for clusters
+30 - (types 37 and 39) enables full rotation for clusters
name (hwString) – The name of the morphconstraint entity.
color (int) – The color of the constraint. Valid values are 1-64.
Examples#
Create a cluster morphconstraint with mesh stretching and full rotation#import hm import hm.entities as ent model = hm.Model() model.morphconstraintcreatefc( ncollection=hm.Collection(model, ent.Node), type=37, name="rivet", color=12 )
Create a cluster morphconstraint without mesh stretching and with in - plane rotation#import hm import hm.entities as ent model = hm.Model() model.morphconstraintcreatefc( ncollection=hm.Collection(model, ent.Node), type=29, name="rivet", color=12 )