Model.linecreatefromnodes#

Model.linecreatefromnodes(entitylist, type, break_angle, aspect, linear_angle)#

Creates a line which passes through a list of nodes.

Parameters:
  • entitylist (EntityList) – A list containing the node entity objects.

  • type (int) –

    The type of line to generate. Valid values are:

    0 - Linear

    1 - Standard

    2 - Smooth

    3 - User controlled, values of break_angle, aspect and linear_angle are used.

    Adding 8 to any of the values above will create a closed line of that type.

  • break_angle (double) – Specifies the minimum angle allowed between three points in a line. If the angle between a point and the two adjacent points is less than the angle specified, considers this point to be a point of discontinuity in the line and places a joint (starts a new NURBS) at this location. Valid when type=3.

  • aspect (double) – Specifies the maximum ratio allowed for the distance between a point and the previous point in the line and the distance between the same point and the next point in the line. If the ratio of the distance between the two adjacent segments exceeds the aspect ratio defined, HyperMesh places a joint between the segments. Valid when type=3.

  • linear_angle (double) – Defines the angle at which should consider a line straight. For example, if the line angle between three consecutive points along the line is greater than the linear angle specified, HyperMesh removes the center point from the line. Valid when type=3.

Example#

Create a smooth line that passes through nodes with IDs 1 - 4#
import hm
import hm.entities as ent

model = hm.Model()

model.linecreatefromnodes(
    entitylist=[
        ent.Node(model, 1),
        ent.Node(model, 2),
        ent.Node(model, 3),
        ent.Node(model, 4),
    ],
    type=2,
    break_angle=0.0,
    aspect=0.0,
    linear_angle=0.0,
)