Model.morphconstraintupdatelayer#
- Model.morphconstraintupdatelayer(n_collection, e_collection, type, morphconstraint_entity, color)#
Update a layer type morphconstraint for the selected nodes such that they move relative to the selected elements, effectively mapping nodes in layers to those on the selected elements. This option works best for nodes that were created in identical layers, such as with the element offset or drag elements functionalities used to create a stack of solid elements with a shell mesh. It is intended for use with CFD boundary layer meshes.
The nodes will maintain their original distances relative to the elements when the elements are morphed. The nodes will also match the movements of the elements in translation, translation and rotation, or be allowed to slide parallel to the normal direction of the elements based on the type selected. Also, mesh stretching may be enabled to smooth the transition between the constraint and the rest of the mesh.
- Parameters:
n_collection (Collection) – The collection containing the node entities to be constrained.
e_collection (Collection) – The collection containing the element entities to which the nodes will be constrained.
type (int) –
0 - Force inner layers to always be normal to the outer layer
1 - Allow sliding normal to the outer layer
2 - Fix only translations between the elements and the layers
3 - Fix both translation and rotation between the elements and the layers
+8 - Stretch mesh around the constrained nodes
+16 - Use “cfd corners” method to calculate normals
morphconstraint_entity (Entity) – The morph constraint entity.
color (int) – The color of the constraint. Valid values are 1 through 64.
Example#
Update a layer constraint with ID 1 to be fixed in both rotation and translation ( type = 3 ) , with mesh stretching enabled ( type +8 ) and use the CFD corners method ( type +16 for a total of 27 )#import hm import hm.entities as ent model = hm.Model() model.morphconstraintupdatelayer( n_collection=hm.Collection(model, ent.Node), e_collection=hm.Collection( model, ent.Element, [207, 213, 217, 218, 220, 221, 223, 225, 226] ), type=27, morphconstraint_entity=ent.Morphconstraint(model, 1), color=38, )