Model.morphhandleprojectentityoffset#
- Model.morphhandleprojectentityoffset(h_collection, e_collection, extend, p_collection, nproj, proj, sym, con, offset)#
Moves each of the selected handles onto the selected surfaces or elements along a direction defined by the projection type. Applying symmetry links, constraints, and an offset are optional. All domains influenced by the selected handles will be morphed accordingly.
If
nprojis set to 2, 5, or 6, the shell elements on the collection will be used to determine the projection direction for the handles. If no elements are on the collection, then all shell elements will be used to determine the projection directions.If symmetry is specified, 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 the selected surfaces or elements after the handles are moved to the entities.
The offset can be set as an absolute amount, an amount added to half the sum of the thickness of the shells touching the handles and the target elements, or an amount multiplied by half the sum of the thickness of the shells touching the handles and the target elements.
- Parameters:
h_collection (Collection) – The collection containing the handle entities to move.
e_collection (Collection) – The collection containing the entities for the handles to moved onto. Valid entities are surfaces and elements.
extend (int) –
0 - Disable
1 - Enable
p_collection (Collection) – The collection containing the element entities to be normal to.
nproj (int) –
The projection type.
0 - Project along vector
proj1 - Project normal to line
2 - Project normal to elements in
p_colllection(averaged)5 - Project normal to elements in
p_colllection(smoothed)6 - Project normal to elements in
p_colllection(cfd corners)+20 - offset distance = (t1 + t2) / 2 +
offset+40 - offset distance = (t1 + t2) / 2 *
offsetproj (hwTriple) – The hwTriple object defining the components of the temporary projeciton vector. 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
offset (double) – The distance the handles will be offset from line (or added to or multiplied by half the thickness of the shells touching the handles and half the thickness of the target elements).
Examples#
Project all the handles to the surface with ID 12 along the vector ( 1.0,0.0,0.0 )#import hm import hm.entities as ent model = hm.Model() model.morphhandleprojectentityoffset( h_collection=hm.Collection(model, ent.Handle), e_collection=hm.Collection(model, ent.Surface, [12]), extend=0, p_collection=hm.CollectionByInteractiveSelection(model, ent.Element), nproj=1, proj=[1.0, 0.0, 0.0], sym=1, con=1, offset=0.0, )
Project al the handles to a mesh normal to the mesh#import hm import hm.entities as ent model = hm.Model() model.morphhandleprojectentityoffset( h_collection=hm.Collection(model, ent.Handle), e_collection=hm.Collection(model, ent.Element, [1,2,3,4,5,6]), extend=0, p_collection=hm.CollectionByInteractiveSelection(model, ent.Element), nproj=1, proj=[1.0, 0.0, 0.0], sym=1, con=1, offset=0.0, )
Project all the handles to a surface normal to the selected elements and offset by the 1.5x the thickness#import hm import hm.entities as ent model = hm.Model() model.morphhandleprojectentityoffset( h_collection=hm.Collection(model, ent.Handle), e_collection=hm.Collection(model, ent.Element, [7,8,9,10,11,12]), extend=0, p_collection=hm.CollectionByInteractiveSelection(model, ent.Element), nproj=22, proj=[1.0, 0.0, 0.0], sym=1, con=1, offset=1.5, )