Model.morphmaplinestolines#

Model.morphmaplinestolines(m_collection, t_collection, i_line_list, f_line_list, fixed_collection, r_plane_normal, r_plane_base, rotate, blend, axis, sym, con)#

Maps selected elements lying on an initial set of lines to an interpolated cross section represented by another set of lines optionally rotating trailing nodes and/or mapping about an axis (axis and plane) or using a number of linear mapping options.

Interpolates a number of Model.morphmapdifference() calls between line pairs. It is critical that the order of the initial lines match the order of the final lines in their respective lists for this function to function properly. For best results the lines should be planar (cross-sections) and should intersect at right angles.

If blend=1, no fixed nodes have been selected, and no mapped nodes are a part of any domain, this function will automatically assign all non-mapped nodes as fixed nodes.

If blend=2, the blending will only be applied to nodes which lie along the mesh between the fixed nodes and the mapped nodes.

The axis option allows you to apply section mapping for sections that apply about an axis (option 1). Section lines should lie in one or more radial planes or lie in planes normal to the axis of rotation.

The axis option is also used to select the type of projection for the nodes to the section lines. This projection determines how the section lines influence the nodes. axis=0 is preferred, which projects each node normal to the plane of each section line. axis=2 approximates the section line as a straight line and projects the nodes normal to the line, which is better for non-planar lines. axis=3 projects the nodes along a specified vector. axis=4 is like axis=2, but the projection line is forced to be in the specified plane, which is better for non-planar lines which you want to behave like planar lines. axis=5 does not project the nodes to the lines, but instead uses Kriging to determine the morphing of the nodes.

Parameters:
  • m_collection (Collection) – The collection containing the mapped element entities.

  • t_collection (Collection) – The collection containing the trailing node entities.

  • i_line_list (EntityList) – The list containing the line entities marking the initial position of the mapped elements.

  • f_line_list (EntityList) – The list containing the line entities marking the final position of the mapped elements.

  • fixed_collection (Collection) – The collection containing the fixed node entities.

  • r_plane_normal (hwTriple) – The hwTriple object defining the plane normal components of the plane used for axis of rotation and projection options for axis 3 and 4. User can also supply a Python list of three doubles.

  • r_plane_base (hwTriple) – The hwTriple object defining the base point components of the plane used for axis of rotation and projection options for axis 3 and 4. User can also supply a Python list of three doubles.

  • rotate (int) –

    0 - Linear point to point mapping between lines.

    1 - Rotate nodes along with curvature difference between lines

  • blend (int) –

    0 - Do not blend unselected nodes.

    1 - Blend all nodes other than mapped and fixed nodes

    2 - Blend only nodes on mesh between mapped and fixed nodes

  • axis (int) –

    0 - Project nodes to line normal to the plane of the line (preferred)

    1 - Apply mapping about axis defined by r_plane

    2 - Project nodes to line normal to the axis of the line

    3 - Project nodes to line along vector (r_plane normal)

    4 - Project nodes to line in plane (r_plane)

    5 - Use kriging to map nodes

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

  • con (int) –

    0 - Do not use constraints.

    1 - Use constraints

Examples#

Map a mesh given two sets of three lines each use rotation, no blending, and project nodes normal to the planes of the lines#
import hm
import hm.entities as ent

model = hm.Model()

model.morphmaplinestolines(
    m_collection=hm.Collection(model, ent.Element),
    t_collection=hm.CollectionByInteractiveSelection(model, ent.Node),
    i_line_list=[ent.Line(model, 11), ent.Line(model, 12), ent.Line(model, 13)],
    f_line_list=[ent.Line(model, 21), ent.Line(model, 22), ent.Line(model, 23)],
    fixed_collection=hm.CollectionByInteractiveSelection(model, ent.Node),
    r_plane_normal=[1.0, 0.0, 0.0],
    r_plane_base=[1.0, 0.0, 0.0],
    rotate=1,
    blend=0,
    axis=0,
    sym=0,
    con=1,
)
Map a mesh given two sets of three lines each about an axis use no rotation, and blend through the mesh#
import hm
import hm.entities as ent

model = hm.Model()

model.morphmaplinestolines(
    m_collection=hm.Collection(model, ent.Element),
    t_collection=hm.CollectionByInteractiveSelection(model, ent.Node),
    i_line_list=[ent.Line(model, 11), ent.Line(model, 12), ent.Line(model, 13)],
    f_line_list=[ent.Line(model, 21), ent.Line(model, 22), ent.Line(model, 23)],
    fixed_collection=hm.CollectionByInteractiveSelection(model, ent.Node),
    r_plane_normal=[1.0, 0.0, 0.0],
    r_plane_base=[1.0, 0.0, 0.0],
    rotate=1,
    blend=2,
    axis=1,
    sym=0,
    con=1,
)