Model.morphmaptoplanevecoffset#

Model.morphmaptoplanevecoffset(collection_nodes, collection_handles, plane_normal, plane_base, use_symmetry, use_constraints, project, vector, mode, offset)#

Maps nodes to, or offset from, the specified plane using the temporary shape created by Model.morphmaptshp() and Model.morphmaptshpedge() as a guide. Selected handles can optionally follow behind the morphing operation.

Nodes can be projected on to the plane along a vector, normal to the plane, or projected normal to the elements touching the nodes.

Parameters:
  • collection_nodes (Collection) – The collection containing the node entities.

  • collection_handles (Collection) – The collection containing the handle entities.

  • 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.

  • use_symmetry (int) – 0 - Do not use symmetry (only option)

  • use_constraints (int) –

    0 - Do not use constraints

    1 - Use constraints

  • project (int) –

    0 or 10 - Project along vector defined by vector_id

    1 or 11 - Project normal to the plane

    2 or 12 - Project normal to shell elements touching nodes

    If offset is non-zero, the offset will be measured from the closest point on the surfaces for values of 0 and 1. The offset will be measured along the projection vector or normal for values of 10, 11 and 12.

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

  • mode (int) –

    0 - If Model.morphmaprecalc() has been used to calculate new influences

    1 - To recalculate new influences inside this function

  • offset (double) –

    The distance to offset nodes from the target.

    The offset will be measured from the closest point on the plane for values of project of 0, 1, and 2.

    The offset will be measured along the projection vector normal for values of project of 10, 11, and 12.

Example#

Map nodes selected interactively to the x-y plane with an offset of 1.2 when not using Model.morphmaprecalc()#
import hm
import hm.entities as ent

model = hm.Model()

model.morphmaptoplanevecoffset(
    collection_nodes=hm.CollectionByInteractiveSelection(model, ent.Node),
    collection_handles=hm.CollectionByInteractiveSelection(model, ent.Handle),
    plane_normal=[1.0, 0.0, 0.0],
    plane_normal_base=[1.0, 0.0, 0.0],
    use_symmetry=0,
    use_constraints=1,
    project=1,
    vector=[1.0, 0.0, 0.0],
    mode=1,
    offset=1.2,
)