Model.linecreatefromcoords#

Model.linecreatefromcoords(type, break_angle, aspect, linear_angle, double_array)#

Creates a line passing through a list of 3D points.

Parameters:
  • type (int) –

    The type of line to generate. Valid values are:

    0 - Linear

    1 - Standard

    2 - Smooth

    3 - User controlled

    When type=3, input values for 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, this point is considered to be a point of discontinuity in the line and a joint is placed (the start of a new NURBS) at this location. Used 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, a joint is placed between the segments. Used when type=3.

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

  • double_array (hwDoubleList) – The ID of the double array that contains the values. 1

Example#

Create a line that passes through 3 points#
import hm
import hm.entities as ent

model = hm.Model()

model.linecreatefromcoords(
    type=0,
    break_angle=150.0,
    aspect=5.0,
    linear_angle=179.0,
    float_array=[
        -2.50392465,
        6.43642072,
        0,
        1.04395604,
        5.9811617,
        0,
        4.56043956,
        5.71428571,
        0,
    ],
)