Model.morphmaptonodesnodelistoffset#

Model.morphmaptonodesnodelistoffset(list_nodes, collection_handles, node_list, use_symmetry, use_constraints, project, vector, offset)#

Maps nodes to, or offset from, a specified line 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 line along a vector, normal to the line, or spaced evenly along the line (if the nodes belong to edge domains).

In the map to geom tool, the line used in this function is created from a node list.

Parameters:
  • list_nodes (EntityList) – The list containing the input node entities

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

  • node_list (EntityList) – The listn containing the target node entities

  • 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 to 11 - Project normal to line

    2 - Fit to line

    If offset is non-zero, the offset will be measured from the closest point on the line for values of 0 and 1.

    The offset will be measured along the projection vector or normal for values of 10 and 11. Offsets will not be applied for a value of 2.

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

  • offset (double) –

    The distance to offset nodes from the target. Not used if project=2.

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

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

Example#

Project nodes on list_nodes normal to a line with ID 23 with an offset of 1.2#
import hm
import hm.entities as ent

model = hm.Model()

model.morphmaptonodesnodelistoffset(
    list_nodes=[ent.Node(model, 1), ent.Node(model, 2)],
    collection_handles=hm.CollectionByInteractiveSelection(model, ent.Handle),
    node_list=[ent.Node(model, 23)],
    use_symmetry=0,
    use_constraints=1,
    project=1,
    vector=[1.0, 0.0, 0.0],
    offset=1.2,
)