Model.morphmapdifference#

Model.morphmapdifference(m_collection, f_collection, i_line_list, i_node_list, f_line_list, f_node_list, r_plane_normal, r_plane_base, rotate, axis, sym, con, blend, mbias, fbias)#

Creates two lines and maps selected nodes from one to the other optionally following the curvature differences (rotate) between the lines and/or mapping about an axis (axis and plane) or using a number of linear mapping options.

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 argument allows you to apply section mapping for sections that apply about an axis (axis=1). Section lines should lie in one or more radial planes or lie in planes normal to the axis of rotation.

The axis argument 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. option=0 projects each node normal to the plane of each section line which is best when the lines lie in the same plane. option=2, the preferred option, approximates the section line as a straight line and projects the nodes normal to the line, which is better for non-planar lines. option=3 projects the nodes along a specified vector. option=4 is like option=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. option=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 node entities.

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

  • i_line_list (EntityList) – The list containing the line entity for the to the initial postion line.

  • i_node_list (EntityList) – The list contatining the node entities for the initial position line.

  • f_line_list (EntityList) – The list containing the line entity for the to the final postion line.

  • f_node_list (EntityList) – The list contatining the node entities for the final position line.

  • r_plane_normal (hwTriple) – The hwTriple object defining the plane normal components of the plane used for axis rotation. 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 for axis rotation. 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

  • 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

  • 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

  • mbias (double) – Bias factor of mapped nodes.

  • fbias (double) – Bias factor of fixed nodes.

Examples#

Map nodes from one line to another using rotation#
import hm
import hm.entities as ent

model = hm.Model()

initial_node_list = []
final_node_list = []
model.morphmapdifference(
    m_collection=hm.Collection(model, ent.Node, [1, 2, 3]),
    f_collection=hm.Collection(model, ent.Node, [11, 12, 13]),
    i_line_list=[ent.Line(model, 31)],
    i_node_list=initial_node_list,
    f_line_list=[ent.Line(model, 32)],
    f_node_list=final_node_list,
    r_plane_normal=[1.0, 0.0, 0.0],
    r_plane_base=[1.0, 0.0, 0.0],
    rotate=1,
    axis=0,
    sym=0,
    con=1,
    blend=0,
    mbias=1.0,
    fbias=1.0,
)
Map nodes from one line to another about an axis with no rotation, blending through the mesh, and biasing factors of 2.0#
import hm
import hm.entities as ent

model = hm.Model()

initial_node_list = []
final_node_list = []
model.morphmapdifference(
    m_collection=hm.Collection(model, ent.Node, [1, 2, 3]),
    f_collection=hm.Collection(model, ent.Node, [11, 12, 13]),
    i_line_list=[ent.Line(model, 31)],
    i_node_list=initial_node_list,
    f_line_list=[ent.Line(model, 32)],
    f_node_list=final_node_list,
    r_plane_normal=[1.0, 0.0, 0.0],
    r_plane_base=[1.0, 0.0, 0.0],
    rotate=1,
    axis=1,
    sym=0,
    con=1,
    blend=2,
    mbias=2.0,
    fbias=2.0,
)