Model.linecreatenormalfromgeom#

Model.linecreatenormalfromgeom(point_collection, geom_collection, length, mode)#

Creates straight segment lines of a user defined length from a given set of points or nodes normally to a given set of geometry entities. The segment is created for each pair of point and geometry. The input nodes/points must be attached or associated with their respective geometry.

Parameters:
  • point_collection (Collection) – The collection containing the input point entities. Valid entities are nodes and points.

  • geom_collection (Collection) – The collection containing the geometry entities. Valid entities are lines, surfaces and solids.

  • length (double) – The length of the normal line.

  • mode (int) –

    Indicates different modes. Bit values are used and the value is calculated as (Bit0 + 2*Bit1).

    Bit0

    0 - The normal direction is used, which is the default case

    1 - The direction opposite to the normal direction is used to create the segment

    Bit1

    Specifies how entities are organized into components. Valid values are:

    0 - Line is created in the current component, which is the default value.

    1 - Line is created in the input geometry component.

    Show Bit value calculator
    Radio Button Table
    Option Name Value
    Parameter that specifies the normal direction (Bit0)
    Parameter that specifies how line entities are organized into components (Bit1)
    Calculated argument value: 0

Example#

Create a straight segment normally from node with ID 10 to surface with ID 21 and with length 18.0#
import hm
import hm.entities as ent

model = hm.Model()

model.linecreatenormalfromgeom(
    point_collection=hm.Collection(model, ent.Node, [10]),
    geom_collection=hm.Collection(model, ent.Surface, [21]),
    length=18.0,
    mode=0,
)