Model.linecreatespline#

Model.linecreatespline(point_list, scond, econd, svector, evector)#

Creates a cubic spline curve that interpolates input points. Various conditions can be used to specify the spline behavior at the endpoints.

Parameters:
  • point_list (EntityList) – The list of the input points or nodes entities. Minimum of 2 points or nodes must be selected.

  • scond (int) –

    Parameter specifying the constructed spline behavior at curve start. Valid values are:

    0 - Spline direction at endpoint is not constrained

    1 - Spline is closed. In this case any other end condition is ignored. Closed smooth cubic spline is constructed.

    2 - Spline direction at endpoint is tangent to direction of input vector svector.

    3 - Spline direction at endpoint is normal to direction of input vector svector.

    4 - Spline parametric derivative at endpoint equals to input vector svector. Normalized spline parameterization of 0 to 1 is implied.

  • econd (int) –

    Parameter specifying the constructed spline behavior at curve end. Valid values are:

    0 - Spline direction at endpoint is not constrained

    1 - Spline is closed. In this case any other end condition is ignored. Closed smooth cubic spline is constructed.

    2 - Spline direction at endpoint is tangent to direction of input vector evector.

    3 - Spline direction at endpoint is normal to direction of input vector evector.

    4 - Spline parametric derivative at endpoint equals to input vector evector. Normalized spline parameterization of 0 to 1 is implied.

  • svector (hwTriple) – Vector used to apply boundary condition specified by parameter scond. Only required when scond is 2, 3 or 4.

  • evector (hwTriple) – Vector used to apply boundary condition specified by parameter econd. Only required when econd is 2, 3 or 4.

Examples#

Create a closed spline that interpolates nodes with IDs 11 , 12 and 13#
import hm
import hm.entities as ent

model = hm.Model()

model.linecreatespline(
    point_list=[ent.Node(model, 11), ent.Node(model, 12), ent.Node(model, 13)],
    scond=0,
    econd=0,
    svector=[0.0, 0.0, 0.0],
    evector=[0.0, 0.0, 0.0],
)
Create a spline that interpolates the same nodes , is tangent at its start to vector ( 0.0,0.0,1.0 ) and is normal at its end to vector ( 1.0,0.0,0.0 )#
import hm
import hm.entities as ent

model = hm.Model()

model.linecreatespline(
    point_list=[ent.Node(model, 11), ent.Node(model, 12), ent.Node(model, 13)],
    scond=2,
    econd=3,
    svector=[0.0, 0.0, 1.0],
    evector=[1.0, 0.0, 0.0],
)