Model.morphvolumecreateflex#

Model.morphvolumecreateflex(e_collection, xd, yd, zd, buff, system_id, han, order, tan, m_collection, alines, apoints, mlines, mpoints, plane_normal, plane_base, method, drag)#

Creates one or more morph volumes starting from a profile defined by morph volumes, elements, lines, x-y densities, or rho-theta densities, and dragging them along a line, a nodelist, along a vector, about an axis, or through the element or nodes on the collection. It can also be used to generate a morph volume matrix using the global system or a local system although profile shrinking is not available for this option.

After generation the matrix will be enlarged to fit the selected nodes or elements if the initial drag does not contain them. Thus, the edges of the morph volumes may not fit the initial profile or be limited by the specified drag distance or angle.

Profile shrinking will shrink each profile along the drag direction in order to fit the morph volume matrix close to the mesh taking into account the specified buffer zone value.

Parameters:
  • e_collection (Collection) – The collection containing the input node or element entities.

  • xd (int) – Density of the profile mesh in the x or radial direction (for off-axis profiles, the x direction is the direction closest to either the global x axis or the global y axis if the global x axis is parallel to the drag direction).

  • yd (int) – Density of the profile mesh in the y or tangential direction.

  • zd (int) – Density of the morph volume matrix in the dragged direction.

  • buff (double) – Percentage buffer zone between matrix and enclosed entities.

  • system_id (int) – ID of system used to orient matrix (method 0). If the specified system is cylindrical, the matrix will be laid out in a cylindrical fashion.

  • han (int) –

    0 - Do not create handles for morph volumes

    1 - Create handles for morph volumes

  • order (int) –

    The order of morph volumes:

    1 - No mid-edge handles

    2 - One mid-edge handle

    3 - 6 - Two to five mid-edge handles

  • tan (int) –

    0 - No tangency

    1 - Make neighboring morph volume edges continuously tangent

  • m_collection (Collection) – The collection containing the morph volume or element entities for the profile.

  • alines (EntityList) – A list containing the line entity objects used to create line to drag matrix.

  • apoints (EntityList) – A list containing the node entity objects used to create line to drag matrix.

  • mlines (EntityList) – A list containing the line entity objects used to create the profile.

  • mpoints (EntityList) – A list containing the node entity objects used to create the profile.

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

  • method (int) –

    Select the dragging method and add the desired profile to calculate the method. Dragging method:

    0 - Create matrix with densities x, y, and z in global system if sysid is 0 otherwise use specified system

    1 - Drag profile along line

    2 - Drag profile along node list

    3 - Drag profile along vector

    4 - Drag profile about an axis

    5 - Drag profile through a mesh (profile must be defined by mvol, elements, lines, or a node list to use this option

    6 - Drag profile along vector, forcing the center to be the base point of the defined plane (for this method, the profile must be cylindrical fit to mesh and thus the method value must be either 36 or 1036)

    Profile selection:

    +0 - Rectangular profile fit to mesh

    +10 - Rectangular profile fit to lines

    +20 - Rectangular profile fit to node list

    +30 - Cylindrical profile fit to mesh

    +40 - Cylindrical profile fit to lines

    +50 - Cylindrical profile fit to node list

    +60 - Use morph volume faces for profile

    +70 - Use shell elements for profile

    +1000 Add profile shrinking after creation

  • drag (double) – Distance or angle for drag (useable for along vector and about axis method).

Examples#

Create a rectangular matrix 2x2x5 dragged along a line#
import hm
import hm.entities as ent

model = hm.Model()

model.morphvolumecreateflex(
    e_collection=hm.Collection(model, ent.Node),
    xd=2,
    yd=2,
    zd=5,
    buff=10.0,
    system_id=0,
    han=1,
    order=1,
    tan=1,
    m_collection=hm.CollectionByInteractiveSelection(model, ent.Element),
    alines=[ent.Line(model, 3)],
    apoints=[ent.Node(model, 2)],
    mlines=[ent.Line(model, 4)],
    mpoints=[ent.Node(model, 3)],
    plane_normal=[1.0, 0.0, 0.0],
    plane_normal_base=[1.0, 0.0, 0.0],
    method=1,
    drag=0.0,
)
Create a cylindrical matrix 1x4x5 dragged from morph volumes along a vector ( note that the plane normal is used for the vector direction )#
import hm
import hm.entities as ent

model = hm.Model()

model.morphvolumecreateflex(
    e_collection=hm.Collection(model, ent.Node),
    xd=1,
    yd=4,
    zd=5,
    buff=10.0,
    system_id=0,
    han=1,
    order=1,
    tan=1,
    m_collection=hm.Collection(model, ent.Morphvolume),
    alines=[ent.Line(model, 3)],
    apoints=[ent.Node(model, 2)],
    mlines=[ent.Line(model, 4)],
    mpoints=[ent.Node(model, 3)],
    plane_normal=[1.0, 0.0, 0.0],
    plane_normal_base=[1.0, 0.0, 0.0],
    method=63,
    drag=0.0,
)