Model.morphpositionshapemark#
- Model.morphpositionshapemark(s_collection, a_collection, n1, n2, n3, n4, n5, n6, xs, ys, zs, mode, scale, tol, system_id, con)#
Positions the shapes on
s_collectionfrom an orientation defined byn1,n2, andn3to an orientation defined byn4,n5, andn6, scale them in the x, y, and z directions using either the local or global system, and affect only the nodes ona_collection. The shapes may be applied to the mesh, created as new shapes, added to existing shapes, or may replace existing shapes.- Parameters:
s_collection (Collection) – The collection containing the shape entities.
a_collection (Collection) – The collection containing the target node entities.
n1 (Entity) – The first entity node that defines the initial position of the shape.
n2 (Entity) – The second entity node that defines the initial position of the shape.
n3 (Entity) – The third entity node that defines the initial position of the shape.
n4 (Entity) – The first entity node that defines the final position of the shape.
n5 (Entity) – The second entity node that defines the final position of the shape.
n6 (Entity) – The third entity node that defines the final position of the shape.
xs (double) – The scaling factor for the shape in x direction.
ys (double) – The scaling factor for the shape in y direction.
zs (double) – The scaling factor for the shape in z direction.
mode (int) –
0 - Apply each shape to the mesh
1 - Apply each shape and add the perturbations to the original shape
2 - Apply each shape and overwrite the original shape
3 - Apply each shape and create a new shape or shapes
4 - Create a new shape or shapes but do not apply them to the mesh
scale (int) –
0 - Do not scale shapes
1 - Scale shapes
tol (double) – The “envelope” or distance around the translated shape inside which nodes are affected.
system_id (int) –
The ID of system used for scaling factors.
0 - Global
con (int) –
0 - Do not use constraints
1 - Use constraints
Examples#
Position a shape from one part of the mesh to another and apply it to the mesh#import hm import hm.entities as ent model = hm.Model() model.morphpositionshapemark( s_collection=hm.Collection(model, ent.Shape, [1]), a_collection=hm.Collection(model, ent.Node), n1=11, n2=12, n3=13, n4=21, n5=22, n6=23, xs=1.0, ys=1.0, zs=1.0, mode=0, scale=0, tol=3.0, system_id=0, con=1, )
Position all shapes from one part of the mesh to another, double them in size, and create new shapes, but only on selected nodes#import hm import hm.entities as ent model = hm.Model() model.morphpositionshapemark( s_collection=hm.Collection(model, ent.Shape), a_collection=hm.Collection(model, ent.Node,[1,2,3,4,5,6,7,8,9,10,11,12]), n1=11, n2=12, n3=13, n4=21, n5=22, n6=23, xs=2.0, ys=2.0, zs=2.0, mode=4, scale=1, tol=3.0, system_id=0, con=1, )