Model.morphhandleprojectentity#
- Model.morphhandleprojectentity(h_collection, e_collection, p_collection, nproj, proj, sym, con)#
Moves each of the selected handles onto the selected surfaces or elements along a direction defined by the projection type. Applying symmetry links and constraints is optional. All domains influenced by the selected handles will be morphed accordingly.
If
nproj=2, the elements on the mark will be used to determine the projection direction for the handles. If no elements are on the mark then all shell elements will be used to determine the projection directions.Handles linked through symmetry to those selected will be moved in a way that mirrors the selected handles which may or may not move them to other lines in the model.
Constraints may move the perturbed handles off of the selected line after the handles are moved to the line.
- Parameters:
h_collection (Collection) – The collection containing the handle entities to move.
e_collection (Collection) – The collection containing the entities to move the handles into. Valid entities surfaces and elements.
p_collection (Collection) – The collection containing the normal element entities.
nproj (int) –
0 - Project along vector proj
1 - Project normal to line
2 - Project normal to elements in
p_collectionproj (hwTriple) – The hwTriple object defining the temporary projection vector ID. User can also supply a Python list of three doubles.
sym (int) –
0 - Ignore symmetry links
1 - Apply symmetry links
con (int) –
0 - Ignore constraints
1 - Apply constraints after perturbing handles
Examples#
Project handles to a surface along a vector#import hm import hm.entities as ent model = hm.Model() model.morphhandleprojectentity( h_collection=hm.Collection(model, ent.Handle), e_collection=hm.Collection(model, ent.Surface, [12]), p_collection=hm.Collection(model, ent.Element, [2]), nproj=0, proj=[1.0, 0.0, 0.0], sym=1, con=1, )
Project handles to a mesh normal to the mesh#import hm import hm.entities as ent model = hm.Model() model.morphhandleprojectentity( h_collection=hm.Collection(model, ent.Handle), e_collection=hm.Collection(model, ent.Element, [1, 2, 3, 4, 5, 6]), p_collection=hm.Collection(model, ent.Element, [2]), nproj=1, proj=[1.0, 0.0, 0.0], sym=1, con=1, )
Project handles to a surface normal to the selected elements#import hm import hm.entities as ent model = hm.Model() model.morphhandleprojectentity( h_collection=hm.Collection(model, ent.Handle), e_collection=hm.Collection(model, ent.Element, [12]), p_collection=hm.Collection(model, ent.Element, [7, 8, 9, 10, 11, 12]), nproj=2, proj=[1.0, 0.0, 0.0], sym=1, con=1, )