Model.morphhandlerotate#

Model.morphhandlerotate(collection, plane_normal, plane_base, angle, sym, con, vari)#

Rotates handles on the collection.

Parameters:
  • collection (Collection) – The collection containing the handle entities to rotate.

  • plane_normal (hwTriple) – The hwTriple object defining the plane normal components. User can also supply a Python list of three doubles.

  • plane_base (hwTriple) – The hwTriple object defining the base point components of the plane. User can also supply a Python list of three doubles.

  • angle (double) – Angle of rotation.

  • sym (int) –

    0 - Do not use symmetry

    1 - Use symmetry

  • con (int) –

    0 - Do not use constraints

    1 - Use constraints

  • vari (int) –

    Type of rotation (see comments):

    0 - Constant

    1 - Linear

Example#

Rotate all handles on the collection about the axis defined by the plane#
import hm
import hm.entities as ent

model = hm.Model()

model.morphhandlerotate(
collection=hm.CollectionByInteractiveSelection(model, ent.Handle),
plane_normal=[1.0, 0.0, 0.0],
plane_normal_base=[1.0, 0.0, 0.0],
angle=30.0,
sym=1,
con=1,
vari=0,
)

Note

Differs from Model.morphrotatetrue() by the behavior of the influenced nodes. With this function the nodes follow the handles linearly.

If vari=0, all the handles will be rotated by the given angle. If vari=1, the handle farthest from the base point of the plane will be rotated by the given angle and the other handles will be rotated by the given angle times the distance of each handle to the base point of the plane divided by the distance of the farthest handle to the base point of the plane. The distances are measured normal to the plane.

If sym is used, all handles linked to marked handles by symmetry will also be rotated. If con are used, they will be applied to the rotations.